diff options
| -rw-r--r-- | lisp/uniquify.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/uniquify.el b/lisp/uniquify.el index 448ce6f4744..88f513de32c 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el | |||
| @@ -385,21 +385,23 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil." | |||
| 385 | ;; (This ought to set some global variables so the work is done only for | 385 | ;; (This ought to set some global variables so the work is done only for |
| 386 | ;; buffers with names similar to the deleted buffer. -MDE) | 386 | ;; buffers with names similar to the deleted buffer. -MDE) |
| 387 | 387 | ||
| 388 | (defun delay-uniquify-rationalize-file-buffer-names () | 388 | (defun uniquify-delay-rationalize-file-buffer-names () |
| 389 | "Add `delayed-uniquify-rationalize-file-buffer-names' to `post-command-hook'. | 389 | "Add `delayed-uniquify-rationalize-file-buffer-names' to `post-command-hook'. |
| 390 | For use on, eg, `kill-buffer-hook', to rationalize *after* buffer deletion." | 390 | For use on, eg, `kill-buffer-hook', to rationalize *after* buffer deletion." |
| 391 | (if (and uniquify-buffer-name-style | 391 | (if (and uniquify-buffer-name-style |
| 392 | uniquify-after-kill-buffer-p) | 392 | uniquify-after-kill-buffer-p |
| 393 | ;; Rationalizing is costly, so don't do it for temp buffers. | ||
| 394 | (uniquify-buffer-file-name (current-buffer))) | ||
| 393 | (add-hook 'post-command-hook | 395 | (add-hook 'post-command-hook |
| 394 | 'delayed-uniquify-rationalize-file-buffer-names))) | 396 | 'uniquify-delayed-rationalize-file-buffer-names))) |
| 395 | 397 | ||
| 396 | (defun delayed-uniquify-rationalize-file-buffer-names () | 398 | (defun uniquify-delayed-rationalize-file-buffer-names () |
| 397 | "Rerationalize buffer names and remove self from `post-command-hook'. | 399 | "Rerationalize buffer names and remove self from `post-command-hook'. |
| 398 | See also `delay-rationalize-file-buffer-names' for hook setter." | 400 | See also `delay-rationalize-file-buffer-names' for hook setter." |
| 399 | (uniquify-rationalize-file-buffer-names) | 401 | (uniquify-rationalize-file-buffer-names) |
| 400 | (remove-hook 'post-command-hook | 402 | (remove-hook 'post-command-hook |
| 401 | 'delayed-uniquify-rationalize-file-buffer-names)) | 403 | 'uniquify-delayed-rationalize-file-buffer-names)) |
| 402 | 404 | ||
| 403 | (add-hook 'kill-buffer-hook 'delay-uniquify-rationalize-file-buffer-names) | 405 | (add-hook 'kill-buffer-hook 'uniquify-delay-rationalize-file-buffer-names) |
| 404 | 406 | ||
| 405 | ;;; uniquify.el ends here | 407 | ;;; uniquify.el ends here |