comparison lisp/uniquify.el @ 80109:0867191fcef1

(uniquify-buffer-base-name): New function. Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 12 Feb 2008 14:32:56 +0000
parents 73661ddc7ac7
children 45099af37ea3
comparison
equal deleted inserted replaced
80108:d616730de510 80109:0867191fcef1
186 (defvar uniquify-managed nil 186 (defvar uniquify-managed nil
187 "Non-nil if the name of this buffer is managed by uniquify. 187 "Non-nil if the name of this buffer is managed by uniquify.
188 It actually holds the list of `uniquify-item's corresponding to the conflict.") 188 It actually holds the list of `uniquify-item's corresponding to the conflict.")
189 (make-variable-buffer-local 'uniquify-managed) 189 (make-variable-buffer-local 'uniquify-managed)
190 (put 'uniquify-managed 'permanent-local t) 190 (put 'uniquify-managed 'permanent-local t)
191
192 ;; Used in desktop.el to save the non-uniquified buffer name
193 (defun uniquify-buffer-base-name ()
194 "Return the base name of the current buffer.
195 Return nil if the buffer is not managed by uniquify."
196 (and uniquify-managed
197 (uniquify-item-base (car uniquify-managed))))
191 198
192 ;;; Main entry point. 199 ;;; Main entry point.
193 200
194 (defun uniquify-rationalize-file-buffer-names (base dirname newbuf) 201 (defun uniquify-rationalize-file-buffer-names (base dirname newbuf)
195 "Make file buffer names unique by adding segments from file name. 202 "Make file buffer names unique by adding segments from file name.
487 (ad-remove-advice fun 'after (intern (concat (symbol-name fun) "-uniquify"))) 494 (ad-remove-advice fun 'after (intern (concat (symbol-name fun) "-uniquify")))
488 (ad-update fun)) 495 (ad-update fun))
489 (dolist (buf buffers) 496 (dolist (buf buffers)
490 (set-buffer (car buf)) 497 (set-buffer (car buf))
491 (rename-buffer (cdr buf) t)))) 498 (rename-buffer (cdr buf) t))))
492 ;; continue standard uploading 499 ;; continue standard unloading
493 nil) 500 nil)
494 501
495 (provide 'uniquify) 502 (provide 'uniquify)
496 503
497 ;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065 504 ;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065