unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: emacs-devel@gnu.org
Subject: Re: problem with uniquify.el and kill-buffer-hook
Date: Fri, 13 Dec 2002 10:48:57 -0500	[thread overview]
Message-ID: <200212131548.gBDFmva14269@rum.cs.yale.edu> (raw)
In-Reply-To: buod6o6r7nc.fsf@mcspd15.ucom.lsi.nec.co.jp

> Recently I've noticed that the `uniquify' package has stopped working
> correctly, in particular, the feature controlled by the
> `uniquify-after-kill-buffer-p' variable doesn't work; here's the doc:
> 
>    uniquify-after-kill-buffer-p's value is t
> 
>    If non-nil, rerationalize buffer names after a buffer has been killed.
>    This can be dangerous if Emacs Lisp code is keeping track of buffers
>    by their names (rather than keeping pointers to the buffers
>    themselves).
> 
> I looked at the code a bit, and I think I found the problem:
> 
> This feature works by adding an appropriate local hook to
> `kill-buffer-hook' in all the affected buffers.
> 
> However, this is done _before_ the buffer's mode is set (in the new
> buffer that caused uniqify to be triggered); since most mode functions
> call `kill-all-local-variables', this trashes the `kill-buffer-hook'.

Duh!

> Also, any ideas why this just stopped working recently?  I didn't see
> any _obvious_ things in the ChangeLogs, but maybe I just missed it.

It's due to:

2002-09-27  Stefan Monnier  <monnier@cs.yale.edu>

	* uniquify.el (uniquify-rationalize-file-buffer-names):
	Add to kill-buffer-hook for buffers with conflict.
	(rename-buffer): Check kill-buffer-hook to see if there was a conflict.
	(uniquify-delay-rationalize-file-buffer-names): Remove useless check.
	(kill-buffer-hook): Don't change globally.

I guess it should just be reverted.  Please do it (unless you can come
up with a fix, of course).  I don't have easy access to the CVS right now.

This patch did not fix any real bug anyway.

> Another thing (whew!), is that uniquify.el uses `defadvice' (on
> `rename-buffer', and `create-file-buffer') and I wonder if it should be
> changed to just have those functions invoke it directly.

That's a long standing issue indeed.


	Stefan

  reply	other threads:[~2002-12-13 15:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-13  2:10 problem with uniquify.el and kill-buffer-hook Miles Bader
2002-12-13 15:48 ` Stefan Monnier [this message]
2002-12-14 18:31 ` Richard Stallman
2002-12-14 21:36   ` Miles Bader
2002-12-16 16:43     ` Richard Stallman
2002-12-16 17:01       ` Stefan Monnier
2002-12-17 18:44         ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200212131548.gBDFmva14269@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).