From a0eec7f2e672804f3a7a30e55c821ba2dac213b7 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 18 Jul 2018 18:45:47 -0400 Subject: [PATCH v1] 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. --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index fb8c34bcae..4eb1560a20 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1929,7 +1929,7 @@ abbreviate-file-name (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) -- 2.11.0