diff options
| author | Mattias EngdegÄrd <mattiase@acm.org> | 2020-04-16 12:05:02 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd <mattiase@acm.org> | 2020-04-16 12:14:38 +0200 |
| commit | d5a7df8c02f04102d50a5cd2290262f59f2b1415 (patch) | |
| tree | 6d0842717c72525cc866b9e6ad927a33288b26bd /lisp/dired.el | |
| parent | 7839390f271211882414f167e8e680b3154ee929 (diff) | |
| download | emacs-d5a7df8c02f04102d50a5cd2290262f59f2b1415.tar.gz | |
Use directory-files-no-dot-files-regexp wherever possible
Suggested by Paul Eggert.
* lisp/files.el (directory-files-no-dot-files-regexp):
Clarify semantics and purpose.
* lisp/dired.el (dired-re-no-dot):
Define as obsolete alias of directory-files-no-dot-files-regexp.
(dired-delete-file):
* lisp/gnus/gnus-util.el (gnus-delete-directory):
* lisp/net/ange-ftp.el (ange-ftp-delete-directory):
* lisp/obsolete/vc-arch.el (vc-arch-trim-revlib):
* lisp/org/ob-core.el (org-babel-remove-temporary-directory):
* lisp/vc/vc-rcs.el (vc-rcs-unregister):
Use directory-files-no-dot-files-regexp.
Diffstat (limited to 'lisp/dired.el')
| -rw-r--r-- | lisp/dired.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 9583d5d809e..14bbb28db52 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3235,8 +3235,8 @@ Any other value means to ask for each directory." (const :tag "Confirm for each top directory only" top)) :group 'dired) -;; Match anything but `.' and `..'. -(defvar dired-re-no-dot (rx (or (not ".") "..."))) +(define-obsolete-variable-alias 'dired-re-no-dot + 'directory-files-no-dot-files-regexp "28.1") ;; Delete file, possibly delete a directory and all its files. ;; This function is useful outside of dired. One could change its name @@ -3258,7 +3258,9 @@ TRASH non-nil means to trash the file instead of deleting, provided ;; but more efficient (if (not (eq t (car (file-attributes file)))) (delete-file file trash) - (let* ((empty-dir-p (null (directory-files file t dired-re-no-dot)))) + (let* ((empty-dir-p (null (directory-files + file t + directory-files-no-dot-files-regexp)))) (if (and recursive (not empty-dir-p)) (unless (eq recursive 'always) (let ((prompt |
