changeset 79249:ed916d33c5ff

(uniquify-unload-function): New function and var.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 29 Oct 2007 13:25:08 +0000
parents 74f4e3567291
children 6a6555296ab1
files lisp/uniquify.el
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/uniquify.el	Mon Oct 29 12:07:24 2007 +0000
+++ b/lisp/uniquify.el	Mon Oct 29 13:25:08 2007 +0000
@@ -473,6 +473,26 @@
 	 (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