all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Dani Moncayo <dmoncayo@gmail.com>
Cc: 12078@debbugs.gnu.org
Subject: bug#12078: 24.1; Improve the I-search prompt
Date: Sun, 29 Jul 2012 21:04:51 +0300	[thread overview]
Message-ID: <87d33esat8.fsf@mail.jurta.org> (raw)
In-Reply-To: <87txwr2ylo.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 29 Jul 2012 03:35:31 +0300")

>>   Failing I-search: foobar
>>   Overwrapped I-search: foobar
>>   Failing overwrapped I-search: foobar
>>   Failing I-search: foobar [initial node]
>>
>> would be
>>
>>   I-search: foobar  [failing]
>>   I-search: foobar  [overwrapped]
>>   I-search: foobar  [failing, overwrapped]
>>   I-search: foobar  [failing, initial node]
>
> I think we should distinguish between momentary messages and search states.
> For instance, "failing" is a momentary message, but "overwrapped"
> is a search state.  It would be very annoying to display persistent
> search states like "overwrapped" at the end of the search prompt.

So what could be moved to the end of the search string are two messages
"failing" and "pending".  With the following patch a failed search will
display the message suffix "[failed]".  A failed search in Info will
display the message suffix either "[failed at the end of node]" or
"[failed at the end of manual]", and pending will display "[pending]".

I don't propose to install this change immediately.
Please try this out for a while.

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2012-07-18 09:27:23 +0000
+++ lisp/isearch.el	2012-07-29 18:01:27 +0000
@@ -2371,8 +2412,8 @@ (defun isearch-message-prefix (&optional
 	 (error nil)))
   ;; If currently failing, display no ellipsis.
   (or isearch-success (setq ellipsis nil))
-  (let ((m (concat (if isearch-success "" "failing ")
-		   (if isearch-adjusted "pending " "")
+  (let ((m (concat ;; (if isearch-success "" "failing ")
+		   ;; (if isearch-adjusted "pending " "")
 		   (if (and isearch-wrapped
 			    (not isearch-wrap-function)
 			    (if isearch-forward
@@ -2402,11 +2448,14 @@ (defun isearch-message-prefix (&optional
 		'face 'minibuffer-prompt)))
 
 (defun isearch-message-suffix (&optional c-q-hack _ellipsis)
-  (concat (if c-q-hack "^Q" "")
-	  (if isearch-error
-	      (concat " [" isearch-error "]")
-	    "")
-	  (or isearch-message-suffix-add "")))
+  (let ((m (mapconcat 'identity
+		      (delq nil (list (if (not isearch-success) "failed")
+				      (if isearch-adjusted "pending")
+				      isearch-error))
+		      " ")))
+    (concat (if c-q-hack "^Q" "")
+	    (if (> (length m) 0) (concat " [" m "]") "")
+	    (or isearch-message-suffix-add ""))))
 
 \f
 ;; Searching

=== modified file 'lisp/info.el'
--- lisp/info.el	2012-07-10 11:51:54 +0000
+++ lisp/info.el	2012-07-29 18:01:28 +0000
@@ -1863,13 +1867,13 @@ (defun Info-search (regexp &optional bou
 		 (not bound)
 		 (or give-up (and found (not (and (> found opoint-min)
 						  (< found opoint-max))))))
-	(signal 'search-failed (list regexp "initial node")))
+	(signal 'search-failed (list regexp "at the end of node")))
 
       ;; If no subfiles, give error now.
       (if give-up
 	  (if (null Info-current-subfile)
 	      (if isearch-mode
-		  (signal 'search-failed (list regexp "end of manual"))
+		  (signal 'search-failed (list regexp "at the end of manual"))
 		(let ((search-spaces-regexp
 		       (if (or (not isearch-mode) isearch-regexp)
 			   Info-search-whitespace-regexp)))
@@ -1946,7 +1951,7 @@ (defun Info-search (regexp &optional bou
 	      (if found
 		  (message "")
 		(signal 'search-failed (if isearch-mode
-					   (list regexp "end of manual")
+					   (list regexp "at the end of manual")
 					 (list regexp)))))
 	  (if (not found)
 	      (progn (Info-read-subfile osubfile)






  reply	other threads:[~2012-07-29 18:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-28 17:56 bug#12078: 24.1; Improve the I-search prompt Dani Moncayo
2012-07-29  0:35 ` Juri Linkov
2012-07-29 18:04   ` Juri Linkov [this message]
2012-07-30  0:45     ` Dani Moncayo
2012-07-30  9:25       ` Stefan Monnier
2012-07-30  9:30         ` Dani Moncayo
2012-07-30 23:03           ` Stefan Monnier
2012-07-30 23:50             ` Dani Moncayo
2012-08-01 23:29               ` Stefan Monnier
2012-08-08  8:06       ` Juri Linkov
2012-08-08  8:30         ` Dani Moncayo
2020-09-18 15:05 ` Lars Ingebrigtsen

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=87d33esat8.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=12078@debbugs.gnu.org \
    --cc=dmoncayo@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.