emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] feature/tramp-thread-safe d7314b3 3/7: find-file-asynchron


From: Michael Albinus
Subject: [Emacs-diffs] feature/tramp-thread-safe d7314b3 3/7: find-file-asynchronously can also be a regexp
Date: Sat, 4 Aug 2018 06:50:10 -0400 (EDT)

branch: feature/tramp-thread-safe
commit d7314b35ff6a60d1c92ed137921d7e20a6a55c89
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    find-file-asynchronously can also be a regexp
    
    * lisp/files.el (find-file-read-args): Check, whether
    find-file-asynchronously matches filename, if the former is a regexp.
    (find-file-asynchronously): Allow also regexp.
---
 lisp/files.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 1021551..88c4752 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1582,6 +1582,8 @@ If WILDCARDS is non-nil, return the spec (<filename> t 
<async>)."
   (let ((filename (read-file-name prompt nil default-directory mustmatch))
         (async (and (xor find-file-asynchronously current-prefix-arg)
                     (featurep 'threads))))
+    (when (and async (stringp find-file-asynchronously))
+      (setq async (string-match-p find-file-asynchronously filename)))
     (if wildcards `(,filename t ,async) `(,filename ,async))))
 
 (defmacro find-file-with-threads (filename async &rest body)
@@ -2069,10 +2071,12 @@ suppresses this warning."
 
 (defcustom find-file-asynchronously nil
   "Non-nil means visit file asynchronously when called interactively.
-This behavior is toggled by a prefix argument to the interactive call."
+If it is a regular expression, it must match the file name to be
+visited.  This behavior is toggled by a prefix argument to the
+interactive call."
   :group 'files
   :version "27.1"
-  :type 'boolean)
+  :type '(choice boolean regexp))
 
 (defcustom large-file-warning-threshold 10000000
   "Maximum size of file above which a confirmation is requested.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]