emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/bash-completion 912e1e8153 170/313: Add an option to disab


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 912e1e8153 170/313: Add an option to disable default Readline completion when no matches are found (#29)
Date: Sat, 3 Dec 2022 10:59:27 -0500 (EST)

branch: elpa/bash-completion
commit 912e1e81538b7dbf717a2b806a1fd31c76aefd3b
Author: montag451 <montag451@laposte.net>
Commit: Stephane Zermatten <szermatt@gmx.net>

    Add an option to disable default Readline completion when no matches are 
found (#29)
    
    When this option is set to nil, Readline default's filename completion
    will no be attempted. This is useful for example for command like 'cd'
    which completes only directories.
---
 bash-completion.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bash-completion.el b/bash-completion.el
index 608341b17a..ceef075423 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -196,6 +196,12 @@ to remove the extra space bash adds after a completion."
   :type '(boolean)
   :group 'bash-completion)
 
+(defcustom bash-completion-default-completion t
+  "Use Readline’s default filename completion if a compspec
+  generates no matches."
+  :type 'boolean
+  :group 'bash-completion)
+
 (defvar bash-completion-start-files
   '("~/.emacs_bash.sh" "~/.emacs.d/init_bash.sh")
   "Shell files that, if they exist, will be sourced at the
@@ -724,7 +730,7 @@ The result is a list of candidates, which might be empty."
           (when (eq 0 completion-status)
             (bash-completion-extract-candidates
              (nth cword words) unparsed-stub open-quote (car cmdline))))
-    (if (and (not candidates) (eq 'custom (car cmdline)))
+    (if (and bash-completion-default-completion (not candidates) (eq 'custom 
(car cmdline)))
         (bash-completion--default-completion
          (nth cword words) unparsed-stub open-quote 'default)
       candidates)))



reply via email to

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