summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-13 01:57:02 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-13 01:57:02 +0000
commit3a8a836d28ba26ce78d1d672d8657f9c080ef36b (patch)
treeab3429795616ee22e874d9f0330269b107582195 /lisp/files.el
parentd90f825cd859f9593dd19a0933e0f7a8bb317d3c (diff)
downloademacs-3a8a836d28ba26ce78d1d672d8657f9c080ef36b.tar.gz
(abbreviate-file-name): Match home dir with no / if nothing else follows.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 688b71b5bd4..dc07a02473a 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -520,7 +520,9 @@ Type \\[describe-variable] directory-abbrev-alist RET for more information."
(or abbreviated-home-dir
(setq abbreviated-home-dir
(let ((abbreviated-home-dir "$foo"))
- (concat "^" (abbreviate-file-name (expand-file-name "~/"))))))
+ (concat "^" (abbreviate-file-name (expand-file-name "~"))
+ "\\(/\\|$\\)"))))
+
;; If FILENAME starts with the abbreviated homedir,
;; make it start with `~' instead.
(if (string-match abbreviated-home-dir filename)
@@ -536,6 +538,7 @@ Type \\[describe-variable] directory-abbrev-alist RET for more information."
(1- (length abbreviated-home-dir))))
"/"
"")
+ (substring filename (match-beginning 1) (match-end 1))
(substring filename (match-end 0)))))
filename))