From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#18131: 24.4.50; View-search-... skips all matches between (point) and edge of window Date: Mon, 28 Jul 2014 11:06:59 -0700 Message-ID: <878undtl18.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1406570908 20245 80.91.229.3 (28 Jul 2014 18:08:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jul 2014 18:08:28 +0000 (UTC) To: 18131@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 28 20:08:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XBpLP-0003he-27 for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Jul 2014 20:08:19 +0200 Original-Received: from localhost ([::1]:41719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBpLO-0003u5-Dl for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Jul 2014 14:08:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBpLF-0003sq-3v for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 14:08:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBpL8-0004he-Fg for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 14:08:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBpL8-0004hZ-Cf for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 14:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XBpL7-0001fh-QN for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 14:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Jul 2014 18:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18131 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14065708586384 (code B ref -1); Mon, 28 Jul 2014 18:08:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Jul 2014 18:07:38 +0000 Original-Received: from localhost ([127.0.0.1]:41173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBpKg-0001eq-Jp for submit@debbugs.gnu.org; Mon, 28 Jul 2014 14:07:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40463) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBpKZ-0001eO-Rt for submit@debbugs.gnu.org; Mon, 28 Jul 2014 14:07:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBpKN-0004V5-Ty for submit@debbugs.gnu.org; Mon, 28 Jul 2014 14:07:22 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:56774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBpKN-0004Ul-QW for submit@debbugs.gnu.org; Mon, 28 Jul 2014 14:07:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBpKH-0003pl-BB for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 14:07:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBpKA-0004QD-M5 for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 14:07:09 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:49092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBpKA-0004Pu-Hg for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 14:07:02 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by gateway1.nyi.internal (Postfix) with ESMTP id 4C44E219ED for ; Mon, 28 Jul 2014 14:07:01 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 28 Jul 2014 14:07:01 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= mesmtp; bh=K/wSdBowgYKKiHcu11gc/Nd3PFQ=; b=Xj/RXOTOZP4Jd463aCx/M dalLX78ITqXOGr3cXdCTl00Tq4+wtldsW3vv+SSOZmLwg4Rt3QctNWAqMs688ull Bjhxonpe6Fhn2Q83xX2fnRlBIw6zLxBZoZKM7+po12bMCWFmzz/nGtDHV7Nq2C9q 9x+UZlhamVKNZi7TteHY8o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :mime-version:content-type; s=smtpout; bh=K/wSdBowgYKKiHcu11gc/N d3PFQ=; b=ke2IzhhmluAVzPckxSXuioCGwikZ6hZJZRCG4pUAhxanHJYE6u/KRN naji9pShce2ZzpxX9DrKHSWMiamKEuNfiK5QYSVHi7m4YYizrvyFzpUR8XK7M3LP FxUq2GaKjagjNR10/81u5wDuTmGRmVZlBU5/M/BzY0yIA+NLpHjDI= X-Sasl-enc: pssqh8FgjW8jsOt+ZLZQvJAAarU1TwrLEW3S8MTSHlfn 1406570821 Original-Received: from shorty.local (unknown [23.243.199.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E41AC00005 for ; Mon, 28 Jul 2014 14:07:01 -0400 (EDT) Original-Received: from ip6-localhost ([::1] helo=shorty.local) by shorty.local with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XBpK7-00013C-T9 for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 11:06:59 -0700 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91894 Archived-At: --=-=-= Content-Type: text/plain Hi. The emacs view-mode has navigation with 'n' and 'p' keys to navigate by searching (like isearch, but with fewer keystrokes and very similar to less and vi). I just discovered that unlike less and vi, this view-mode navigation doesn't hit all the matches, but rather skips the ones between (point) and the edge of the window. This ensures that any matches that are visible by the user (but not highlighted by view-mode) are skipped. This clearly was a design choice, rather than a bug. However, the documentation doesn't mention this, and I think it is counterintuitive. Attaching a very simple patch to fix. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-View-search-.-now-hit-all-the-matches-regardless-of-.patch >From ed227e61fe92c54c18542455448ed7f28d0c9e77 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Mon, 28 Jul 2014 11:05:00 -0700 Subject: [PATCH] View-search-... now hit all the matches, regardless of window position Prior to this patch anything between (point) and the edge of the window was skipped. This was counterintuitive (not what less or vim do) and was not mentioned in the documentation --- lisp/view.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/view.el b/lisp/view.el index 9f914b0..498a434 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -960,7 +960,7 @@ for highlighting the match that is found." (t (error "No previous View-mode search"))) (save-excursion (if end (goto-char (if (< times 0) (point-max) (point-min))) - (move-to-window-line (if (< times 0) 0 -1))) + (forward-char (if (< times 0) -1 1))) (if (if no (view-search-no-match-lines times regexp) (re-search-forward regexp nil t times)) (setq where (point)))) -- 2.0.0 --=-=-=--