GNU bug report logs -
#9679
24.0.90; After rgrep, next-error goes to the wrong line
Previous Next
Reported by: Ari Roponen <ari.roponen <at> gmail.com>
Date: Thu, 6 Oct 2011 06:15:02 UTC
Severity: important
Found in version 24.0.90
Done: Chong Yidong <cyd <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Sometimes next-error goes to the wrong line when stepping through rgrep
matches.
Using git bisect and the code below, I found the commit that causes the
problem (rev 105677). Reverting that (and before that a commit that
depended on it) makes the problem disappear.
rev 105685: (grep-regexp-alist): Move dangling comment to the previous rule.
rev 105677: progmodes/grep.el (grep-regexp-alist): Calculate column positions
I used the following test case to find the problematic commit. It
creates a file with two lines matching "mapcar" and then rgreps for it.
After that it calls next-error two times. The second call goes into the
line starting with " (list 'face ...".
^- here
--- code begins ----
(let ((dir (expand-file-name
(format "tmp%d" (emacs-pid))
temporary-file-directory)))
(ignore-errors (make-directory dir))
(with-temp-file (expand-file-name "test.el" dir)
(insert
"(defun my-diary-lib--date-to-string (date)
(destructuring-bind (month day year)
(mapcar 'number-to-string date)
(concat day \".\" month \".\" year)))
\(defun my-diary-lib--string-to-date (datestr)
(destructuring-bind (day month year)
(mapcar #'string-to-number (split-string datestr \"\\\\.\"))
(list month day year)))
\(defun my-diary-lib-add-dayname (datestr)
(list 'face 'font-lock-comment-face
'display (concat datestr \" \" (calendar-day-name
(my-diary-lib--string-to-date datestr)))))
"))
(grep-compute-defaults)
(rgrep "mapcar" "test.el" dir)
(run-with-idle-timer 0.5 nil #'next-error 1)
(run-with-idle-timer 1.0 nil #'next-error 1))
--- code ends ---
In GNU Emacs 24.0.90.7 (x86_64-unknown-linux-gnu, GTK+ Version 3.2.0)
of 2011-10-06 on arirop
Windowing system distributor `Fedora Project', version 11.0.11000000
configured using `configure '--with-x-toolkit=gtk3''
--
Ari Roponen
This bug report was last modified 13 years and 10 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.