From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area Date: Fri, 11 Mar 2016 17:36:32 -0500 Message-ID: References: <83ziu4hh1r.fsf@gnu.org> <83wpp8hgdy.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c17ad66e5583052dcd92bf X-Trace: ger.gmane.org 1457735905 12834 80.91.229.3 (11 Mar 2016 22:38:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2016 22:38:25 +0000 (UTC) Cc: 22991@debbugs.gnu.org To: Artur Malabarba Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 11 23:38:14 2016 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 1aeVhF-0004e8-UF for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Mar 2016 23:38:14 +0100 Original-Received: from localhost ([::1]:58040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeVhC-000612-0I for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Mar 2016 17:38:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeVh8-00060B-81 for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2016 17:38:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeVh4-0000wv-5v for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2016 17:38:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeVh4-0000wk-2p for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2016 17:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aeVh3-0001Xi-NH for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2016 17:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Mar 2016 22:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22991 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22991-submit@debbugs.gnu.org id=B22991.14577358405670 (code B ref 22991); Fri, 11 Mar 2016 22:38:01 +0000 Original-Received: (at 22991) by debbugs.gnu.org; 11 Mar 2016 22:37:20 +0000 Original-Received: from localhost ([127.0.0.1]:45554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aeVgN-0001TN-Oa for submit@debbugs.gnu.org; Fri, 11 Mar 2016 17:37:20 -0500 Original-Received: from mail-oi0-f43.google.com ([209.85.218.43]:34024) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aeVgL-0001T6-Al for 22991@debbugs.gnu.org; Fri, 11 Mar 2016 17:37:17 -0500 Original-Received: by mail-oi0-f43.google.com with SMTP id m82so96545316oif.1 for <22991@debbugs.gnu.org>; Fri, 11 Mar 2016 14:37:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=R0vS7kpr+jAWBb3hnv4sO74l4KHRs9TOkSYFD4pdSbM=; b=dsHJ8H/0MAT0yu5JCyqJeImu34VjWDrzq0Q6lhWRvDTv/m5ylPtEuW+lWoPyaK7P/m 95Xgvpp5NKvkT5UjmXEMFLz8OrFH3wTnbl9NDCohnGcCY3EPRm5nwhM/dX4ufJ9D0ru9 C0oUy1uNzF3ZCwqdLmI+e0CrHAGF6z4yUKIHmN48HeGyM1srP5I5/LghyvkCzh6/JWpo yeGvdf8/dUmkleBcoKNV2gzRHbzfnpAqTykG+rAb6Whb2gDCnHGH/fCsAwgkSB/okC0d w2O3w0AnnE3NEcotWUwZT5/bKiWI2kWXxxqsKYng+4hzllE9Vv9FYRpu50PAJc/0q+ea 2hLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=R0vS7kpr+jAWBb3hnv4sO74l4KHRs9TOkSYFD4pdSbM=; b=UXWrK7AIYbfDhKzTrF3JgPQSvnaaz4SM3WmmeZ2kq1MPHgSUIN3QygtaDgnq45B2bj 277qRstyhNIj05+r/QLFiykN/Z4rlFvZFrVsoyNqVLda5XrM+caUKVvUHguE7YRo6iqo rfDi460kQqhOGGMTqtjGKlW1kHEf2Yn8rCmWKR97QKgXi4pKz32X7KOsEiPYS301M0b8 u1308kGs2VMl3HPTsmTsIAPtLXXIVBtUnBJBuoLWJje5cyoOtUTtScXEL7BmGpnbRmYZ DXeRzHtO6eO+wqBvKS3gzkVoazgwa8BLuAFHsvuP41NL7yfox2b6JTBXfARQeDJ9LgLF UlPg== X-Gm-Message-State: AD7BkJIT8H4uQ8HFyi/9PPaxUTcTP7VlSf1EBfp2j8xAtE4H3UsREl0dX9wOETk/Xsl0Gb7KR16z8Cd3DRHICQ== X-Received: by 10.202.75.140 with SMTP id y134mr6981529oia.116.1457735831801; Fri, 11 Mar 2016 14:37:11 -0800 (PST) Original-Received: by 10.202.172.198 with HTTP; Fri, 11 Mar 2016 14:36:32 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:114798 Archived-At: --001a11c17ad66e5583052dcd92bf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Mar 11, 2016 at 5:22 PM, Artur Malabarba wrote: > This last patch looks fine to me. =F0=9F=91=8D > Thanks. Here's one more shot with fix for that bug that was already there that Eli mentioned. Now if the user has set search-default-mode to t and if they do C-s, the description is still "" (not "regexp "). So the minibuffer would read "I-search: ". Below is the patch created using git format-patch with appropriate commit log. >From df1a6e8e9d8227f5c137236a09fda9818c479d0c Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Fri, 11 Mar 2016 17:34:50 -0500 Subject: [PATCH] Fix description for regexp searches (bug 22991) * lisp/isearch.el (isearch--describe-regexp-mode): With `search-default-mode' set to nil, if user does C-u C-s, the minibuffer now displays "Regexp I-search: ". But if the user has set `search-default-mode' to t, and then does C-s, the minibuffer now displays "I-search: " because the default search mode is now regexp mode. Comments have been added to explain the priority of conditions in the `cond' form. --- lisp/isearch.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index b8ada2c..646a906 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2574,15 +2574,26 @@ isearch--describe-regexp-mode (when (eq regexp-function t) (setq regexp-function #'word-search-regexp)) (let ((description - ;; Don't use a description on the default search mode. - (cond ((equal regexp-function search-default-mode) "") + (cond + ;; 1. Do not use a description on the default search mode, + ;; but only if the default search mode is non-nil. + ((or (and search-default-mode + (equal search-default-mode regexp-function)) + ;; Special case where `search-default-mode' is t + ;; (defaults to regexp searches). + (and (eq search-default-mode t) + (eq search-default-mode isearch-regexp))) "") + ;; 2. Use the `isearch-message-prefix' set for + ;; `regexp-function' if available. (regexp-function (and (symbolp regexp-function) (or (get regexp-function 'isearch-message-prefix) ""))) + ;; 3. Else if `isearch-regexp' is non-nil, set description + ;; to "regexp ". (isearch-regexp "regexp ") - ;; We're in literal mode. If the default mode is not - ;; literal, then describe it. + ;; 4. And finally, if we're in literal mode (and if the + ;; default mode is also not literal), describe it. ((functionp search-default-mode) "literal ")))) (if space-before ;; Move space from the end to the beginning. -- 2.6.0.rc0.24.gec371ff -- Kaushal Modi --001a11c17ad66e5583052dcd92bf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Fri, Mar 11, 2016 at 5:22 PM, Artur Malabarba <bruce.connor.am@= gmail.com> wrote:

This la= st patch looks fine to me. =F0=9F=91=8D


Thanks.

Here= 9;s one more shot with fix for that bug that was already there that Eli men= tioned.
Now if the user has set search-defa= ult-mode to t and if they do C-s, the description is still "" (no= t "regexp "). So the minibuffer would read "I-search: "= .

Belo= w is the patch created using git format-patch with appropriate commit log.<= /div>

From df1a6e8e9d8227f5c137236a09fda9818c479d0c Mon Sep = 17 00:00:00 2001
From: Kaushal Modi <kaushal.modi@gmail.com>
=
Date: Fri, 11 Mar 2016 17:34:50 -0500
Subject: [PATCH] Fix description for regexp searches = (bug 22991)

* lisp/isearch.el (isearch--describe-regexp-mode): With
=C2=A0 `search-default-mode' set to nil, if user doe= s C-u C-s, the minibuffer
=C2=A0 now displa= ys "Regexp I-search: ".=C2=A0 But if the user has set
=C2=A0 `search-default-mode' to t, and then does C= -s, the minibuffer now
=C2=A0 displays &quo= t;I-search: " because the default search mode is now regexp
=C2=A0 mode.=C2=A0 Comments have been added to explai= n the priority of conditions
=C2=A0 in the = `cond' form.
---
=C2=A0lisp/isearch.el | 19 +++++++++++++++----
=C2=A01 file changed, 15 insertions(+), 4 deletions(-)
<= div class=3D"gmail_extra">
diff --git a= /lisp/isearch.el b/lisp/isearch.el
index b8= ada2c..646a906 100644
--- a/lisp/isearch.el=
+++ b/lisp/isearch.el
@@ -2574,15 +2574,26 @@ isearch--describe-regexp-mode
=C2=A0 =C2=A0(when (eq regexp-function t)
=C2=A0 =C2=A0 =C2=A0(setq regexp-function #'word-= search-regexp))
=C2=A0 =C2=A0(let ((descrip= tion
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Don&#= 39;t use a description on the default search mode.
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cond ((equal regexp-function search-= default-mode) "")
+ =C2=A0 =C2=A0= =C2=A0 =C2=A0 (cond
+ =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0;; 1. Do not use a description on the default search mode,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; =C2=A0= =C2=A0but only if the default search mode is non-nil.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((or (and search-default-mo= de
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(equal search-default-mode regexp-function))=
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ;; Special case where `search-default-mode' is t
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; = (defaults to regexp searches).
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (and (eq search-default-mode t)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(eq search-default-mode isearch-regexp))) "&qu= ot;)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;;= 2. Use the `isearch-message-prefix' set for
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; =C2=A0 =C2=A0`regexp-function&= #39; if available.
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(regexp-function
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (and (symbolp regexp-function)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(or (get regexp-function 'isearch-message-prefix)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0"")))
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; 3. Else if `isearch-regexp' is non= -nil, set description
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0;; =C2=A0 =C2=A0to "regexp ".
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(isearch-regexp &quo= t;regexp ")
- =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 ;; We're in literal mode. If the default mode = is not
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 ;; literal, then describe it.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; 4. And finally, if we're in li= teral mode (and if the
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0;; =C2=A0 =C2=A0default mode is also not literal), describ= e it.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0((functionp search-default-mode) "literal "))))
=C2=A0 =C2=A0 =C2=A0(if space-before
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Move space from the e= nd to the beginning.
--
2.6.0.rc0.24.gec371ff


--
Kaushal Modi
--001a11c17ad66e5583052dcd92bf--