From: Artur Malabarba <bruce.connor.am@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel <emacs-devel@gnu.org>,
"Stephen J. Turnbull" <stephen@xemacs.org>,
Stefan Monnier <monnier@iro.umontreal.ca>,
Kaushal <kaushal.modi@gmail.com>
Subject: Displaying the state of isearch toggles [was Re: ASCII-folded search]
Date: Sun, 28 Jun 2015 11:47:22 +0100 [thread overview]
Message-ID: <CAAdUY-K3x4i+7wFvbEstvKVKuSZyM-DL4wB+Pe7ZbsHcVYXOfw@mail.gmail.com> (raw)
2015-06-27 23:48 GMT+01:00 Juri Linkov <juri@linkov.net>:
> Whether to display verbose indicators (like currently are used, e.g.
> “Regexp I-search”) or 1-letter cryptic ones (e.g. “I-search(r/c/')”
> like in C-mode with its indicators such as “C/lahw”) is a matter of taste
> and could be customizable.
Here's a suggestion on how verbose toggles could be done, following
Kaushal's previous mention of multi-line echo areas.
It shows the state of all toggles on a line above the prompt. This is
given the usual `minibuffer-prompt' face and it stays fixed while the
user is typing/searching, so it's not a distraction.
-------- the usual modeline here ---------
case-fold: ON regexp: OFF word: ON symbol: OFF lax-space: ON
char-fold: OFF invisible: ON
Isearch:
We can discuss which toggles to display by default, of course, this is
just an example.
---
lisp/isearch.el | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 45c6d97..b0f4321 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2521,6 +2521,26 @@ If there is no completion possible, say so and
continue searching."
(isearch-message-suffix c-q-hack)))
(if c-q-hack m (let ((message-log-max nil)) (message "%s" m)))))
+(defcustom isearch-show-toggles t
+ "Non-nil means to list options above input prompt."
+ :type 'boolean
+ :version "25.1")
+
+(defun isearch--describe-toggles ()
+ "Return a propertized description of isearch toggles."
+ (concat
+ (mapconcat (lambda (x) (propertize (concat (car x) ": " (if (cadr
x) "ON " "OFF"))
+ 'face 'minibuffer-prompt))
+ `(("case-fold" ,isearch-case-fold-search)
+ ("regexp" ,isearch-regexp)
+ ("word" ,(eq isearch-word t))
+ ("symbol" ,(eq isearch-word #'isearch-symbol-regexp))
+ ("lax-space" ,isearch-lax-whitespace)
+ ("char-fold" ,(eq isearch-word #'character-fold-to-regexp))
+ ("invisible" ,isearch-invisible))
+ " ")
+ "\n"))
+
(defun isearch-message-prefix (&optional ellipsis nonincremental)
;; If about to search, and previous search regexp was invalid,
;; check that it still is. If it is valid now,
@@ -2569,8 +2589,9 @@ If there is no completion possible, say so and
continue searching."
(concat " [" current-input-method-title "]: "))
": ")
)))
- (propertize (concat (upcase (substring m 0 1)) (substring m 1))
- 'face 'minibuffer-prompt)))
+ (concat (when isearch-show-toggles (isearch--describe-toggles))
+ (propertize (concat (upcase (substring m 0 1)) (substring m 1))
+ 'face 'minibuffer-prompt))))
(defun isearch-message-suffix (&optional c-q-hack)
(concat (if c-q-hack "^Q" "")
--
2.4.4
next reply other threads:[~2015-06-28 10:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-28 10:47 Artur Malabarba [this message]
2015-06-28 14:37 ` Displaying the state of isearch toggles [was Re: ASCII-folded search] Eli Zaretskii
2015-06-28 15:08 ` Kaushal
[not found] <<CAAdUY-K3x4i+7wFvbEstvKVKuSZyM-DL4wB+Pe7ZbsHcVYXOfw@mail.gmail.com>
[not found] ` <<831tgv7vbr.fsf@gnu.org>
2015-06-28 17:02 ` Drew Adams
2015-06-28 17:29 ` Drew Adams
2015-06-29 22:03 ` Juri Linkov
2015-06-29 22:26 ` Drew Adams
2015-06-30 15:03 ` Eli Zaretskii
2015-06-30 2:43 ` Eli Zaretskii
2015-06-30 7:53 ` Oleh Krehel
[not found] ` <<ddcd0bf6-a60e-406b-a79d-088c13c2ac61@default>
[not found] ` <<87h9pq18ae.fsf@mail.linkov.net>
[not found] ` <<83a8vh5316.fsf@gnu.org>
2015-06-30 4:39 ` Drew Adams
2015-06-30 6:25 ` Artur Malabarba
2015-06-30 14:04 ` Drew Adams
2015-06-30 14:41 ` Artur Malabarba
2015-06-30 15:06 ` Eli Zaretskii
[not found] ` <<9da72b40-0236-4edd-983e-90c54ca7f827@default>
[not found] ` <<83616544o3.fsf@gnu.org>
2015-06-30 17:17 ` Drew Adams
[not found] ` <<d9b5bdf0-9a8f-48b8-b24f-1b7ead67220f@default>
[not found] ` <<837fql44s9.fsf@gnu.org>
2015-06-30 17:14 ` Drew Adams
2015-06-30 17:22 ` 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=CAAdUY-K3x4i+7wFvbEstvKVKuSZyM-DL4wB+Pe7ZbsHcVYXOfw@mail.gmail.com \
--to=bruce.connor.am@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
--cc=kaushal.modi@gmail.com \
--cc=monnier@iro.umontreal.ca \
--cc=stephen@xemacs.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.