1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-04 11:40:22 +00:00

Add save-match-data to abbreviate-file-name (Bug#32201)

* lisp/files.el (abbreviate-file-name): Save match-data around
expand-file-name; it is not guaranteed to preserve match-data, and may
well do so depending on what file handlers and hooks are in effect.
This commit is contained in:
Noam Postavsky 2018-07-18 18:45:47 -04:00
parent 47f75b1ba0
commit 59e8533286

View File

@ -1929,7 +1929,7 @@ started Emacs, set `abbreviated-home-dir' to nil so it will be recalculated)."
(save-match-data
(string-match "^[a-zA-`]:/$" filename))))
(equal (get 'abbreviated-home-dir 'home)
(expand-file-name "~")))
(save-match-data (expand-file-name "~"))))
(setq filename
(concat "~"
(match-string 1 filename)