GNU bug report logs - #15631
24.3; ido : invert effect of ido-restrict-to-matches with prefix arg

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Wed, 16 Oct 2013 14:55:02 UTC

Severity: wishlist

Tags: patch

Found in version 24.3

Done: Nicolas Richard <youngfrog <at> members.fsf.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Nicolas Richard <youngfrog <at> members.fsf.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#15631: closed (24.3; ido : invert effect of ido-restrict-to-matches
 with prefix arg)
Date: Wed, 01 Jul 2015 23:02:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 02 Jul 2015 01:01:19 +0200
with message-id <868uaz1o00.fsf <at> members.fsf.org>
and subject line Re: bug#15631: 24.3; ido : invert effect of ido-restrict-to-matches with prefix arg
has caused the debbugs.gnu.org bug report #15631,
regarding 24.3; ido : invert effect of ido-restrict-to-matches with prefix arg
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
15631: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15631
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; ido : invert effect of ido-restrict-to-matches with prefix arg
Date: Wed, 16 Oct 2013 16:54:24 +0200
Hello

The function `ido-restrict-to-matches' is used within ido to restrict
focus on currently matched items. It was asked on #emacs to have a
function with the opposite effect : restrict focus on unmatched items.

I found it was useful for me and came up with this solution (adding an
optional argument to the existing function) :

diff --git a/lisp/ido.el b/lisp/ido.el
index cda4021..31aa303 100644
*** a/lisp/ido.el
--- b/lisp/ido.el
***************
*** 3133,3143 ****
        (if (> i 0)
  	  (setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches)))))))
  
! (defun ido-restrict-to-matches ()
!   "Set current item list to the currently matched items."
!   (interactive)
    (when ido-matches
!     (setq ido-cur-list ido-matches
  	  ido-text-init ""
  	  ido-rescan nil
  	  ido-exit 'keep)
--- 3133,3155 ----
        (if (> i 0)
  	  (setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches)))))))
  
! (defun ido-restrict-to-matches (&optional removep)
!   "Set current item list to the currently matched items.
! 
! When argument REMOVEP is non-nil, the currently matched items are
! instead removed from the current item list."
!   (interactive "P")
    (when ido-matches
!     (setq ido-cur-list (cond
!                         (removep
!                          (delq nil
!                                (mapcar
!                                 (lambda (elt)
!                                   (when (not (member elt ido-matches))
!                                     elt))
!                                 ido-cur-list)))
!                         (t ido-matches))
!           ido-matches ido-cur-list
  	  ido-text-init ""
  	  ido-rescan nil
  	  ido-exit 'keep)

-- 
Nicolas.


[Message part 3 (message/rfc822, inline)]
From: Nicolas Richard <youngfrog <at> members.fsf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15631-done <at> debbugs.gnu.org
Subject: Re: bug#15631: 24.3;
 ido : invert effect of ido-restrict-to-matches with prefix arg
Date: Thu, 02 Jul 2015 01:01:19 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:
> A "to" is missing where indicated.

Thanks, I fixed it and pushed. Closing.

Nico.


This bug report was last modified 10 years and 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.