help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rename Shell buffer with current directory


From: Michael Heerdegen
Subject: Re: Rename Shell buffer with current directory
Date: Sun, 08 Dec 2013 22:32:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Sebastien,

>   (defun my-rename-buffer-to-curdir (&optional _string)
>     "Change Shell buffer's name to current directory."
>     (message "%s" default-directory)
>     (rename-buffer (concat "*shell " default-directory "*")))
>
>   (add-hook 'shell-mode-hook 'my-rename-buffer-to-curdir)
>
>   (add-hook 'comint-output-filter-functions 'my-rename-buffer-to-curdir nil t)
                                                                              ^
> However, that does not change the end result: the name of the buffer is
> unchanged.

Why do you use a non-nil LOCAL parameter for `add-hook'?  Without it,
your code works for me.

> Should I report this as an Emacs bug?

No.


Regards,

Michael.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]