From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Displaying the state of isearch toggles [was Re: ASCII-folded search] Date: Sun, 28 Jun 2015 11:47:22 +0100 Message-ID: Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1435488460 20376 80.91.229.3 (28 Jun 2015 10:47:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jun 2015 10:47:40 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel , "Stephen J. Turnbull" , Stefan Monnier , Kaushal To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 28 12:47:38 2015 Return-path: Envelope-to: ged-emacs-devel@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 1Z9A7d-0006fP-Ah for ged-emacs-devel@m.gmane.org; Sun, 28 Jun 2015 12:47:37 +0200 Original-Received: from localhost ([::1]:38482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9A7c-0003e2-Fz for ged-emacs-devel@m.gmane.org; Sun, 28 Jun 2015 06:47:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9A7V-0003dw-9v for emacs-devel@gnu.org; Sun, 28 Jun 2015 06:47:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9A7U-0000uF-7R for emacs-devel@gnu.org; Sun, 28 Jun 2015 06:47:29 -0400 Original-Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:35507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9A7Q-0000tW-2k; Sun, 28 Jun 2015 06:47:24 -0400 Original-Received: by lagh6 with SMTP id h6so25047529lag.2; Sun, 28 Jun 2015 03:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:date:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=DhFDUU3BC5jhUsfsIKf8UJ3mCG2oiX2hS2JDEPxEK3I=; b=r6nre00igICSxg1qeXFcUn8YnkeDOCBVEC4hmTIKSBlixd4T0q1JmYz7DG2g1aH40d OIZYLi+m4iV0K1VyhXn5xkNqR653r7Q55eUfPBxpHzOKA7lm2M96UYZbRXGAaX/1hIto HhXjSCnk4vYUnmjZEwXNQV+9KOvLSiRzUpZNPCBK7GulPvRuTRD7mGVx/YmlDvfMlErD kMnUG2ukVQFxTMrSCQUYv4nWEz6++tnMaEmWU646mCPuZrAmCZMc/V4CGXCaGUKUhpWB AZWOxYIIs0NhLbw1WDFrqTRHL1wShLMMWDBCk98LJcKR1TDM1z5KHO/I5O29G8XvtKa5 uQCA== X-Received: by 10.112.222.133 with SMTP id qm5mr9417572lbc.86.1435488442616; Sun, 28 Jun 2015 03:47:22 -0700 (PDT) Original-Received: by 10.25.214.133 with HTTP; Sun, 28 Jun 2015 03:47:22 -0700 (PDT) X-Google-Sender-Auth: UCSUzutFtW3J4uqrnc-5kst-iZo X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187609 Archived-At: 2015-06-27 23:48 GMT+01:00 Juri Linkov : > Whether to display verbose indicators (like currently are used, e.g. > =E2=80=9CRegexp I-search=E2=80=9D) or 1-letter cryptic ones (e.g. =E2=80= =9CI-search(r/c/')=E2=80=9D > like in C-mode with its indicators such as =E2=80=9CC/lahw=E2=80=9D) 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" "") --=20 2.4.4