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

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

[nongnu] elpa/bash-completion f01d8726de 179/313: Remove support filenam


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion f01d8726de 179/313: Remove support filenames options.
Date: Sat, 3 Dec 2022 10:59:28 -0500 (EST)

branch: elpa/bash-completion
commit f01d8726de43052f8a2c888194caf108172ad31b
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>

    Remove support filenames options.
    
    Go back to always applying filename post-processing. This seems to be
    what bash does.
    
    Issue #19
---
 bash-completion.el           | 19 ++++---------------
 test/bash-completion-test.el | 12 ++----------
 2 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/bash-completion.el b/bash-completion.el
index 6c6135d71a..d1e2c122ce 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -851,8 +851,6 @@ character (' or \") or nil.
 
 OPTIONS configrues some behaviors:
  'nospace to not add a space after a single completion
- 'filenames to post-process candidates as filenames and detect
-  directories
 
 If SINGLE is non-nil, this is the single completion candidate.
 
@@ -911,11 +909,9 @@ for directory name detection to work."
        ((or (memq last-char bash-completion-wordbreaks)
             (eq ?/ last-char))
         (setq suffix ""))
-       ((and
-         (memq 'filenames options)
-         (file-accessible-directory-p
-          (bash-completion--expand-file-name (bash-completion-unescape
-                                              open-quote (concat parsed-prefix 
rest)))))
+       ((file-accessible-directory-p
+         (bash-completion--expand-file-name (bash-completion-unescape
+                                             open-quote (concat parsed-prefix 
rest))))
         (setq suffix "/"))
        (single
         (setq suffix (concat close-quote-str final-space-str)))
@@ -1349,19 +1345,12 @@ Return the status code of the command, as a number."
   "Parse OPTIONS-STRINGS for compgen into a list of symbols.
 
 Supported options and compgen option equivalent:
- 'default: -o default
- 'nospace: -o nospace
- 'filenames: -o filenames"
+ 'nospace: -o nospace"
   (let ((options))
-    (if (member "default" option-strings)
-        (push 'default options))
     (if (bash-completion--check-option
          option-strings
          "nospace" bash-completion-nospace)
         (push 'nospace options))
-    (if (or (member "filenames" option-strings)
-            (memq 'default options))
-        (push 'filenames options))
     options))
 
 (defun bash-completion--check-option
diff --git a/test/bash-completion-test.el b/test/bash-completion-test.el
index 72295a0192..1ddde4d471 100644
--- a/test/bash-completion-test.el
+++ b/test/bash-completion-test.el
@@ -572,13 +572,10 @@ Return (const return-value new-buffer-content)"
   (should (equal "hello\\ world"
                 (bash-completion-fix " world" "hello" "hello" nil nil nil)))
 
-  ;; append / for home, with option filenames
+  ;; append / for home
   (should (equal "~/"
                  (bash-completion-fix (expand-file-name "~")
                                       "~" "~" nil '(filenames) nil)))
-  (should (equal "~"
-                 (bash-completion-fix (expand-file-name "~")
-                                      "~" "~" nil nil nil)))
 
   (cl-letf (((symbol-function 'file-accessible-directory-p)
              (lambda (d) (equal d "/tmp/somedir"))))
@@ -1005,14 +1002,9 @@ before calling 
`bash-completion-dynamic-complete-nocomint'.
 (ert-deftest bash-completion--parse-options ()
   (let ((bash-completion-nospace 'as-configured))
     (should (equal nil (bash-completion--parse-options nil)))
-    (should (equal '(filenames nospace default)
+    (should (equal '(nospace)
                    (bash-completion--parse-options
                     '("filenames" "nospace" "default"))))
-    (should (equal '(filenames)
-                   (bash-completion--parse-options
-                    '("filenames"))))
-    (should (equal '(filenames default)
-                   (bash-completion--parse-options '("default"))))
     (setq bash-completion-nospace nil)
     (should (equal '() (bash-completion--parse-options
                         '("nospace"))))



reply via email to

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