emacs-diffs
[Top][All Lists]
Advanced

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

scratch/icomplete-lazy-highlight-attempt-2 4fa1935 2/4: Fix bug#50063 wh


From: João Távora
Subject: scratch/icomplete-lazy-highlight-attempt-2 4fa1935 2/4: Fix bug#50063 when using icomplete-fido-kill with C-x p p
Date: Mon, 16 Aug 2021 05:57:01 -0400 (EDT)

branch: scratch/icomplete-lazy-highlight-attempt-2
commit 4fa193527d52f6f57e8e9827ffbd72d5734a1b94
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Fix bug#50063 when using icomplete-fido-kill with C-x p p
    
    C-x p p utilizes a completion table "category" which is 'project-file'
    icomplete-fido-kill only functioned for 'buffer' and 'file', and
    failed with a non-informative message when something else was used.
    
    * lisp/icomplete.el (icomplete-fido-kill): Support 'project-file'
    class.  Use cl-case, instead of pcase.
---
 lisp/icomplete.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 21cf753..d69cb75 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -298,18 +298,21 @@ require user confirmation."
         (call-interactively 'kill-line)
       (let* ((all (completion-all-sorted-completions))
              (thing (car all))
+             (cat (icomplete--category))
              (action
-              (pcase (icomplete--category)
-                (`buffer
+              (cl-case cat
+                (buffer
                  (lambda ()
                    (when (yes-or-no-p (concat "Kill buffer " thing "? "))
                      (kill-buffer thing))))
-                (`file
+                ((project-file file)
                  (lambda ()
                    (let* ((dir (file-name-directory (icomplete--field-string)))
                           (path (expand-file-name thing dir)))
                      (when (yes-or-no-p (concat "Delete file " path "? "))
-                       (delete-file path) t)))))))
+                       (delete-file path) t))))
+                (t
+                 (error "Sorry, don't know how to kill things for `%s'" 
cat)))))
         (when (let (;; Allow `yes-or-no-p' to work and don't let it
                     ;; `icomplete-exhibit' anything.
                     (enable-recursive-minibuffers t)



reply via email to

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