[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `C-s' `C-s' in Info should pick up search string from `s'
From: |
Juri Linkov |
Subject: |
Re: `C-s' `C-s' in Info should pick up search string from `s' |
Date: |
Wed, 23 Nov 2005 09:11:15 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
> Enhancement request (not a bug):
>
> Would you please hold off on enhancement requests?
> We need to focus on fixing bugs and making the release.
Incidentally, Drew's enhancement request helped me find a bug in isearch.
Typing `C-s C-s' without a previous isearch string leaves the current
buffer in isearch mode after signalling an error. This is especially
bad with non-nil `debug-on-error', because after quitting the debug
window, `isearch-mode' remains non-nil, but isearch keybindings are
cleared.
How should isearch correctly signal an error? I think it should use
the standard isearch mechanism for error reporting, i.e. to set
`isearch-error' to the error string which will show it in the isearch
message like:
I-search: [No previous search string]
and don't exit isearch mode, thus allowing the user to type a new
isearch string. The patch below implements this.
I also checked isearch.el for other places that use the function
`error' which would cause a similar problem, but didn't find any.
There was only one such problematic place.
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 23 Nov 2005 07:09:36 -0000
***************
*** 1138,1152 ****
;; C-s in forward or C-r in reverse.
(if (equal isearch-string "")
;; If search string is empty, use last one.
! (setq isearch-string
! (or (if isearch-regexp
! (car regexp-search-ring)
! (car search-ring))
! (error "No previous search string"))
! isearch-message
! (mapconcat 'isearch-text-char-description
! isearch-string "")
! isearch-case-fold-search isearch-last-case-fold-search)
;; If already have what to search for, repeat it.
(or isearch-success
(progn
--- 1150,1165 ----
;; C-s in forward or C-r in reverse.
(if (equal isearch-string "")
;; If search string is empty, use last one.
! (if (null (if isearch-regexp regexp-search-ring search-ring))
! (setq isearch-error "No previous search string")
! (setq isearch-string
! (if isearch-regexp
! (car regexp-search-ring)
! (car search-ring))
! isearch-message
! (mapconcat 'isearch-text-char-description
! isearch-string "")
! isearch-case-fold-search isearch-last-case-fold-search))
;; If already have what to search for, repeat it.
(or isearch-success
(progn
--
Juri Linkov
http://www.jurta.org/emacs/