GNU bug report logs - #76167
31.0.50; view-mode un-expected jump-overs

Previous Next

Package: emacs;

Reported by: Tomas Nordin <tomasn <at> posteo.net>

Date: Sun, 9 Feb 2025 22:10:01 UTC

Severity: normal

Tags: confirmed, patch

Found in version 31.0.50

Fixed in version 31.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tomas Nordin <tomasn <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; view-mode un-expected jump-overs
Date: Sun, 09 Feb 2025 22:09:42 +0000
[Message part 1 (text/plain, inline)]
Hello

View-mode has less like features like View-search-regexp-forward (/) and
View-search-last-regexp-forward (n). Using them I do some un-expected
observations. Here is a repro:

$ echo 1 word > words
$ echo 2 >> words
$ for n in $(seq 3 6); do echo $n word >> words; done
$ emacs -Q words
M-x view-mode
/ word
n                               ; until on line 6
p                               ; as far up as possible

The observation is that searching backwards jumps over every second
search hit when matches occur on consecutive lines.

Now do

/ !drow

And play with n and p. The bang tells to match every line that does
not match the regex. Again every second expected match is "jumped"
over. In this case also when searching forward. (Expected is that
every line is a search hit).

Maybe not many people use view-mode and it's less-like search
features, and so this was never complained about.

I find that the attached patch solves the problem. What do you think?

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2025-02-09 built on fliptop2
Repository revision: 7e60ceeccbca1b9f67297ad7e9f11fd498b28d4d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

[0001-Start-search-from-beginning-or-end-of-line.patch (text/x-diff, attachment)]

This bug report was last modified 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.