From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.bugs Subject: bug#15631: 24.3; ido : invert effect of ido-restrict-to-matches with prefix arg Date: Wed, 16 Oct 2013 16:54:24 +0200 Message-ID: <87r4bl4673.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381935326 1745 80.91.229.3 (16 Oct 2013 14:55:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Oct 2013 14:55:26 +0000 (UTC) To: 15631@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 16 16:55:28 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VWSVQ-0003jo-W1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 16:55:25 +0200 Original-Received: from localhost ([::1]:47758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWSVQ-0000P9-HV for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 10:55:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWSVE-0000O6-4a for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 10:55:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWSV4-0006pu-Nb for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 10:55:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWSV4-0006pa-KM for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 10:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VWSV4-0004Sq-AU for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 10:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Richard Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Oct 2013 14:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15631 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138193527417123 (code B ref -1); Wed, 16 Oct 2013 14:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Oct 2013 14:54:34 +0000 Original-Received: from localhost ([127.0.0.1]:54382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWSUa-0004S6-U5 for submit@debbugs.gnu.org; Wed, 16 Oct 2013 10:54:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43453) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWSUY-0004Rs-Km for submit@debbugs.gnu.org; Wed, 16 Oct 2013 10:54:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWSUJ-0006VS-TI for submit@debbugs.gnu.org; Wed, 16 Oct 2013 10:54:25 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWSUJ-0006VO-Qb for submit@debbugs.gnu.org; Wed, 16 Oct 2013 10:54:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWSUC-0000CS-FH for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 10:54:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWSU2-0006PL-VL for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 10:54:08 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:17470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWSU2-0006Op-CR for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 10:53:58 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYHAGWnXlKkD4Nx/2dsb2JhbABas28Bk2N0gz0kNAF7h1gBEp1Lj1mHOAGKQo9uhA8DjFOLMYYkgQ+KT4MmOg Original-Received: from geodiff-mac3.ulb.ac.be (HELO geodiff-mac3) ([164.15.131.113]) by smtp.ulb.ac.be with ESMTP; 16 Oct 2013 16:53:56 +0200 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79311 Archived-At: 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.