From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: Re: Bug/Patch view.el Date: Sat, 22 Sep 2007 14:39:59 -0400 Message-ID: <69tzpmsfwg.fsf@fencepost.gnu.org> References: <1t8x7bfyoe.fsf@totally-fudged-out-message-id> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1190486457 24789 80.91.229.12 (22 Sep 2007 18:40:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 22 Sep 2007 18:40:57 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Jonathan Goldblatt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 22 20:40:51 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IZ9uM-0000Bc-Nq for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Sep 2007 20:40:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZ9uK-0000HX-EB for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Sep 2007 14:40:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IZ9uD-0000Dn-1a for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2007 14:40:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IZ9uB-0000Cg-4S for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2007 14:40:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZ9uA-0000CX-PR for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2007 14:40:38 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IZ9u9-00027t-OL for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2007 14:40:38 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IZ9tX-0001TN-HX; Sat, 22 Sep 2007 14:39:59 -0400 X-Spook: Honduras AVN CISU Watergate Ft. Meade clones InfoSec X-Ran: :/cfvD%zyolWZIXp=,=H>O(&'s%gKu%ufCt9WU3`P.!4'PpMI\[Q^ra+*f.V%@MM]5!NlP X-Hue: yellow X-Attribution: GM In-Reply-To: <1t8x7bfyoe.fsf@totally-fudged-out-message-id> (Jonathan Goldblatt's message of "(unknown date)") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16595 Archived-At: Jonathan Goldblatt wrote: > Here is a little test script that demonstrates some problems in > view-search-no-match-lines followed by a patch to replace it. Thanks for the detailed report. Can't your version be simplified as follows? I gave up trying to understand the original. (defun view-search-no-match-lines (times regexp) (let ((fwd-one (if (< times 0) -1 1))) (setq times (abs times)) (while (and (> times 0) (zerop (forward-line fwd-one))) (if (eobp) (setq times -1) (or (re-search-forward regexp (line-end-position) t) (setq times (1- times))))) (and (zerop times) (looking-at "^.*$"))))