;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:53:09 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/uniquify.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`uniquify.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\302\301\303\304\305\306%\207" [provide uniquify custom-declare-group nil "Unique buffer names dependent on file name" :group applications] 6)
#@584 *If non-nil, buffer names are uniquified with parts of directory name.
The value determines the buffer name style and is one of `forward',
`reverse', `post-forward', or `post-forward-angle-brackets'.
For example, files `/foo/bar/mumble/name' and `/baz/quux/mumble/name'
would have the following buffer names in the various styles:
  forward        bar/mumble/name  quux/mumble/name
  reverse        name\mumble\bar  name\mumble\quux
  post-forward   name|bar/mumble  name|quux/mumble
  post-forward-angle-brackets   name<bar/mumble>  name<quux/mumble>
  nil            name  name<2>
(custom-declare-variable 'uniquify-buffer-name-style 'nil '(#$ . -787) :type '(radio (const forward) (const reverse) (const post-forward) (const post-forward-angle-brackets) (const :tag "standard Emacs behavior (nil)" nil)) :require 'uniquify :group 'uniquify)
#@215 *If non-nil, rerationalize buffer names after a buffer has been killed.
This can be dangerous if Emacs Lisp code is keeping track of buffers by their
names (rather than keeping pointers to the buffers themselves).
(custom-declare-variable 'uniquify-after-kill-buffer-p 'nil '(#$ . -1638) :type 'boolean :group 'uniquify)
#@180 *If non-nil, permit user to choose names for buffers with same base file.
If the user chooses to name a buffer, uniquification is preempted and no
other buffer names are changed.
(custom-declare-variable 'uniquify-ask-about-buffer-names-p 'nil '(#$ . -1966) :type 'boolean :group 'uniquify)
#@277 *Regular expression matching buffer names that should not be uniquified.
For instance, set this to "^draft-[0-9]+$" to avoid having uniquify rename
draft buffers even if `uniquify-after-kill-buffer-p' is non-nil and the
visited file name isn't the same as that of the buffer.
(custom-declare-variable 'uniquify-ignore-buffers-re 'nil '(#$ . -2264) :type '(choice (const :tag "Uniquify all buffers" nil) regexp) :group 'uniquify)
#@71 *Minimum number of directory name components included in buffer name.
(custom-declare-variable 'uniquify-min-dir-content '0 '(#$ . -2699) :type 'integer :group 'uniquify)
#@274 *String separator for buffer name components.
When `uniquify-buffer-name-style' is `post-forward', separates
base file name from directory part in buffer names (default "|").
When `uniquify-buffer-name-style' is `reverse', separates all
file name components (default "\").
(custom-declare-variable 'uniquify-separator 'nil '(#$ . -2877) :type '(choice (const nil) string) :group 'uniquify)
#@232 *If non-nil, add a file name separator to dired buffer names.
If `uniquify-buffer-name-style' is `forward', add the separator at the end;
if it is `reverse', add the separator at the beginning; otherwise, this
variable is ignored.
(custom-declare-variable 'uniquify-trailing-separator-p 'nil '(#$ . -3274) :type 'boolean :group 'uniquify)
#@217 List of modes for which uniquify should obey `list-buffers-directory'.
That means that when `buffer-file-name' is set to nil, `list-buffers-directory'
contains the name of the directory which the buffer is visiting.
(defvar uniquify-list-buffers-directory-modes '(dired-mode cvs-mode) (#$ . 3620))
(defalias 'uniquify-file-name-nondirectory #[(file-name) "\301\302!!\207" [file-name file-name-nondirectory directory-file-name] 3])
(defalias 'uniquify-ref-base #[(x) "\301H\207" [x 0] 2])
(put 'uniquify-ref-base 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'uniquify-ref-filename #[(x) "\301H\207" [x 1] 2])
(put 'uniquify-ref-filename 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'uniquify-ref-buffer #[(x) "\301H\207" [x 2] 2])
(put 'uniquify-ref-buffer 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'uniquify-ref-proposed #[(x) "\301H\207" [x 3] 2])
(put 'uniquify-ref-proposed 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'uniquify-set-proposed #[(x p) "\302	I\207" [x p 3] 3])
(byte-code "\303\304\305\306#\210\301B\307\301!\204 \310\302B\307\302!\204 \310\310\207" [current-load-list uniquify-non-file-buffer-names uniquify-possibly-resolvable put uniquify-set-proposed byte-optimizer byte-compile-inline-expand boundp nil] 4)
#@201 Make file buffer names unique by adding segments from file name.
If `uniquify-min-dir-content' > 0, always pulls that many
file name elements.  Arguments cause only a subset of buffers to be renamed.
(defalias 'uniquify-rationalize-file-buffer-names #[(&optional newbuffile newbuf) "\306\211\205	 \307!\310 \306\211\203\231 @\311\f!\306\211\211\2034 \312\"\204\214 \f=\203Q \205T \313\314!\203L \315!\202M !\202T \316\f!\211\203\214 \307!\211\203\214 \203o 	\232\203\214 \317#\211\203\214 \320\f$B\202\221 \nB,A\211\204 *\321\"+\207" [newbuffile newbuffile-nd uniquify-non-file-buffer-names fix-list buffer #1=#:--dolist-temp--97269 nil uniquify-file-name-nondirectory buffer-list buffer-name string-match expand-file-name file-directory-p directory-file-name uniquify-buffer-file-name uniquify-get-proposed-name vector uniquify-rationalize-a-list proposed rawname bfn bufname uniquify-ignore-buffers-re newbuf uniquify-min-dir-content] 6 (#$ . 4913) nil])
#@200 Return name of file BUFFER is visiting, or nil if none.
Works on ordinary file-visiting buffers and buffers whose mode is mentioned
in `uniquify-list-buffers-directory-modes', otherwise returns nil.
(defalias 'uniquify-buffer-file-name #[(buffer) "\305!\2064 rq\210	\n>\2053 \306\303!\203  \2053 \307!\2023 \f\2053 \310\307\f:\2030 \f@\2021 \f!!)\207" [buffer major-mode uniquify-list-buffers-directory-modes list-buffers-directory dired-directory buffer-file-name boundp directory-file-name expand-file-name] 3 (#$ . 5940)])
(defalias 'uniquify-item-greaterp #[(item1 item2) "\211\303H)\n\211\303H)\231\207" [item2 x item1 3] 4])
(defalias 'uniquify-rationalize-a-list #[(fix-list depth) "\306\307\306\310\311\"\306\211\2038 @\211\211\f\312H)\211	\232\204+ \313\n	#\210\306\f\nBA\211\204 *\313\n	#+\207" [proposed old-proposed conflicting-sublist fix-list item #1=#:--dolist-temp--97270 nil "" sort uniquify-item-greaterp 3 uniquify-rationalize-conflicting-sublist x depth] 5])
(defalias 'uniquify-get-proposed-name #[(base filename depth) "\306\307	\n\310V\203< \311\312\313\f!\313!\314R\"\211\203< \315!\203+ \310\202- TGGZO\nS\211\202	 \315\n!\203E \316\203y \317!\203y \307\230\204y \320=\203g \321P\202y \322=\203y  \206t \323P\f\307\230\204\224 \324=\204\215 \325=\203\224 \f\310\fGSO\f\307\230\203\237 \202\361 \307\230\203\252 \f\202\361 \320=\203\270 \fP\202\361 \322=\203\310 \326\f!P\202\361 \324=\203\334  \206\327 \327\fQ\202\361 \325=\203\354 \330\f\331R\202\361 \332\333\",\207" [filename depth n fn extra-string index nil "" 0 string-match "\\(^\\|/[^/]*\\)/" regexp-quote "\\'" zerop t file-directory-p forward "/" reverse "\\" post-forward post-forward-angle-brackets uniquify-reverse-components "|" "<" ">" error "Bad value for uniquify-buffer-name-style: %s" base uniquify-possibly-resolvable uniquify-trailing-separator-p uniquify-buffer-name-style uniquify-separator] 6])
(defalias 'uniquify-rationalize-conflicting-sublist #[(conf-list old-name depth) "\205] A\204 	\n\235\203Q \205] \306\fT\306\211\203K @\211\307\211\310H)\211\311H)\f#\211\312I\210*A\211\204! *\313\f\"\207	\314\230?\205] \315@	\"\207" [conf-list old-name uniquify-non-file-buffer-names uniquify-possibly-resolvable depth item nil uniquify-get-proposed-name 0 1 3 uniquify-rationalize-a-list "" uniquify-rename-buffer #1=#:--dolist-temp--97271 x p] 6])
(defalias 'uniquify-rename-buffer #[(item newname) "\211\306H)\307\n!\232?\205 p\310\nq\210\311!\210q*)\207" [item x buffer newname uniquify-buffer-name-style unset 2 buffer-name nil rename-buffer] 4])
(defalias 'uniquify-reverse-components #[(instring) "\306\307G	\206	 \310\fW\203@ \fH\311U\203& \nB\fT\211\202 \312\313\f#\206/ \fOB)\202 \314\315\",\207" [instring uniquify-separator sep len cursor sofar nil 0 "\\" 47 string-match "/" apply concat first-slash] 5])
(byte-code "\300\301\302\303\304$\210\305\301\304\"\210\300\306\307\303\304$\210\305\306\304\"\207" [ad-add-advice rename-buffer (rename-buffer-uniquify nil t (advice lambda nil "Uniquify buffer names with parts of directory name." (if (and uniquify-buffer-name-style (ad-get-arg 1)) (progn (if uniquify-after-kill-buffer-p (uniquify-rationalize-file-buffer-names) (uniquify-rationalize-file-buffer-names (uniquify-buffer-file-name (current-buffer)) (current-buffer))) (setq ad-return-value (buffer-name (current-buffer))))))) after nil ad-activate create-file-buffer (create-file-buffer-uniquify nil t (advice lambda nil "Uniquify buffer names with parts of directory name." (if uniquify-buffer-name-style (uniquify-rationalize-file-buffer-names (ad-get-arg 0) ad-return-value))))] 5)
#@154 Add `delayed-uniquify-rationalize-file-buffer-names' to `post-command-hook'.
For use on, eg, `kill-buffer-hook', to rationalize *after* buffer deletion.
(defalias 'delay-uniquify-rationalize-file-buffer-names #[nil "\205\f 	\205\f \302\303\304\"\207" [uniquify-buffer-name-style uniquify-after-kill-buffer-p add-hook post-command-hook delayed-uniquify-rationalize-file-buffer-names] 3 (#$ . 9705)])
#@134 Rerationalize buffer names and remove self from `post-command-hook'.
See also `delay-rationalize-file-buffer-names' for hook setter.
(defalias 'delayed-uniquify-rationalize-file-buffer-names #[nil "\300 \210\301\302\303\"\207" [uniquify-rationalize-file-buffer-names remove-hook post-command-hook delayed-uniquify-rationalize-file-buffer-names] 3 (#$ . 10112)])
(add-hook 'kill-buffer-hook 'delay-uniquify-rationalize-file-buffer-names)
