all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: drew.adams@oracle.com, emacs-devel@gnu.org
Subject: Searching in the minibuffer (was: wrapper fn for message and minibuffer-message?)
Date: Mon, 17 Oct 2005 11:04:44 +0300	[thread overview]
Message-ID: <87fyr0k2ry.fsf_-_@jurta.org> (raw)
In-Reply-To: <E1ER9gy-0006iq-2I@fencepost.gnu.org> (Richard M. Stallman's message of "Sun, 16 Oct 2005 10:40:52 -0400")

>     Eval: (setq foo 'bar)
>
>     typing `C-s foo' will display:
>
>     Eval: (setq foo 'bar) [I-search backward: foo]
>
>     and `foo' will be highlighted in `isearch' face, as usual.
>
> I suggest that those who find this interesting try it out.

This doesn't work satisfactorily: temporarily displaying the search
prompt at the end of the minibuffer causes too long delay after typing
C-s and before point moves to the next occurrence of the search string.

Instead of that, I propose a different solution:

1. not to display the search prompt while searching in the minibuffer
at all, because the search string is highlighted in the minibuffer anyway.
Thus the search prompt will not obscure the minibuffer text, and users
will be provided with visual feedback about the place the search reached.

2. to display the search prompt for 2 sec only when it contains
error messages.

Index: lisp/isearch.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.275
diff -c -r1.275 isearch.el
*** lisp/isearch.el	29 Sep 2005 22:55:53 -0000	1.275
--- lisp/isearch.el	17 Oct 2005 08:03:03 -0000
***************
*** 1926,1935 ****
                isearch-message)
  	    (isearch-message-suffix c-q-hack ellipsis)
  	    )))
!     (if c-q-hack
  	m
        (let ((message-log-max nil))
! 	(message "%s" m)))))
  
  (defun isearch-message-prefix (&optional c-q-hack ellipsis nonincremental)
    ;; If about to search, and previous search regexp was invalid,
--- 1934,1950 ----
                isearch-message)
  	    (isearch-message-suffix c-q-hack ellipsis)
  	    )))
!     (if (or c-q-hack
! 	    (and (minibufferp) isearch-success (not isearch-error)
! 		 (> (length isearch-string) 0)))
  	m
        (let ((message-log-max nil))
! 	(message "%s" m)
! 	(when (and (minibufferp) (not isearch-error))
! 	  (sit-for (or isearch-original-minibuffer-message-timeout
! 		       minibuffer-message-timeout
! 		       2))
! 	  (message ""))))))
  
  (defun isearch-message-prefix (&optional c-q-hack ellipsis nonincremental)
    ;; If about to search, and previous search regexp was invalid,

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2005-10-17  8:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-04 21:58 wrapper fn for message and minibuffer-message? Drew Adams
2005-10-05 15:53 ` Stefan Monnier
2005-10-05 16:23   ` Drew Adams
2005-10-06  5:28   ` Richard M. Stallman
2005-10-06 15:52     ` Drew Adams
2005-10-07  3:04       ` Richard M. Stallman
2005-10-07 22:29         ` Drew Adams
2005-10-09 18:16           ` Richard M. Stallman
2005-10-09 21:25             ` Drew Adams
2005-10-10 18:06               ` Richard M. Stallman
2005-10-10 19:52               ` Drew Adams
2005-10-15 13:08                 ` Juri Linkov
2005-10-15 14:39                   ` Drew Adams
2005-10-15 14:57                     ` Juri Linkov
2005-10-16 14:40                   ` Richard M. Stallman
2005-10-17  8:04                     ` Juri Linkov [this message]
2005-10-17 21:57                       ` Searching in the minibuffer (was: wrapper fn for message and minibuffer-message?) Richard M. Stallman
2005-10-18  8:05                         ` Searching in the minibuffer Juri Linkov
2005-10-19  2:43                           ` Richard M. Stallman
2005-10-19 15:55                             ` Juri Linkov
2005-10-20  4:54                               ` Richard M. Stallman
2005-10-21 15:38                                 ` Juri Linkov
2005-10-21 22:19                                   ` Richard M. Stallman
2005-10-21 22:30                                     ` Drew Adams

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=87fyr0k2ry.fsf_-_@jurta.org \
    --to=juri@jurta.org \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@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.