From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steven Degutis Newsgroups: gmane.emacs.bugs Subject: bug#14143: [gmane.emacs.devel] Patch to ido.el Date: Fri, 5 Apr 2013 10:40:11 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec544ece013fd2404d99ee7c3 X-Trace: ger.gmane.org 1365278611 29363 80.91.229.3 (6 Apr 2013 20:03:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Apr 2013 20:03:31 +0000 (UTC) Cc: 14143-done@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 06 22:03: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 1UOZJU-0007UX-Lt for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Apr 2013 22:02:12 +0200 Original-Received: from localhost ([::1]:33534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOAgI-0001Z9-74 for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Apr 2013 13:44:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOAfb-0000Fk-U5 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2013 13:43:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOAIk-0005SE-AI for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2013 13:20:28 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOAIj-0005SA-W0 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2013 13:19:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UOALt-0002sy-WF for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2013 13:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Steven Degutis Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Apr 2013 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14143 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14143-done@debbugs.gnu.org id=D14143.136518252711009 (code D ref 14143); Fri, 05 Apr 2013 17:23:01 +0000 Original-Received: (at 14143-done) by debbugs.gnu.org; 5 Apr 2013 17:22:07 +0000 Original-Received: from localhost ([127.0.0.1]:35795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UOAL0-0002rT-2l for submit@debbugs.gnu.org; Fri, 05 Apr 2013 13:22:07 -0400 Original-Received: from mail-pb0-f51.google.com ([209.85.160.51]:54993) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UO8nY-0000IH-Ku for 14143-done@debbugs.gnu.org; Fri, 05 Apr 2013 11:43:31 -0400 Original-Received: by mail-pb0-f51.google.com with SMTP id rr4so2063107pbb.38 for <14143-done@debbugs.gnu.org>; Fri, 05 Apr 2013 08:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=gomLo30cNqOltc2U1r0VWVf+nKlrQuzLcVeOzKIcUjI=; b=0DiQ/QKkfHN3QupMZ64og1xtj7SP2hOv3Lmk6+JzKr5ROFQMskPuAYxvn+Y+LI7LIq 1ZWi6G0MK7NNPFbLMLct7pSDwxqA6xhJJIRUWHJdMCuil/1DQAUFsXBcBZC5VFQYMMTK ue+ENjnoEb+bJzgkJKtbwnKCIP2PAnRK44Qmth5aip7+OXm+1iWtg7A3sqczflSKxWUX gTufbykCX3sap5bTxMibkwdx4AixZQLEJByr+/rHLbJ5Gqy5XspX1vP1q/H+qycuDf33 gec1BVsPaTDSPSx59Fp0azvVKE83/G0B6C757+Rg76HNZRY+6jjIXbtu8Sf4kU8xRsjm aU7A== X-Received: by 10.68.59.8 with SMTP id v8mr12185916pbq.218.1365176411746; Fri, 05 Apr 2013 08:40:11 -0700 (PDT) Original-Received: by 10.70.6.100 with HTTP; Fri, 5 Apr 2013 08:40:11 -0700 (PDT) In-Reply-To: X-Mailman-Approved-At: Fri, 05 Apr 2013 13:22:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:73197 Archived-At: --bcaec544ece013fd2404d99ee7c3 Content-Type: text/plain; charset=ISO-8859-1 Your patch is mostly perfect, except there's one more thing needed, namely that the inner-if on line 4563 has to be wrapped with an (and (not (ido-show-when-exact-single-match)) ...) and the defcustom created above it defaulting to nil. I didn't apply this to your patch because to be honest, I have no idea how to apply your patch to my copy of ido.el. So I submitted a bug report just now via M-x report-emacs-bug, and included as much information as I can. -Steven On Fri, Apr 5, 2013 at 9:04 AM, Stefan Monnier wrote: > Thanks for your bug-report, Steven [ by now, it seems you've been told > plenty of times how/where to send your patch, right? ]. > > I installed your patch with a few changes. The most important one is to > make sure that people who have customized their ido-decorations still > get the same behavior as before. See the final patch below. > > > Stefan > > > === modified file 'etc/NEWS' > --- etc/NEWS 2013-03-30 13:49:00 +0000 > +++ etc/NEWS 2013-04-05 13:54:30 +0000 > @@ -87,6 +87,8 @@ > > * Changes in Specialized Modes and Packages in Emacs 24.4 > > +** `ido-decorations' has been slightly extended to give a bit more > control. > + > ** More packages look for ~/.emacs.d/ additionally to ~/.. > Affected files: > ~/.emacs.d/timelog replaces ~/.timelog > > === modified file 'lisp/ChangeLog' > --- lisp/ChangeLog 2013-04-05 10:18:43 +0000 > +++ lisp/ChangeLog 2013-04-05 13:55:28 +0000 > @@ -1,3 +1,9 @@ > +2013-04-05 Stefan Monnier > + > + * ido.el (ido-completions): Use extra elements of ido-decorations > + (bug#14143). > + (ido-decorations): Update docstring. > + > 2013-04-05 Michael Albinus > > * autorevert.el (auto-revert-mode, auto-revert-tail-mode) > > === modified file 'lisp/ido.el' > --- lisp/ido.el 2013-03-20 03:05:34 +0000 > +++ lisp/ido.el 2013-04-05 13:49:23 +0000 > @@ -765,7 +765,7 @@ > > (defcustom ido-decorations '( "{" "}" " | " " | ..." "[" "]" " [No > match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]") > "List of strings used by ido to display the alternatives in the > minibuffer. > -There are 11 elements in this list: > +There are between 11 and 13 elements in this list: > 1st and 2nd elements are used as brackets around the prospect list, > 3rd element is the separator between prospects (ignored if > `ido-separator' is set), > 4th element is the string inserted at the end of a truncated list of > prospects, > @@ -775,7 +775,9 @@ > 8th element is displayed if there is a single match (and faces are not > used), > 9th element is displayed when the current directory is non-readable, > 10th element is displayed when directory exceeds `ido-max-directory-size', > -11th element is displayed to confirm creating new file or buffer." > +11th element is displayed to confirm creating new file or buffer. > +12th and 13th elements (if present) are used as brackets around the sole > +remaining completion. If absent, elements 5 and 6 are used instead." > :type '(repeat string) > :group 'ido) > > @@ -4581,10 +4583,12 @@ > (string-equal (match-string 0 (ido-name (car > comps))) > (ido-name (car comps)))) > "" > - ;; when there is one match, show the matching file > name in full > - (concat (nth 4 ido-decorations) ;; [ ... ] > + ;; When there is only one match, show the matching > file > + ;; name in full wrapped in [ ... ]. > + (concat > + (or (nth 11 ido-decorations) (nth 4 > ido-decorations)) > (ido-name (car comps)) > - (nth 5 ido-decorations))) > + (or (nth 12 ido-decorations) (nth 5 > ido-decorations)))) > (if (not ido-use-faces) (nth 7 ido-decorations)))) ;; > [Matched] > (t ;multiple matches > (let* ((items (if (> ido-max-prospects 0) (1+ > ido-max-prospects) 999)) > > --bcaec544ece013fd2404d99ee7c3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Your patch is mostly perfect, except there'= s one more thing needed, namely that the inner-if on line 4563 has to be wr= apped with an (and (not (ido-show-when-exact-single-match)) ...) and the de= fcustom created above it defaulting to nil. I didn't apply this to your= patch because to be honest, I have no idea how to apply your patch to my c= opy of ido.el.

