all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Artur Malabarba <arturmalabarba@gmail.com>, 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 16:22:30 -0500	[thread overview]
Message-ID: <CAFyQvY2LTtRcKGzcvTjfwRx_H9O3RHqXvqpwGAtSpUd6AQz-8g@mail.gmail.com> (raw)
In-Reply-To: <83wpp8hgdy.fsf@gnu.org>

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

> Which I think is wrong, since the default mode shouldn't show anything
> except "I-search: ".  Right?

Even before this patch, that behavior (Displaying "Regexp I-search:" on C-s
even when search-default-mode is t) was that way. Because, even when
search-default-mode is t, regexp-function still stays nil. So that first
cond form condition evals to nil.

But I discovered a major issue with my patch. So here's a new one which is
less intrusive. I also added explanation for the current priority order in
the cond.

diff --git a/lisp/isearch.el b/lisp/isearch.el
index b8ada2c..7c3d4e3 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2574,16 +2574,23 @@ 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) "")
-               (regexp-function
-                (and (symbolp regexp-function)
-                     (or (get regexp-function 'isearch-message-prefix)
-                         "")))
-               (isearch-regexp "regexp ")
-               ;; We're in literal mode. If the default mode is not
-               ;; literal, then describe it.
-               ((functionp search-default-mode) "literal "))))
+         (cond
+          ;; 1. Don't use a description on the default search mode,
+          ;;    only if the default search mode is non-nil.
+          ((and search-default-mode
+                (equal regexp-function search-default-mode)) "")
+          ;; 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 ")
+          ;; 4. And finally, if we're in literal mode (AND if default
+          ;; mode is not literal too), then describe it.
+          ((functionp search-default-mode) "literal "))))
     (if space-before
         ;; Move space from the end to the beginning.
         (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)

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

  reply	other threads:[~2016-03-11 21:22 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 [this message]
2016-03-11 22:22           ` Artur Malabarba
2016-03-11 22:36             ` Kaushal Modi
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=CAFyQvY2LTtRcKGzcvTjfwRx_H9O3RHqXvqpwGAtSpUd6AQz-8g@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=22991@debbugs.gnu.org \
    --cc=arturmalabarba@gmail.com \
    --cc=eliz@gnu.org \
    /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.