emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/uniquify.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/uniquify.el,v
Date: Sat, 15 Nov 2008 22:33:17 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/11/15 22:33:17

Index: uniquify.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/uniquify.el,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -b -r1.75 -r1.76
--- uniquify.el 1 Jul 2008 14:58:28 -0000       1.75
+++ uniquify.el 15 Nov 2008 22:33:16 -0000      1.76
@@ -427,22 +427,27 @@
 
 ;;; 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




reply via email to

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