Commit | Line | Data |
---|---|---|
5246db4e | 1 | ;;; uniquify.el --- unique buffer names dependent on file name |
4c61f92c | 2 | |
0d30b337 | 3 | ;; Copyright (C) 1989, 1995, 1996, 1997, 2001, 2002, 2003, |
d7a0267c | 4 | ;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc. |
4c61f92c KH |
5 | |
6 | ;; Author: Dick King <king@reasoning.com> | |
2ad02767 | 7 | ;; Maintainer: FSF |
284b3043 | 8 | ;; Keywords: files |
4c61f92c KH |
9 | ;; Created: 15 May 86 |
10 | ||
11 | ;; This file is part of GNU Emacs. | |
12 | ||
13 | ;; GNU Emacs is free software; you can redistribute it and/or modify | |
14 | ;; it under the terms of the GNU General Public License as published by | |
15 | ;; the Free Software Foundation; either version 2, or (at your option) | |
16 | ;; any later version. | |
17 | ||
18 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | ;; GNU General Public License for more details. | |
22 | ||
23 | ;; You should have received a copy of the GNU General Public License | |
b578f267 | 24 | ;; along with GNU Emacs; see the file COPYING. If not, write to the |
086add15 LK |
25 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 | ;; Boston, MA 02110-1301, USA. | |
4c61f92c KH |
27 | |
28 | ;;; Commentary: | |
29 | ||
30 | ;; Emacs's standard method for making buffer names unique adds <2>, <3>, | |
31 | ;; etc. to the end of (all but one of) the buffers. This file replaces | |
32 | ;; that behavior, for buffers visiting files and dired buffers, with a | |
5246db4e | 33 | ;; uniquification that adds parts of the file name until the buffer names |
4c61f92c KH |
34 | ;; are unique. For instance, buffers visiting /u/mernst/tmp/Makefile and |
35 | ;; /usr/projects/zaphod/Makefile would be named Makefile|tmp and | |
36 | ;; Makefile|zaphod, respectively (instead of Makefile and Makefile<2>). | |
37 | ;; Other buffer name styles are also available. | |
38 | ||
4219b27b RS |
39 | ;; To use this file, do (require 'uniquify) |
40 | ;; and set uniquify-buffer-name-style to one of its non-nil alternative values. | |
41 | ||
4c61f92c KH |
42 | ;; For other options, see "User-visible variables", below. |
43 | ||
d7993a1c RS |
44 | ;; A version of uniquify.el that works under Emacs 18, Emacs 19, XEmacs, |
45 | ;; and InfoDock is available from the maintainer. | |
4c61f92c KH |
46 | |
47 | ;;; Change Log: | |
48 | ||
49 | ;; Originally by Dick King <king@reasoning.com> 15 May 86 | |
feeb94f7 | 50 | ;; Converted for Emacs 18 by Stephen Gildea <gildea@stop.mail-abuse.org> |
4c61f92c KH |
51 | ;; Make uniquify-min-dir-content 0 truly non-invasive. gildea 23 May 89 |
52 | ;; Some cleanup. uniquify-min-dir-content default 0. gildea 01 Jun 89 | |
53 | ;; Don't rename to "". Michael Ernst <mernst@theory.lcs.mit.edu> 15 Jun 94 | |
54 | ;; Add kill-buffer-hook. Kenneth Manheimer <ken.manheimer@nist.gov> 09 May 95 | |
55 | ;; Add advice for rename-buffer and create-file-buffer, handle dired buffers, | |
56 | ;; kill-buffer-rationalize-buffer-names-p, documentation. mernst 24 May 95 | |
57 | ;; Remove free variables, fix typos. mernst 5 Jun 95 | |
58 | ;; Efficiently support Emacs 19.27 & earlier. ken.manheimer, mernst 10 Jun 95 | |
59 | ;; Rename user options to "uniquify-...", add uniquify-reverse-dir-content-p, | |
60 | ;; add uniquify-ask-about-buffer-names-p. king, mernst 13 Jun 95 | |
61 | ;; Prefix functions by "uniquify-..."; rename mnemonic-buffer-names to | |
62 | ;; uniquify-buffer-name-style; add 'forward and 'post-forward-angle-brackets | |
63 | ;; styles; remove uniquify-reverse-dir-content-p; add | |
64 | ;; uniquify-trailing-separator-p. mernst 4 Aug 95 | |
bc2e0aae KH |
65 | ;; Don't call expand-file-name on nil. mernst 7 Jan 96 |
66 | ;; Check whether list-buffers-directory is bound. mernst 11 Oct 96 | |
67 | ;; Ignore non-file non-dired buffers. Colin Rafferty <craffert@ml.com> 3 Mar 97 | |
4ddd2beb RS |
68 | ;; Use last component, not "", for file name of directories. mernst 27 Jun 97 |
69 | ;; Use directory-file-name; code cleanup. mernst 6 Sep 97 | |
9a9c6f9f RS |
70 | ;; Add uniquify-ignore-buffers-re. |
71 | ;; Andre Srinivasan <andre@visigenic.com> 9 Sep 97 | |
f4eda05f SM |
72 | ;; Add uniquify-list-buffers-directory-modes |
73 | ;; Stefan Monnier <monnier@cs.yale.edu> 17 Nov 2000 | |
4126f5b7 | 74 | ;; Algorithm and data structure changed to reduce consing with lots of buffers |
b2f1b848 | 75 |