From: Juanma Barranquero Date: Mon, 29 Oct 2007 13:25:08 +0000 (+0000) Subject: (uniquify-unload-function): New function and var. X-Git-Tag: emacs-pretest-22.1.90~488 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2513e3fdc2a82c796aa09f335d5cec2d5ce37d06;p=emacs.git (uniquify-unload-function): New function and var. --- 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