all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* uniquify conflicts with package workgroups2
@ 2014-01-06 19:40 Mirko M.
  2014-01-06 21:41 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Mirko M. @ 2014-01-06 19:40 UTC (permalink / raw)
  To: help-gnu-emacs

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.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-08 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-06 19:40 uniquify conflicts with package workgroups2 Mirko M.
2014-01-06 21:41 ` Stefan Monnier
2014-01-07 15:53   ` Mirko M.
2014-01-08 12:58     ` Stefan Monnier

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.