From 1b6d76d60929a10e13fbfe1d9b4286bbd0aebb58 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Thu, 4 Nov 2021 20:14:00 -0700 Subject: [PATCH 1/3] Remove 'automount-dir-prefix' * lisp/file.el (automount-dir-prefix): Remove it. * etc/NEWS: Mention the removal. --- etc/NEWS | 5 +++++ lisp/files.el | 15 +-------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 211d943a14..ee96876ff9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -363,6 +363,11 @@ with recent versions of Firefox. ** The function 'image-dired-get-exif-data' is now obsolete. Use 'exif-parse-file' and 'exif-field' instead. +--- +** The obsolete variable 'automount-dir-prefix' has been removed. +In Emacs 24.3, the variable 'automount-dir-prefix' was made obsolete. +For similar functionality, use 'directory-abbrev-alist' instead. + * Lisp Changes in Emacs 29.1 diff --git a/lisp/files.el b/lisp/files.el index 173198a424..995f0cf97a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1990,12 +1990,6 @@ create-file-buffer (concat "|" lastname) lastname)))) -(defcustom automount-dir-prefix (purecopy "^/tmp_mnt/") - "Regexp to match the automounter prefix in a directory name." - :group 'files - :type 'regexp) -(make-obsolete-variable 'automount-dir-prefix 'directory-abbrev-alist "24.3") - (defvar abbreviated-home-dir nil "Regexp matching the user's homedir at the beginning of file name. The value includes abbreviation according to `directory-abbrev-alist'.") @@ -2003,21 +1997,14 @@ abbreviated-home-dir (defun abbreviate-file-name (filename) "Return a version of FILENAME shortened using `directory-abbrev-alist'. This also substitutes \"~\" for the user's home directory (unless the -home directory is a root directory) and removes automounter prefixes -\(see the variable `automount-dir-prefix'). +home directory is a root directory). When this function is first called, it caches the user's home directory as a regexp in `abbreviated-home-dir', and reuses it afterwards (so long as the home directory does not change; if you want to permanently change your home directory after having started Emacs, set `abbreviated-home-dir' to nil so it will be recalculated)." - ;; Get rid of the prefixes added by the automounter. (save-match-data ;FIXME: Why? - (if (and automount-dir-prefix - (string-match automount-dir-prefix filename) - (file-exists-p (file-name-directory - (substring filename (1- (match-end 0)))))) - (setq filename (substring filename (1- (match-end 0))))) ;; Avoid treating /home/foo as /home/Foo during `~' substitution. (let ((case-fold-search (file-name-case-insensitive-p filename))) ;; If any elt of directory-abbrev-alist matches this name, -- 2.25.1