From: Mirko M. <mirko.m@hotmail.com>
To: help-gnu-emacs@gnu.org
Subject: uniquify conflicts with package workgroups2
Date: Mon, 6 Jan 2014 19:40:23 +0000 (UTC) [thread overview]
Message-ID: <loom.20140106T203416-659@post.gmane.org> (raw)
Hello,
I found that uniquify conflicts with the package workgroups2: when
workgroups2 restores a session, buffer names are retrieved from the
saved session, then uniquify treats those names as "base names" for
each buffer and eventually adds a string (maybe yet present) to
uniquify them, e.g. ".emacs:/root" will become ".emacs:/root:/root".
I managed to solve the problem forcing uniquify to get the "base name"
form the file name if the buffer is visiting a file, else it uses the
buffer name, which could have been retrieved by workgroups2.
----------
diff -c /usr/share/emacs/24.3/lisp/uniquify.el /root/uniquify.el
*** /usr/share/emacs/24.3/lisp/uniquify.el 2014-01-06 11:58:01.000000000 +0100
--- /root/uniquify.el 2014-01-06 15:37:49.100158663 +0100
***************
*** 280,285 ****
--- 280,291 ----
(when new-fix-list
(uniquify-rationalize new-fix-list))))
+ (defun uniquify-item-file (item)
+ "Get the buffer file name or the current buffer name."
+ (if (buffer-file-name)
+ (file-name-nondirectory (buffer-file-name))
+ (uniquify-item-base item)))
+
(defun uniquify-rationalize (fix-list)
;; Set up uniquify to re-rationalize after killing/renaming
;; if there is a conflict.
***************
*** 287,293 ****
(with-current-buffer (uniquify-item-buffer item)
;; Refresh the dirnames and proposed names.
(setf (uniquify-item-proposed item)
! (uniquify-get-proposed-name (uniquify-item-base item)
(uniquify-item-dirname item)))
(setq uniquify-managed fix-list)))
;; Strip any shared last directory names of the dirname.
--- 293,299 ----
(with-current-buffer (uniquify-item-buffer item)
;; Refresh the dirnames and proposed names.
(setf (uniquify-item-proposed item)
! (uniquify-get-proposed-name (uniquify-item-file item)
(uniquify-item-dirname item)))
(setq uniquify-managed fix-list)))
;; Strip any shared last directory names of the dirname.
Diff finished. Mon Jan 6 15:48:02 2014
----------
Thanks,
Mirko M.
next reply other threads:[~2014-01-06 19:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 19:40 Mirko M. [this message]
2014-01-06 21:41 ` uniquify conflicts with package workgroups2 Stefan Monnier
2014-01-07 15:53 ` Mirko M.
2014-01-08 12:58 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20140106T203416-659@post.gmane.org \
--to=mirko.m@hotmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.