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 [EMACS_22_BASE]


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/uniquify.el,v [EMACS_22_BASE]
Date: Mon, 29 Oct 2007 11:59:28 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Juanma Barranquero <lektu>      07/10/29 11:59:28

Index: uniquify.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/uniquify.el,v
retrieving revision 1.62.2.3
retrieving revision 1.62.2.4
diff -u -b -r1.62.2.3 -r1.62.2.4
--- uniquify.el 28 Oct 2007 16:48:51 -0000      1.62.2.3
+++ uniquify.el 29 Oct 2007 11:59:27 -0000      1.62.2.4
@@ -419,6 +419,23 @@
 
 ;;; Hooks from the rest of Emacs
 
+;; 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 ()
+  "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)))
+
+;; 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)
+
 ;; 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
 ;; which, if non-nil, would be called instead of the C.  One problem with
@@ -456,23 +473,6 @@
         (file-name-nondirectory filename)
         (file-name-directory filename) ad-return-value))))
 
-;; 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 ()
-  "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)))
-
-;; 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)
-
 (provide 'uniquify)
 
 ;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065




reply via email to

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