diff options
author | Reuben Thomas <rrt@sc3d.org> | 2011-03-05 15:35:08 -0500 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-03-05 15:35:08 -0500 |
commit | 2de9cc1acd9e3198983c89593297c0e486f96365 (patch) | |
tree | 8621078fc1c535fb02ad99cf0117d76240cf12f5 /lisp/files.el | |
parent | 22c28cb8278e7d4209db8e3d665fe73506a79b09 (diff) | |
download | emacs-2de9cc1acd9e3198983c89593297c0e486f96365.tar.gz |
Handle git-style backup names in file-name-version-regexp (Bug#8159).
* files.el (file-name-version-regexp): Handle backup files of the
form `foo.js.~HEAD~1~' (Bug#8159).
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index a236b337b35..39021ac1b2d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3869,7 +3869,9 @@ BACKUPNAME is the backup file name, which is the old file renamed." (set-file-selinux-context to-name context))) (defvar file-name-version-regexp - "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+~\\)" + "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(?:~[[:digit:]]+\\)?~\\)" + ;; The last ~[[:digit]]+ matches relative versions in git, + ;; e.g. `foo.js.~HEAD~1~'. "Regular expression matching the backup/version part of a file name. Used by `file-name-sans-versions'.") |