changeset 46047:24044f416cc3

(uniquify-delay-rationalize-file-buffer-names): Rename from delay-uniquify-rationalize-file-buffer-names. Only rationalize if the buffer is under uniquify control. (uniquify-delayed-rationalize-file-buffer-names): Rename from delayed-uniquify-rationalize-file-buffer-names.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 27 Jun 2002 15:35:48 +0000
parents 743d753b9c4b
children 05db6f1e91ca
files lisp/uniquify.el
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/uniquify.el	Thu Jun 27 14:49:22 2002 +0000
+++ b/lisp/uniquify.el	Thu Jun 27 15:35:48 2002 +0000
@@ -385,21 +385,23 @@
 ;; (This ought to set some global variables so the work is done only for
 ;; buffers with names similar to the deleted buffer.  -MDE)
 
-(defun delay-uniquify-rationalize-file-buffer-names ()
+(defun uniquify-delay-rationalize-file-buffer-names ()
   "Add `delayed-uniquify-rationalize-file-buffer-names' to `post-command-hook'.
 For use on, eg, `kill-buffer-hook', to rationalize *after* buffer deletion."
   (if (and uniquify-buffer-name-style
-	   uniquify-after-kill-buffer-p)
+	   uniquify-after-kill-buffer-p
+	   ;; Rationalizing is costly, so don't do it for temp buffers.
+	   (uniquify-buffer-file-name (current-buffer)))
       (add-hook 'post-command-hook
-		'delayed-uniquify-rationalize-file-buffer-names)))
+		'uniquify-delayed-rationalize-file-buffer-names)))
 
-(defun delayed-uniquify-rationalize-file-buffer-names ()
+(defun uniquify-delayed-rationalize-file-buffer-names ()
   "Rerationalize buffer names and remove self from `post-command-hook'.
 See also `delay-rationalize-file-buffer-names' for hook setter."
   (uniquify-rationalize-file-buffer-names)
   (remove-hook 'post-command-hook
-	       'delayed-uniquify-rationalize-file-buffer-names))
+	       'uniquify-delayed-rationalize-file-buffer-names))
 
-(add-hook 'kill-buffer-hook 'delay-uniquify-rationalize-file-buffer-names)
+(add-hook 'kill-buffer-hook 'uniquify-delay-rationalize-file-buffer-names)
 
 ;;; uniquify.el ends here