unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* uniquify-buffer-name-style
@ 2006-05-29  3:01 Luc Teirlinck
  2006-05-29 21:28 ` uniquify-buffer-name-style Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Luc Teirlinck @ 2006-05-29  3:01 UTC (permalink / raw)


Setting `uniquify-buffer-name-style' outside Custom currently only
takes effect after uniquify.el is loaded.  This misfeature is caused
by the use of defadvice in uniquify.el.  As getting rid of this advice
in uniquify.el requires non-trivial changes to the C code, I do not
believe that it would be advisable to do this at the present time.

In the patch below, I just document the misfeature and add a comment
about the desirability to get rid of it instead.  I can install if
desired.

===File ~/uniquify.el-diff==================================
*** uniquify.el	06 Feb 2006 16:02:02 -0600	1.61
--- uniquify.el	28 May 2006 21:09:47 -0500	
***************
*** 93,99 ****
    "Unique buffer names dependent on file name."
    :group 'applications)
  
! 
  (defcustom uniquify-buffer-name-style nil
    "*If non-nil, buffer names are uniquified with parts of directory name.
  The value determines the buffer name style and is one of `forward',
--- 93,100 ----
    "Unique buffer names dependent on file name."
    :group 'applications)
  
! ;; The last paragraph of the docstring below should really be made obsolete
! ;; by eliminating the dependence on advice.
  (defcustom uniquify-buffer-name-style nil
    "*If non-nil, buffer names are uniquified with parts of directory name.
  The value determines the buffer name style and is one of `forward',
***************
*** 104,110 ****
    reverse        name\\mumble\\bar  name\\mumble\\quux
    post-forward   name|bar/mumble  name|quux/mumble
    post-forward-angle-brackets   name<bar/mumble>  name<quux/mumble>
!   nil            name  name<2>"
    :type '(radio (const forward)
  		(const reverse)
  		(const post-forward)
--- 105,116 ----
    reverse        name\\mumble\\bar  name\\mumble\\quux
    post-forward   name|bar/mumble  name|quux/mumble
    post-forward-angle-brackets   name<bar/mumble>  name<quux/mumble>
!   nil            name  name<2>
! 
! This variable only takes effect when uniquify.el is loaded.  If you set
! this variable in your .emacs, also specify `(require 'uniquify)'.
! Setting this variable through Custom automatically loads uniquify.el if it
! is not already loaded."
    :type '(radio (const forward)
  		(const reverse)
  		(const post-forward)
============================================================

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

* Re: uniquify-buffer-name-style
  2006-05-29  3:01 uniquify-buffer-name-style Luc Teirlinck
@ 2006-05-29 21:28 ` Richard Stallman
  2006-05-29 21:39   ` uniquify-buffer-name-style Luc Teirlinck
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2006-05-29 21:28 UTC (permalink / raw)
  Cc: emacs-devel

It seems to me that adding a simple hook (abnormal) for
Fcreate_file_buffer and Frename_buffer to call could make it possible
to eliminate that defadvice, and then it would be easy to fix this
bug.

It could be tricky figuring out the right calling conventions for the
hook functions so that a single hook could do for both
Fcreate_file_buffer and Frename_buffer, and still be simple.

If we don't do this, we can document the problem, but the text you
wrote is terribly ambiguous.  In fact, I am not sure what it means.

Do you mean that:

    If you set the variable directly before uniquify is loaded,
    it won't have any effect.

Or do you mean that:

    If you set this variable when uniquify is already loaded,
    it won't have any effect unless you reload uniquify.

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

* Re: uniquify-buffer-name-style
  2006-05-29 21:28 ` uniquify-buffer-name-style Richard Stallman
@ 2006-05-29 21:39   ` Luc Teirlinck
  2006-05-30 16:00     ` uniquify-buffer-name-style Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Luc Teirlinck @ 2006-05-29 21:39 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:

   If we don't do this, we can document the problem, but the text you
   wrote is terribly ambiguous.  In fact, I am not sure what it means.

If uniquify is already loaded, setting the variable takes effect immediately.
Otherwise, it only takes effect once uniquify is loaded.

Sincerely,

Luc.

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

* Re: uniquify-buffer-name-style
  2006-05-29 21:39   ` uniquify-buffer-name-style Luc Teirlinck
@ 2006-05-30 16:00     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2006-05-30 16:00 UTC (permalink / raw)
  Cc: emacs-devel

    If uniquify is already loaded, setting the variable takes effect immediately.
    Otherwise, it only takes effect once uniquify is loaded.

Please say that in the text.

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

end of thread, other threads:[~2006-05-30 16:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-29  3:01 uniquify-buffer-name-style Luc Teirlinck
2006-05-29 21:28 ` uniquify-buffer-name-style Richard Stallman
2006-05-29 21:39   ` uniquify-buffer-name-style Luc Teirlinck
2006-05-30 16:00     ` uniquify-buffer-name-style Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).