From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mirko M. Newsgroups: gmane.emacs.help Subject: uniquify conflicts with package workgroups2 Date: Mon, 6 Jan 2014 19:40:23 +0000 (UTC) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1389037536 14506 80.91.229.3 (6 Jan 2014 19:45:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Jan 2014 19:45:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 06 20:45:42 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W0G7J-0003aN-JK for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Jan 2014 20:45:41 +0100 Original-Received: from localhost ([::1]:37334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0G7J-0006MT-8m for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Jan 2014 14:45:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0G6r-0006Kh-0N for help-gnu-emacs@gnu.org; Mon, 06 Jan 2014 14:45:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0G6j-0002Lz-Mv for help-gnu-emacs@gnu.org; Mon, 06 Jan 2014 14:45:12 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:36323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0G6j-0002I8-FK for help-gnu-emacs@gnu.org; Mon, 06 Jan 2014 14:45:05 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W0G6h-0002Nu-R7 for help-gnu-emacs@gnu.org; Mon, 06 Jan 2014 20:45:03 +0100 Original-Received: from host179-165-dynamic.14-87-r.retail.telecomitalia.it ([87.14.165.179]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Jan 2014 20:45:03 +0100 Original-Received: from mirko.m by host179-165-dynamic.14-87-r.retail.telecomitalia.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Jan 2014 20:45:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 87.14.165.179 (Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20140105 Firefox/17.0) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95283 Archived-At: 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.