From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Patch that adds help to isearch Date: Sun, 27 Nov 2005 23:53:38 +0100 Message-ID: <438A38F2.5010409@student.lu.se> References: <4386466E.4090407@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000506040808010100060803" X-Trace: sea.gmane.org 1133132074 19421 80.91.229.2 (27 Nov 2005 22:54:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 27 Nov 2005 22:54:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 27 23:54:31 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EgVP7-0000jr-OH for ged-emacs-devel@m.gmane.org; Sun, 27 Nov 2005 23:53:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgVP7-0002st-1b for ged-emacs-devel@m.gmane.org; Sun, 27 Nov 2005 17:53:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EgVOw-0002se-MM for emacs-devel@gnu.org; Sun, 27 Nov 2005 17:53:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EgVOw-0002sM-01 for emacs-devel@gnu.org; Sun, 27 Nov 2005 17:53:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgVOv-0002sJ-SK for emacs-devel@gnu.org; Sun, 27 Nov 2005 17:53:41 -0500 Original-Received: from [81.228.11.98] (helo=pne-smtpout1-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EgVOu-0000XM-FH; Sun, 27 Nov 2005 17:53:40 -0500 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn1.fre.skanova.net (7.2.060.1) id 43871614000BF2A6; Sun, 27 Nov 2005 23:53:39 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: rms@gnu.org In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:46671 Archived-At: This is a multi-part message in MIME format. --------------000506040808010100060803 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Richard M. Stallman wrote: > Some months ago we discussed help for isearch-forward/backward. I tried > several alternatives at that time, but did not send in any patch. The > attached patch is a simple way to give help. It simply defines C-h and > f1 to call isearch-mode-help > >I don't want to make such a change now, and perhaps not ever. Too >many control characters are special already in isearch. (I turned off >one of them a couple of months ago.) > > I read in the code ;; Turned off because I find I expect to get the global definition--rms. ;; ;; Instead bind C-h to special help command for isearch-mode. ;; (define-key map "\C-h" 'isearch-mode-help) I started working on that some months ago but gave up. It was rather complicated to stay in isearch-mode and do this and take care of different window configurations etc. I thought it was not worth the trouble and in the case of isearch-mode I also found it more helpful with the isearch-mode-help. The change I proposed is simple and I do not beleive it will be any problem to remove it later if we decide so. However for all Emacs users that do not know the details of isearch-mode (like myself) I think it is very useful. Some keys are however used: 1) The help keys (C-h and f1). This of course blocks the global definition, but is this a problem here? 2) Scroll other window up or down. Keys bound to those keys are used for scrolling the help window, but only if the other window is displaying the help buffer. I do not want to argue but I want to be clear. > I also found some small errors which I tried to correct. This was > something with the isearch-ring but I can not remember the details right > now. I included that also in the patch however. > >Can you please separate those bug fixes out >and explain the bugs they fix? > > I looked at my old bug fixes but these are some months old. What I wanted to fix was the history handling for isearch edit. My old fix did not work any more so I have made a new one which I attach. This does a few things: 1) M-p shows the last used value saved in the history list for isearch (called `search-ring') when entering minibuff editing. 2) M-n shows an empty string in this case. 3) The default for editing is just the empty string, not the first string in the history list like now. I might have misunderstood something here, so please test. I believe there was a typo too. A lonely (quit ...). > I renamed search-ring-update to isearch-ring-update which seems more > consistent. Maybe that should not be done if that breaks something? > >I don't want to change these names now. > > Ok. Could the isearch-mode-help be changed a bit instead? Currently it tells you to do M-x apropos RET, search-.* RET That gives a lot of unwanted hits. I suggest to give a hint to use M-x customize-group RET, isearch RET instead. > BTW I think there may be some useful key definitions missing in the > help. Could you for example not switch the direction with C-r? Should > not that be added to the help? > >Could you be more specific about the change you mean? > > Sorry, my mistake. It is actually the second time I do this I remember now. I did not find C-r in the help text because is it not in the left margin, but it is there. --------------000506040808010100060803 Content-Type: text/plain; name="isearch-hist.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="isearch-hist.diff" Index: isearch.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v retrieving revision 1.276 diff -c -r1.276 isearch.el *** isearch.el 24 Nov 2005 09:59:11 -0000 1.276 --- isearch.el 27 Nov 2005 22:28:09 -0000 *************** *** 1035,1041 **** (isearch-message-prefix nil nil isearch-nonincremental) isearch-string minibuffer-local-isearch-map nil ! (if isearch-regexp 'regexp-search-ring 'search-ring) nil t) isearch-new-message (mapconcat 'isearch-text-char-description --- 1035,1043 ---- (isearch-message-prefix nil nil isearch-nonincremental) isearch-string minibuffer-local-isearch-map nil ! (cons ! (if isearch-regexp 'regexp-search-ring 'search-ring) ! 1) nil t) isearch-new-message (mapconcat 'isearch-text-char-description *************** *** 1054,1068 **** isearch-word isearch-new-word)) ;; Empty isearch-string means use default. ! (if (= 0 (length isearch-string)) ! (setq isearch-string (or (car (if isearch-regexp ! regexp-search-ring ! search-ring)) ! "") ! ! isearch-message ! (mapconcat 'isearch-text-char-description ! isearch-string "")) ;; This used to set the last search string, ;; but I think it is not right to do that here. ;; Only the string actually used should be saved. --- 1056,1071 ---- isearch-word isearch-new-word)) ;; Empty isearch-string means use default. ! ;; Why should it mean default? ! ;; (if (= 0 (length isearch-string)) ! ;; (setq isearch-string (or (car (if isearch-regexp ! ;; regexp-search-ring ! ;; search-ring)) ! ;; "") ! ! ;; isearch-message ! ;; (mapconcat 'isearch-text-char-description ! ;; isearch-string "")) ;; This used to set the last search string, ;; but I think it is not right to do that here. ;; Only the string actually used should be saved. *************** *** 1081,1091 **** ;; The search done message is confusing when the string ;; is empty, so erase it. (if (equal isearch-string "") ! (message ""))))) ! (quit ; handle abort-recursive-edit ! (isearch-abort) ;; outside of let to restore outside global values ! ))) (defun isearch-nonincremental-exit-minibuffer () (interactive) --- 1084,1094 ---- ;; The search done message is confusing when the string ;; is empty, so erase it. (if (equal isearch-string "") ! (message "")))) ! (quit ; handle abort-recursive-edit ! (isearch-abort) ;; outside of let to restore outside global values ! )))) (defun isearch-nonincremental-exit-minibuffer () (interactive) *************** *** 1833,1842 **** () (set yank-pointer-name (setq yank-pointer ! (mod (+ (or yank-pointer 0) ! (if advance -1 1)) ! length))) ! (setq isearch-string (nth yank-pointer ring) isearch-message (mapconcat 'isearch-text-char-description isearch-string ""))))) --- 1836,1847 ---- () (set yank-pointer-name (setq yank-pointer ! (if yank-pointer ! (mod (+ yank-pointer ! (if advance -1 1)) ! length) ! (if advance -1 0)))) ! (setq isearch-string (if (< yank-pointer 0) "" (nth yank-pointer ring)) isearch-message (mapconcat 'isearch-text-char-description isearch-string ""))))) --------------000506040808010100060803 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------000506040808010100060803--