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