diff options
| author | Juanma Barranquero | 2007-10-29 11:59:27 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2007-10-29 11:59:27 +0000 |
| commit | 58be68a88be71f32fab80bef46aeb95e6f8c0c27 (patch) | |
| tree | bb2768de515ff7dea94dfb820988d453b0de8418 | |
| parent | b3bea338e652b412a3546ac73b809bd483ebeb44 (diff) | |
| download | emacs-58be68a88be71f32fab80bef46aeb95e6f8c0c27.tar.gz emacs-58be68a88be71f32fab80bef46aeb95e6f8c0c27.zip | |
(uniquify-maybe-rerationalize-w/o-cb): Define it before use
to avoid a warning in packages that require uniquify.
| -rw-r--r-- | lisp/uniquify.el | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lisp/uniquify.el b/lisp/uniquify.el index a9e5fbea946..0c21fc0eb3b 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el | |||
| @@ -419,6 +419,23 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil." | |||
| 419 | 419 | ||
| 420 | ;;; Hooks from the rest of Emacs | 420 | ;;; Hooks from the rest of Emacs |
| 421 | 421 | ||
| 422 | ;; Buffer deletion | ||
| 423 | ;; Rerationalize after a buffer is killed, to reduce coinciding buffer names. | ||
| 424 | ;; This mechanism uses `kill-buffer-hook', which runs *before* deletion, so | ||
| 425 | ;; it calls `uniquify-rerationalize-w/o-cb' to rerationalize the buffer list | ||
| 426 | ;; ignoring the current buffer (which is going to be deleted anyway). | ||
| 427 | (defun uniquify-maybe-rerationalize-w/o-cb () | ||
| 428 | "Re-rationalize buffer names, ignoring current buffer. | ||
| 429 | For use on `kill-buffer-hook'." | ||
| 430 | (if (and (cdr uniquify-managed) | ||
| 431 | uniquify-buffer-name-style | ||
| 432 | uniquify-after-kill-buffer-p) | ||
| 433 | (uniquify-rerationalize-w/o-cb uniquify-managed))) | ||
| 434 | |||
| 435 | ;; Ideally we'd like to add it buffer-locally, but that doesn't work | ||
| 436 | ;; because kill-buffer-hook is not permanent-local :-( | ||
| 437 | (add-hook 'kill-buffer-hook 'uniquify-maybe-rerationalize-w/o-cb) | ||
| 438 | |||
| 422 | ;; The logical place to put all this code is in generate-new-buffer-name. | 439 | ;; The logical place to put all this code is in generate-new-buffer-name. |
| 423 | ;; It's written in C, so we would add a generate-new-buffer-name-function | 440 | ;; It's written in C, so we would add a generate-new-buffer-name-function |
| 424 | ;; which, if non-nil, would be called instead of the C. One problem with | 441 | ;; which, if non-nil, would be called instead of the C. One problem with |
| @@ -456,23 +473,6 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil." | |||
| 456 | (file-name-nondirectory filename) | 473 | (file-name-nondirectory filename) |
| 457 | (file-name-directory filename) ad-return-value)))) | 474 | (file-name-directory filename) ad-return-value)))) |
| 458 | 475 | ||
| 459 | ;; Buffer deletion | ||
| 460 | ;; Rerationalize after a buffer is killed, to reduce coinciding buffer names. | ||
| 461 | ;; This mechanism uses `kill-buffer-hook', which runs *before* deletion, so | ||
| 462 | ;; it calls `uniquify-rerationalize-w/o-cb' to rerationalize the buffer list | ||
| 463 | ;; ignoring the current buffer (which is going to be deleted anyway). | ||
| 464 | (defun uniquify-maybe-rerationalize-w/o-cb () | ||
| 465 | "Re-rationalize buffer names, ignoring current buffer. | ||
| 466 | For use on `kill-buffer-hook'." | ||
| 467 | (if (and (cdr uniquify-managed) | ||
| 468 | uniquify-buffer-name-style | ||
| 469 | uniquify-after-kill-buffer-p) | ||
| 470 | (uniquify-rerationalize-w/o-cb uniquify-managed))) | ||
| 471 | |||
| 472 | ;; Ideally we'd like to add it buffer-locally, but that doesn't work | ||
| 473 | ;; because kill-buffer-hook is not permanent-local :-( | ||
| 474 | (add-hook 'kill-buffer-hook 'uniquify-maybe-rerationalize-w/o-cb) | ||
| 475 | |||
| 476 | (provide 'uniquify) | 476 | (provide 'uniquify) |
| 477 | 477 | ||
| 478 | ;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065 | 478 | ;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065 |