summaryrefslogtreecommitdiff
path: root/lisp/uniquify.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2007-10-29 13:25:08 +0000
committerJuanma Barranquero <lekktu@gmail.com>2007-10-29 13:25:08 +0000
commit2513e3fdc2a82c796aa09f335d5cec2d5ce37d06 (patch)
treec727fc07c134e46668e8ca204a7bbbbf5ce44eb6 /lisp/uniquify.el
parentaa6c18123436d3f0c2a890ae10a237b91b717fce (diff)
downloademacs-2513e3fdc2a82c796aa09f335d5cec2d5ce37d06.tar.gz
(uniquify-unload-function): New function and var.
Diffstat (limited to 'lisp/uniquify.el')
-rw-r--r--lisp/uniquify.el20
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'."
(file-name-nondirectory filename)
(file-name-directory filename) ad-return-value))))
+;;; The End
+
+(defun uniquify-unload-function ()
+ (save-current-buffer
+ (let ((buffers nil))
+ (dolist (buf (buffer-list))
+ (set-buffer buf)
+ (when uniquify-managed
+ (push (cons buf (uniquify-item-base (car uniquify-managed))) buffers)))
+ (dolist (fun '(rename-buffer create-file-buffer))
+ (ad-remove-advice fun 'after (intern (concat (symbol-name fun) "-uniquify")))
+ (ad-update fun))
+ (dolist (buf buffers)
+ (set-buffer (car buf))
+ (rename-buffer (cdr buf) t))))
+ ;; continue standard uploading
+ nil)
+
+(defvar uniquify-unload-function 'uniquify-unload-function)
+
(provide 'uniquify)
;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065