all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Artur Malabarba <bruce.connor.am@gmail.com>
Cc: 22991@debbugs.gnu.org
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	[thread overview]
Message-ID: <CAFyQvY1oSiuJRp5zHCOjzhgysRPA2So_oiG-a4_5-yPtkBthFw@mail.gmail.com> (raw)
In-Reply-To: <CAAdUY-+9C=9FNP6qqA+jtsTnpKYey5cBjNmWP1sPWsvOsq3ppw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3009 bytes --]

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

> This last patch looks fine to me. 👍
>

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 <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
  `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

[-- Attachment #2: Type: text/html, Size: 5652 bytes --]

  reply	other threads:[~2016-03-11 22:36 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 19:48 bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area Kaushal Modi
2016-03-11 20:46 ` Kaushal Modi
2016-03-11 20:54   ` Eli Zaretskii
2016-03-11 20:58     ` Kaushal Modi
2016-03-11 21:08       ` Eli Zaretskii
2016-03-11 21:22         ` Kaushal Modi
2016-03-11 22:22           ` Artur Malabarba
2016-03-11 22:36             ` Kaushal Modi [this message]
2016-03-11 23:37         ` Michael Heerdegen
2016-03-11 23:40           ` Kaushal Modi
2016-03-12  1:11             ` Artur Malabarba
2016-03-12  4:56               ` Kaushal Modi
2016-03-12  7:49                 ` Eli Zaretskii
2016-03-12 12:33                   ` Michael Heerdegen
2016-03-12 12:46                     ` Eli Zaretskii
2016-03-12 12:51                       ` Michael Heerdegen
2016-03-12 13:52                         ` Artur Malabarba
2016-03-12 14:35                           ` Kaushal Modi
2016-03-12 16:13                         ` Eli Zaretskii
     [not found]                 ` <<83h9gcgmor.fsf@gnu.org>
2016-03-12 15:14                   ` Drew Adams
2016-03-12 16:25                     ` Drew Adams
2016-03-12 22:40                     ` Juri Linkov
2016-03-12 23:11                       ` Drew Adams
2016-03-13 23:40                         ` Juri Linkov
2016-03-14  0:03                           ` Drew Adams
2016-03-14  3:39                           ` Eli Zaretskii
2016-03-14 13:50                             ` Kaushal Modi
2016-03-14 15:29                               ` Drew Adams
2016-03-14 16:29                               ` Artur Malabarba
2016-03-14 18:17                                 ` Eli Zaretskii
2016-03-14 18:32                                   ` Kaushal Modi
2016-03-12  7:30             ` Eli Zaretskii
2016-03-12  7:29           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY1oSiuJRp5zHCOjzhgysRPA2So_oiG-a4_5-yPtkBthFw@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=22991@debbugs.gnu.org \
    --cc=bruce.connor.am@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.