mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-02-01 20:06:00 +00:00
(uniquify-maybe-rerationalize-w/o-cb): Remove
uniquify-after-kill-buffer-p dependency. (uniquify-kill-buffer-function): New function. (kill-buffer-hook): Use uniquify-kill-buffer-function. (Bug#1315)
This commit is contained in:
parent
406aaa6f6d
commit
43ae2c48f7
@ -1,3 +1,14 @@
|
||||
2008-11-15 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* uniquify.el (uniquify-maybe-rerationalize-w/o-cb):
|
||||
Remove uniquify-after-kill-buffer-p dependency.
|
||||
(uniquify-kill-buffer-function): New function.
|
||||
(kill-buffer-hook): Use uniquify-kill-buffer-function. (Bug#1315)
|
||||
|
||||
* term/ns-win.el (ns-do-applescript, ns-popup-font-panel): Declare.
|
||||
(ns-show-manual, menu-bar-help-menu): Update for merge of ns-emacs into
|
||||
main Emacs manual.
|
||||
|
||||
2008-11-15 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* window.el (quit-window): Restore delete window with second
|
||||
|
@ -427,22 +427,27 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil."
|
||||
|
||||
;;; Hooks from the rest of Emacs
|
||||
|
||||
(defun uniquify-maybe-rerationalize-w/o-cb ()
|
||||
"Re-rationalize buffer names, ignoring current buffer."
|
||||
(and (cdr uniquify-managed)
|
||||
uniquify-buffer-name-style
|
||||
(uniquify-rerationalize-w/o-cb uniquify-managed)))
|
||||
|
||||
;; Buffer deletion
|
||||
;; Rerationalize after a buffer is killed, to reduce coinciding buffer names.
|
||||
;; This mechanism uses `kill-buffer-hook', which runs *before* deletion, so
|
||||
;; it calls `uniquify-rerationalize-w/o-cb' to rerationalize the buffer list
|
||||
;; ignoring the current buffer (which is going to be deleted anyway).
|
||||
(defun uniquify-maybe-rerationalize-w/o-cb ()
|
||||
(defun uniquify-kill-buffer-function ()
|
||||
"Re-rationalize buffer names, ignoring current buffer.
|
||||
For use on `kill-buffer-hook'."
|
||||
(if (and (cdr uniquify-managed)
|
||||
uniquify-buffer-name-style
|
||||
uniquify-after-kill-buffer-p)
|
||||
(uniquify-rerationalize-w/o-cb uniquify-managed)))
|
||||
(and uniquify-after-kill-buffer-p
|
||||
(uniquify-maybe-rerationalize-w/o-cb)))
|
||||
|
||||
;; Ideally we'd like to add it buffer-locally, but that doesn't work
|
||||
;; because kill-buffer-hook is not permanent-local :-(
|
||||
(add-hook 'kill-buffer-hook 'uniquify-maybe-rerationalize-w/o-cb)
|
||||
;; FIXME kill-buffer-hook _is_ permanent-local in 22+.
|
||||
(add-hook 'kill-buffer-hook 'uniquify-kill-buffer-function)
|
||||
|
||||
;; The logical place to put all this code is in generate-new-buffer-name.
|
||||
;; It's written in C, so we would add a generate-new-buffer-name-function
|
||||
|
Loading…
x
Reference in New Issue
Block a user