emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#34070: closed (27.0.50; icomplete-mode candidate c


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#34070: closed (27.0.50; icomplete-mode candidate cycling broken for C-x C-f)
Date: Thu, 17 Jan 2019 15:23:02 +0000

Your message dated Thu, 17 Jan 2019 15:22:20 +0000
with message-id <address@hidden>
and subject line Re: bug#34070: 27.0.50; icomplete-mode candidate cycling 
broken for C-x C-f
has caused the debbugs.gnu.org bug report #34070,
regarding 27.0.50; icomplete-mode candidate cycling broken for C-x C-f
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
34070: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34070
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 27.0.50; icomplete-mode candidate cycling broken for C-x C-f Date: Mon, 14 Jan 2019 13:47:48 +0000
Hi maintainers,

   Emacs -Q
   M-x icomplete-mode
   C-x C-f
   C-.

Expected candidate list to rotate once to the left, immediately.
Instead if only rotates if I press C-. two additional times.  This is
because "."  and ".." are still taking part in the rotation under the
hood (but the user doesn't see them, by default, because of
completion-ignored-extensions).

Seems to have been introduced by

   commit 65797b1d75e9f608ffd50fd88be47a854b143bb1
   Author: Drew Adams <address@hidden>
   Date:   Thu Apr 28 19:31:43 2016 +0200
    
       Make icomplete respect `completion-ignored-extensions'
       
       * lisp/icomplete.el (icomplete-completions): Heed
       `completion-ignored-extensions' (bug#12939).

Naive patch attached that seems to fix it for me.

Here's another problem that might be related (should I open a new bug?)

   When using substring completion and navigating deeper in directories
   using successive C-M-i's (sometimes the directories don't make sense)
    
   Try it with:
    
     Emacs -Q
     M-: (add-to-list 'completion-styles 'substring)
     M-x icomplete-mode
     C-x C-f p a t h / t o / e m a c s /
     s r c C-M-i
    
   Expected to see the same as if I had typed "s r c /", instead I see
   "{src | lib-src}"

>From 7ec9a12f2e22b846c2635a045a8c1a13b4573eba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= <address@hidden>
Date: Mon, 14 Jan 2019 12:46:34 +0000
Subject: [PATCH] Fix icomplete's cycling when filename filtering kicks in

To reproduce:

   Emacs -Q
   M-x icomplete-mode
   C-x C-f
   C-.

Expected candidate list to rotate once to the left.  Instead if only
rotates if I press C-. twice more.  This is because "." and ".." are
still taking part in the rotation under the hood (but one doesn't see
them by default because of completion-ignored-extensions)

* lisp/icomplete.el (icomplete--filtered-completions): New variable.
(icomplete-forward-completions, icomplete-backward-completions):
Use it.
(icomplete-completions): Set it.
---
 lisp/icomplete.el | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 8bed46cb3b..82e2728487 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -162,6 +162,9 @@ icomplete-force-complete-and-exit
       (minibuffer-force-complete-and-exit)
     (minibuffer-complete-and-exit)))
 
+(defvar icomplete--filtered-completions nil
+  "If non-nil completions as filtered by `icomplete-completions'")
+
 (defun icomplete-forward-completions ()
   "Step forward completions by one entry.
 Second entry becomes the first and can be selected with
@@ -169,7 +172,8 @@ icomplete-forward-completions
   (interactive)
   (let* ((beg (icomplete--field-beg))
          (end (icomplete--field-end))
-         (comps (completion-all-sorted-completions beg end))
+         (comps (or icomplete--filtered-completions
+                    (completion-all-sorted-completions beg end)))
         (last (last comps)))
     (when comps
       (setcdr last (cons (car comps) (cdr last)))
@@ -182,7 +186,8 @@ icomplete-backward-completions
   (interactive)
   (let* ((beg (icomplete--field-beg))
          (end (icomplete--field-end))
-         (comps (completion-all-sorted-completions beg end))
+         (comps (or icomplete--filtered-completions
+                    (completion-all-sorted-completions beg end)))
         (last-but-one (last comps 2))
         (last (cdr last-but-one)))
     (when (consp last)               ; At least two elements in comps
@@ -382,9 +387,11 @@ icomplete-completions
        (progn ;;(debug (format "Candidates=%S field=%S" candidates name))
               (format " %sNo matches%s" open-bracket close-bracket))
       (if last (setcdr last nil))
-      (when (and minibuffer-completing-file-name
-                 icomplete-with-completion-tables)
-        (setq comps (completion-pcm--filename-try-filter comps)))
+      (if (and minibuffer-completing-file-name
+               icomplete-with-completion-tables)
+          (setq comps (completion-pcm--filename-try-filter comps)
+                icomplete--filtered-completions comps)
+        (setq icomplete--filtered-completions nil))
       (let* ((most-try
               (if (and base-size (> base-size 0))
                   (completion-try-completion
-- 
2.19.2


--- End Message ---
--- Begin Message --- Subject: Re: bug#34070: 27.0.50; icomplete-mode candidate cycling broken for C-x C-f Date: Thu, 17 Jan 2019 15:22:20 +0000
On Thu, Jan 17, 2019 at 3:00 PM Stefan Monnier <address@hidden> wrote:
>
> > I've already pushed the proposed patch to master, but there's a much
> > less intrusive way using a new patch attached after my sig.
>
> Sounds good.  If you install it, could you install it as 2 separate
> patches: one that undoes the previous one and another that performs the
> new changes?

Done.

commit 5a6df06494f9ba6df53af82cfdf81f1d3708edc3
Author: João Távora
Date:   Tue Jan 15 12:10:23 2019 +0000

    Simplify ignored extensions filtering in Icomplete (bug#34070)

    * lisp/icomplete.el: Use lexical binding.
    (icomplete-completions): Use minibuffer-completion-predicate
    to filter out completion-ignored-extensions.

commit 7560ef7de925b56f367df168befc9b748b6237c1
Author: João Távora
Date:   Thu Jan 17 15:11:21 2019 +0000

    Revert "Fix icomplete's cycling when filename filtering kicks in"

    This reverts commit cdb082322d4209c5104bc1a98b21bf3dd75e8f17,
which
    was a fix for bug#34070.  A much better fix to be added soon.


--- End Message ---

reply via email to

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