[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug/Patch view.el

From: Glenn Morris
Subject: Re: Bug/Patch view.el
Date: Sat, 22 Sep 2007 14:39:59 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

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 "^.*$"))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]