all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 22.2.1 desktop / uniquify: wrong buffer naming for multiple files of the same name
@ 2008-04-24  7:42 Martin Fischer
  2008-04-24 13:48 ` Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Fischer @ 2008-04-24  7:42 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

######################################################################

Consider the attached .emacs in an otherwise empty home directory.

Edit files of the same name residing in different directories.

For example:

  c:\emacs-22.2\bin\runemacs.exe c:\test\a\jack.txt c:\test\b\jack.txt

  M-x list-buffers RET

  .   jack.txt\b               0  Text		  c:/test/b/jack.txt
      jack.txt\a               0  Text		  c:/test/a/jack.txt
      *scratch*                0  Lisp Interaction
    * *Messages*             243  Fundamental

  C-x C-c

The resulting .emacs.desktop is attached.

Restart emacs like this:

  c:\emacs-22.2\bin\runemacs.exe

  M-x list-buffers

  .   jack.txt\b               0  Text		  c:/test/b/jack.txt
      jack.txt                 0  Text		  c:/test/a/jack.txt
      *scratch*                0  Lisp Interaction
    * *Messages*             280  Fundamental


Note the different naming of file c:/test/a/jack.txt.

If you edit more than two files of the same name every other buffer is
named the conventional way like jack.txt<2> and so on.

######################################################################


[-- Attachment #2: .emacs --]
[-- Type: application/octet-stream, Size: 625 bytes --]

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(desktop-save-mode t)
 '(uniquify-buffer-name-style (quote reverse) nil (uniquify))
 '(uniquify-min-dir-content 1))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

[-- Attachment #3: .emacs.desktop --]
[-- Type: application/octet-stream, Size: 865 bytes --]

;; -*- mode: emacs-lisp; coding: emacs-mule; -*-
;; --------------------------------------------------------------------------
;; Desktop File for Emacs
;; --------------------------------------------------------------------------
;; Created Wed Apr 23 16:32:07 2008
;; Desktop file format version 206
;; Emacs version 22.2.1

;; Global section:
(setq desktop-missing-file-warning nil)
(setq tags-file-name nil)
(setq tags-table-list nil)
(setq search-ring nil)
(setq regexp-search-ring nil)
(setq register-alist nil)

;; Buffer section -- buffers listed in same order as in buffer list:
(desktop-create-buffer 206
  "c:/test/b/jack.txt"
  "jack.txt"
  'text-mode
  nil
  1
  '(nil nil)
  nil
  nil
  nil)

(desktop-create-buffer 206
  "c:/test/a/jack.txt"
  "jack.txt"
  'text-mode
  nil
  1
  '(nil nil)
  nil
  nil
  nil)


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

* Re: 22.2.1 desktop / uniquify: wrong buffer naming for multiple files of the same name
  2008-04-24  7:42 22.2.1 desktop / uniquify: wrong buffer naming for multiple files of the same name Martin Fischer
@ 2008-04-24 13:48 ` Juanma Barranquero
  2008-04-25  2:20   ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2008-04-24 13:48 UTC (permalink / raw)
  To: Martin Fischer; +Cc: bug-gnu-emacs

>   M-x list-buffers
>
>   .   jack.txt\b               0  Text            c:/test/b/jack.txt
>       jack.txt                 0  Text            c:/test/a/jack.txt
>       *scratch*                0  Lisp Interaction
>     * *Messages*             280  Fundamental

If, before you restart Emacs, you edit .emacs.desktop and switch the
two `desktop-create-buffer' calls (so the first one is for
c:/test/a/jack.txt and the second one is for c:/test/b/jack.txt),
Emacs 22 restores it correctly

.   jack.txt\a               0  Text		  c:/test/a/jack.txt
    jack.txt\b               0  Text		  c:/test/b/jack.txt
    *scratch*                0  Lisp Interaction
  * *Messages*             274  Fundamental

So it could be a problem with uniquify, not desktop. I'll take a
closer look and be back.

 Juanma




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

* Re: 22.2.1 desktop / uniquify: wrong buffer naming for multiple files of the same name
  2008-04-24 13:48 ` Juanma Barranquero
@ 2008-04-25  2:20   ` Stefan Monnier
  2008-04-25 16:11     ` Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2008-04-25  2:20 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: bug-gnu-emacs, Martin Fischer

>> M-x list-buffers
>> 
>> .   jack.txt\b               0  Text            c:/test/b/jack.txt
>> jack.txt                 0  Text            c:/test/a/jack.txt
>> *scratch*                0  Lisp Interaction
>> * *Messages*             280  Fundamental

> If, before you restart Emacs, you edit .emacs.desktop and switch the
> two `desktop-create-buffer' calls (so the first one is for
> c:/test/a/jack.txt and the second one is for c:/test/b/jack.txt),
> Emacs 22 restores it correctly

> .   jack.txt\a               0  Text		  c:/test/a/jack.txt
>     jack.txt\b               0  Text		  c:/test/b/jack.txt
>     *scratch*                0  Lisp Interaction
>   * *Messages*             274  Fundamental

> So it could be a problem with uniquify, not desktop. I'll take a
> closer look and be back.

Yes, it sounds like a uniquify problem, tho it looks like it's triggered
by the way desktop loads the file.


        Stefan




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

* Re: 22.2.1 desktop / uniquify: wrong buffer naming for multiple files of the same name
  2008-04-25  2:20   ` Stefan Monnier
