Backport commit 4acdd7fe5 from Emacs

* lisp/ob-core.el (org-babel-remove-temporary-directory):
Use (rx (or (not ".") "...")), translated into "[^.]\\|\\.\\.\\.", to
match anything but "." and "..".

Fix edge case errors in filename-matching regexps
4acdd7fe58ae9f94102afeca67b0383141d597da
Mattias Engdegård
Tue Apr 14 12:25:16 2020 +0200

Note(km): Replaced bare "." with (any ".") for Emacs < 27
compatibility.  4acdd7fe5 was on the emacs-27 branch, but a commit on
their master (d5a7df8c0) will supersede this.
This commit is contained in:
Mattias Engdegård 2020-04-14 12:17:40 +02:00 committed by Kyle Meyer
parent 104f07a02f
commit bf99b6dc11

View file

@ -3059,7 +3059,9 @@ of `org-babel-temporary-directory'."
(delete-file file)))
;; We do not want to delete "." and "..".
(directory-files org-babel-temporary-directory 'full
"^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
;; Note: Use `any' for compatibility
;; with Emacs < 27.
(rx (or (not (any ".")) "..."))))
(delete-directory org-babel-temporary-directory))
(error
(message "Failed to remove temporary Org-babel directory %s"