# HG changeset patch # User Juanma Barranquero # Date 1193664308 0 # Node ID ed916d33c5ffb44557c8e7322e0bb2c8848ff39e # Parent 74f4e35672910ba9b7c8350725380b2647413dfb (uniquify-unload-function): New function and var. diff -r 74f4e3567291 -r ed916d33c5ff lisp/uniquify.el --- 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