[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
uniquify conflicts with package workgroups2
From: |
Mirko M . |
Subject: |
uniquify conflicts with package workgroups2 |
Date: |
Mon, 6 Jan 2014 19:40:23 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
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.
- uniquify conflicts with package workgroups2,
Mirko M . <=