diff options
| author | Juanma Barranquero | 2007-10-29 13:25:08 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2007-10-29 13:25:08 +0000 |
| commit | 2513e3fdc2a82c796aa09f335d5cec2d5ce37d06 (patch) | |
| tree | c727fc07c134e46668e8ca204a7bbbbf5ce44eb6 | |
| parent | aa6c18123436d3f0c2a890ae10a237b91b717fce (diff) | |
| download | emacs-2513e3fdc2a82c796aa09f335d5cec2d5ce37d06.tar.gz emacs-2513e3fdc2a82c796aa09f335d5cec2d5ce37d06.zip | |
(uniquify-unload-function): New function and var.
| -rw-r--r-- | lisp/uniquify.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/uniquify.el b/lisp/uniquify.el index 0c21fc0eb3b..47388247c22 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el | |||
| @@ -473,6 +473,26 @@ For use on `kill-buffer-hook'." | |||
| 473 | (file-name-nondirectory filename) | 473 | (file-name-nondirectory filename) |
| 474 | (file-name-directory filename) ad-return-value)))) | 474 | (file-name-directory filename) ad-return-value)))) |
| 475 | 475 | ||
| 476 | ;;; The End | ||
| 477 | |||
| 478 | (defun uniquify-unload-function () | ||
| 479 | (save-current-buffer | ||
| 480 | (let ((buffers nil)) | ||
| 481 | (dolist (buf (buffer-list)) | ||
| 482 | (set-buffer buf) | ||
| 483 | (when uniquify-managed | ||
| 484 | (push (cons buf (uniquify-item-base (car uniquify-managed))) buffers))) | ||
| 485 | (dolist (fun '(rename-buffer create-file-buffer)) | ||
| 486 | (ad-remove-advice fun 'after (intern (concat (symbol-name fun) "-uniquify"))) | ||
| 487 | (ad-update fun)) | ||
| 488 | (dolist (buf buffers) | ||
| 489 | (set-buffer (car buf)) | ||
| 490 | (rename-buffer (cdr buf) t)))) | ||
| 491 | ;; continue standard uploading | ||
| 492 | nil) | ||
| 493 | |||
| 494 | (defvar uniquify-unload-function 'uniquify-unload-function) | ||
| 495 | |||
| 476 | (provide 'uniquify) | 496 | (provide 'uniquify) |
| 477 | 497 | ||
| 478 | ;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065 | 498 | ;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065 |