So I submitted a bug report just now via M-= x report-emacs-bug, and included as much information as I can.
-Steven


On Fri, Apr 5, 2013 at 9:04 AM, Stefan Monni= er <monnier@iro.umontreal.ca> wrote:
Thanks for your bug-report, Steven [ by now, it seems you've been told<= br> plenty of times how/where to send your patch, right? =A0].

I installed your patch with a few changes. =A0The most important one is to<= br> make sure that people who have customized their ido-decorations still
get the same behavior as before. =A0See the final patch below.


=A0 =A0 =A0 =A0 Stefan


=3D=3D=3D modified file 'etc/NEWS'
--- etc/NEWS =A0 =A02013-03-30 13:49:00 +0000
+++ etc/NEWS =A0 =A02013-04-05 13:54:30 +0000
@@ -87,6 +87,8 @@

=A0* Changes in Specialized Modes and Packages in Emacs 24.4

+** `ido-decorations' has been slightly extended to give a bit more con= trol.
+
=A0** More packages look for ~/.emacs.d/<foo> additionally to ~/.<= foo>.
=A0Affected files:
=A0~/.emacs.d/timelog =A0 =A0 replaces =A0~/.timelog

=3D=3D=3D modified file 'lisp/ChangeLog'
--- lisp/ChangeLog =A0 =A0 =A02013-04-05 10:18:43 +0000
+++ lisp/ChangeLog =A0 =A0 =A02013-04-05 13:55:28 +0000
@@ -1,3 +1,9 @@
+2013-04-05 =A0Stefan Monnier =A0<monnier@iro.umontreal.ca>
+
+ =A0 =A0 =A0 * ido.el (ido-completions): Use extra elements of ido-decorat= ions
+ =A0 =A0 =A0 (bug#14143).
+ =A0 =A0 =A0 (ido-decorations): Update docstring.
+
=A02013-04-05 =A0Michael Albinus =A0<michael.albinus@gmx.de>

=A0 =A0 =A0 =A0 * autorevert.el (auto-revert-mode, auto-revert-tail-mode)
=3D=3D=3D modified file 'lisp/ido.el'
--- lisp/ido.el 2013-03-20 03:05:34 +0000
+++ lisp/ido.el 2013-04-05 13:49:23 +0000
@@ -765,7 +765,7 @@

=A0(defcustom ido-decorations '( "{" "}" " | &= quot; " | ..." "[" "]" " [No match]"= ; " [Matched]" " [Not readable]" " [Too big]"= " [Confirm]")
=A0 =A0"List of strings used by ido to display the alternatives in the= minibuffer.
-There are 11 elements in this list:
+There are between 11 and 13 elements in this list:
=A01st and 2nd elements are used as brackets around the prospect list,
=A03rd element is the separator between prospects (ignored if `ido-separato= r' is set),
=A04th element is the string inserted at the end of a truncated list of pro= spects,
@@ -775,7 +775,9 @@
=A08th element is displayed if there is a single match (and faces are not u= sed),
=A09th element is displayed when the current directory is non-readable,
=A010th element is displayed when directory exceeds `ido-max-directory-size= ',
-11th element is displayed to confirm creating new file or buffer." +11th element is displayed to confirm creating new file or buffer.
+12th and 13th elements (if present) are used as brackets around the sole +remaining completion. =A0If absent, elements 5 and 6 are used instead.&quo= t;
=A0 =A0:type '(repeat string)
=A0 =A0:group 'ido)

@@ -4581,10 +4583,12 @@
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (string-equal (match-st= ring 0 (ido-name (car comps)))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 (ido-name (car comps))))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ""
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; when there is one match, show = the matching file name in full
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (concat (nth 4 ido-decorations) = =A0;; [ ... ]
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; When there is only one match, = show the matching file
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; name in full wrapped in [ ... = ].
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (concat
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(or (nth 11 ido-decorations) (= nth 4 ido-decorations))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (ido-name (car = comps))
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (nth 5 ido-decora= tions)))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(or (nth 12 ido-decorations) (= nth 5 ido-decorations))))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(if (not ido-use-faces) (nth 7 ido-d= ecorations)))) =A0;; [Matched]
=A0 =A0 =A0 =A0 =A0 (t =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0;multiple matches
=A0 =A0 =A0 =A0 =A0 =A0(let* ((items (if (> ido-max-prospects 0) (1+ ido= -max-prospects) 999))


--bcaec544ece013fd2404d99ee7c3--