@ 2008-04-25 16:11     ` Juanma Barranquero
  2008-04-29  7:10       ` Stefan Monnier
       [not found]       ` <mailman.10913.1209453021.18990.bug-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Juanma Barranquero @ 2008-04-25 16:11 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: bug-gnu-emacs, Martin Fischer

On Fri, Apr 25, 2008 at 4:20 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:

>  Yes, it sounds like a uniquify problem, tho it looks like it's triggered
>  by the way desktop loads the file.

Definitely it is a uniquify problem, related to using
`uniquify-min-dir-content' > 0.

ELISP> (find-file-noselect "c:/test/a/jack.txt")
#<buffer a/jack.txt>
ELISP> (with-current-buffer (get-buffer "a/jack.txt")
	 (rename-buffer "jack.txt" t))
"a/jack.txt"
ELISP> (find-file-noselect "c:/test/b/jack.txt")
#<buffer b/jack.txt>
ELISP> (with-current-buffer (get-buffer "b/jack.txt")
	 (rename-buffer "jack.txt" t))
"b/jack.txt"

However:

ELISP> (find-file-noselect "c:/test/b/jack.txt")
#<buffer b/jack.txt>
ELISP> (with-current-buffer (get-buffer "b/jack.txt")
	 (rename-buffer "jack.txt" t))
"b/jack.txt"
ELISP> (find-file-noselect "c:/test/a/jack.txt")
#<buffer a/jack.txt>
ELISP> (with-current-buffer (get-buffer "a/jack.txt")
	 (rename-buffer "jack.txt" t))
"jack.txt"

Stefan, can you take a look at it?

 Juanma




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

* Re: 22.2.1 desktop / uniquify: wrong buffer naming for multiple files of the same name
  2008-04-25 16:11     ` Juanma Barranquero
@ 2008-04-29  7:10       ` Stefan Monnier
  2008-04-29  8:21         ` Juanma Barranquero
       [not found]       ` <mailman.10913.1209453021.18990.bug-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2008-04-29  7:10 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: bug-gnu-emacs, Martin Fischer

ELISP> (find-file-noselect "c:/test/a/jack.txt")
> #<buffer a/jack.txt>
ELISP> (with-current-buffer (get-buffer "a/jack.txt")
> 	 (rename-buffer "jack.txt" t))
> "a/jack.txt"
ELISP> (find-file-noselect "c:/test/b/jack.txt")
> #<buffer b/jack.txt>
ELISP> (with-current-buffer (get-buffer "b/jack.txt")
> 	 (rename-buffer "jack.txt" t))
> "b/jack.txt"

> However:

ELISP> (find-file-noselect "c:/test/b/jack.txt")
> #<buffer b/jack.txt>
ELISP> (with-current-buffer (get-buffer "b/jack.txt")
> 	 (rename-buffer "jack.txt" t))
> "b/jack.txt"
ELISP> (find-file-noselect "c:/test/a/jack.txt")
> #<buffer a/jack.txt>
ELISP> (with-current-buffer (get-buffer "a/jack.txt")
> 	 (rename-buffer "jack.txt" t))
> "jack.txt"

> Stefan, can you take a look at it?

I believe this case now works correctly,


        Stefan




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

* Re: 22.2.1 desktop / uniquify: wrong buffer naming for multiple files of the same name
  2008-04-29  7:10       ` Stefan Monnier
@ 2008-04-29  8:21         ` Juanma Barranquero
  0 siblings, 0 replies; 7+ messages in thread
From: Juanma Barranquero @ 2008-04-29  8:21 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: bug-gnu-emacs, Martin Fischer

>  I believe this case now works correctly,

Yes, thanks.

 Juanma




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

* Re: 22.2.1 desktop / uniquify: wrong buffer naming for multiple files of the same name
       [not found]       ` <mailman.10913.1209453021.18990.bug-gnu-emacs@gnu.org>
@ 2008-04-29 10:26         ` Martin Fischer
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Fischer @ 2008-04-29 10:26 UTC (permalink / raw)
  To: bug-gnu-emacs


  >>>>> Stefan Monnier writes:
  > Date: Tue, 29 Apr 2008 03:10:06 -0400

8<--------------------------------------------------------------------

  > I believe this case now works correctly,
  > 
  > 
  >         Stefan

Tested with nine files and it works.

Thanks a lot

Martin
-- 
parozusa at web dot de


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

end of thread, other threads:[~2008-04-29 10:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-24  7:42 22.2.1 desktop / uniquify: wrong buffer naming for multiple files of the same name Martin Fischer
2008-04-24 13:48 ` Juanma Barranquero
2008-04-25  2:20   ` Stefan Monnier
2008-04-25 16:11     ` Juanma Barranquero
2008-04-29  7:10       ` Stefan Monnier
2008-04-29  8:21         ` Juanma Barranquero
     [not found]       ` <mailman.10913.1209453021.18990.bug-gnu-emacs@gnu.org>
2008-04-29 10:26         ` Martin Fischer

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.