From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 23.0.60; isearch for M-: incorrect in Info Date: Mon, 21 Apr 2008 02:54:15 +0300 Organization: JURTA Message-ID: <87prskummg.fsf@jurta.org> References: <000801c89dc4$bf3a9ee0$0200a8c0@us.oracle.com> <874pa2278i.fsf@jurta.org> <003301c89f50$35b7d7e0$0200a8c0@us.oracle.com> <87wsmwkrr9.fsf@jurta.org> <87fxth7f34.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1208736571 15419 80.91.229.12 (21 Apr 2008 00:09:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Apr 2008 00:09:31 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 21 02:10:05 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jnjbf-00073U-7V for ged-emacs-devel@m.gmane.org; Mon, 21 Apr 2008 02:10:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jnjaz-0000id-Tf for ged-emacs-devel@m.gmane.org; Sun, 20 Apr 2008 20:09:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JnjZj-0008Qa-9B for emacs-devel@gnu.org; Sun, 20 Apr 2008 20:08:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JnjZi-0008Q8-Rp for emacs-devel@gnu.org; Sun, 20 Apr 2008 20:08:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JnjZi-0008Pv-Au for emacs-devel@gnu.org; Sun, 20 Apr 2008 20:08:02 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JnjZi-00050M-2A for emacs-devel@gnu.org; Sun, 20 Apr 2008 20:08:02 -0400 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JnjZh-0002T8-Cv for emacs-pretest-bug@gnu.org; Sun, 20 Apr 2008 20:08:01 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JnjZc-0004zW-SN for emacs-pretest-bug@gnu.org; Sun, 20 Apr 2008 20:08:01 -0400 Original-Received: from relay03.kiev.sovam.com ([62.64.120.201]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JnjZc-0004ym-8R for emacs-pretest-bug@gnu.org; Sun, 20 Apr 2008 20:07:56 -0400 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JnjZY-0002Ey-4T; Mon, 21 Apr 2008 03:07:52 +0300 In-Reply-To: (Stefan Monnier's message of "Sat, 19 Apr 2008 22:48:36 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: 63e2ad49ecdb9688bd8f281dc7b291dd X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2676 [Apr 18 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 10 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:95568 gmane.emacs.pretest.bugs:22093 Archived-At: >> + (defvar isearch-success-function nil > [...] >> ! (if isearch-success-function >> ! (funcall isearch-success-function >> ! (match-beginning 0) (match-end 0)) >> ! (or (eq search-invisible t) >> ! (not (isearch-range-invisible >> ! (match-beginning 0) (match-end 0)))))) > > Better just call isearch-success-function unconditionally and move the > default code to the default value of isearch-success-function. > > I understand that may require many more changes to your code, tho, but > I think it's important to always make when you introduce such > a foo-function variable to make sure that it is possible to reproduce > the default value (since it's often desirable to do almost the same as > the default). I can't invent a good name for the default function that describes exactly what it does, so I named it simply `isearch-success-function-default'. I've seen this naming convention in other places too. Index: lisp/isearch.el =================================================================== RCS file: /sources/emacs/emacs/lisp/isearch.el,v retrieving revision 1.316 diff -c -r1.316 isearch.el *** lisp/isearch.el 18 Apr 2008 10:29:23 -0000 1.316 --- lisp/isearch.el 20 Apr 2008 23:51:28 -0000 *************** *** 178,183 **** --- 178,188 ---- "Function to save a function restoring the mode-specific isearch state to the search status stack.") + (defvar isearch-success-function 'isearch-success-function-default + "Function to report whether the new search match is considered successful. + The function has two arguments: the positions of start and end of text + matched by search.") + ;; Search ring. (defvar search-ring nil *************** *** 2104,2110 **** (setq isearch-case-fold-search (isearch-no-upper-case-p isearch-string isearch-regexp))) (condition-case lossage ! (let ((inhibit-point-motion-hooks search-invisible) (inhibit-quit nil) (case-fold-search isearch-case-fold-search) (search-spaces-regexp search-whitespace-regexp) --- 2174,2182 ---- (setq isearch-case-fold-search (isearch-no-upper-case-p isearch-string isearch-regexp))) (condition-case lossage ! (let ((inhibit-point-motion-hooks ! (and (eq isearch-success-function 'isearch-success-function-default) ! search-invisible)) (inhibit-quit nil) (case-fold-search isearch-case-fold-search) (search-spaces-regexp search-whitespace-regexp) *************** *** 2115,2126 **** (isearch-search-string isearch-string nil t)) ;; Clear RETRY unless we matched some invisible text ;; and we aren't supposed to do that. ! (if (or (eq search-invisible t) ! (not isearch-success) (bobp) (eobp) (= (match-beginning 0) (match-end 0)) ! (not (isearch-range-invisible ! (match-beginning 0) (match-end 0)))) (setq retry nil))) (setq isearch-just-started nil) (if isearch-success --- 2187,2197 ---- (isearch-search-string isearch-string nil t)) ;; Clear RETRY unless we matched some invisible text ;; and we aren't supposed to do that. ! (if (or (not isearch-success) (bobp) (eobp) (= (match-beginning 0) (match-end 0)) ! (funcall isearch-success-function ! (match-beginning 0) (match-end 0))) (setq retry nil))) (setq isearch-just-started nil) (if isearch-success *************** *** 2298,2303 **** --- 2369,2381 ---- nil) (setq isearch-hidden t))))))) + (defun isearch-success-function-default (beg end) + "Default function to report if the new search match is successful. + Returns t if search can match hidden text, or otherwise checks if some + text from BEG to END is visible." + (or (eq search-invisible t) + (not (isearch-range-invisible beg end)))) + ;; General utilities -- Juri Linkov http://www.jurta.org/emacs/