comparison lisp/files.el @ 3624:386094c1a569

(abbreviate-file-name): Make abbreviated-home-dir from `~/', not from just `~'.
author Richard M. Stallman <rms@gnu.org>
date Thu, 10 Jun 1993 20:44:12 +0000
parents 507f64624555
children ae0389767674
comparison
equal deleted inserted replaced
3623:739ba36097c9 3624:386094c1a569
507 (concat (cdr (car tail)) (substring filename (match-end 0))))) 507 (concat (cdr (car tail)) (substring filename (match-end 0)))))
508 (setq tail (cdr tail))) 508 (setq tail (cdr tail)))
509 ;; Compute and save the abbreviated homedir name. 509 ;; Compute and save the abbreviated homedir name.
510 ;; We defer computing this until the first time it's needed, to 510 ;; We defer computing this until the first time it's needed, to
511 ;; give time for directory-abbrev-alist to be set properly. 511 ;; give time for directory-abbrev-alist to be set properly.
512 ;; We include a slash at the end, to avoid spurious matches
513 ;; such as `/usr/foobar' when the home dir is `/usr/foo'.
512 (or abbreviated-home-dir 514 (or abbreviated-home-dir
513 (setq abbreviated-home-dir 515 (setq abbreviated-home-dir
514 (let ((abbreviated-home-dir "$foo")) 516 (let ((abbreviated-home-dir "$foo"))
515 (concat "^" (abbreviate-file-name (expand-file-name "~")))))) 517 (concat "^" (abbreviate-file-name (expand-file-name "~/"))))))
516 ;; If FILENAME starts with the abbreviated homedir, 518 ;; If FILENAME starts with the abbreviated homedir,
517 ;; make it start with `~' instead. 519 ;; make it start with `~' instead.
518 (if (string-match abbreviated-home-dir filename) 520 (if (string-match abbreviated-home-dir filename)
519 (setq filename 521 (setq filename
520 (concat "~" 522 (concat "~"