GNU bug report logs -
#13549
24.3.50; FR: Improve grep output (show function names, when possible)
Previous Next
Reported by: Jambunathan K <kjambunathan <at> gmail.com>
Date: Fri, 25 Jan 2013 14:59:02 UTC
Severity: wishlist
Found in version 24.3.50
Done: Juri Linkov <juri <at> jurta.org>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 13549 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Jambunathan K <kjambunathan <at> gmail.com> writes:
> I used the following local modification to compile.el to sneak in the
> function names.
>
> The modification is in `compilation-parse-errors' which seems to be a
> font-lock handler. I call `which-function' within this context. Is it
> justified?
>
> (WARNING: Quick and Dirty work)
> (Bzr version: revno: 111597)
I attached the wrong diff (but the right screenshot). I am attaching
the "right" diff, more for archival purposes.
Here is the diff that needs to be used. Earlier diff was "totally
broken" in that it missed:
1. `string-to-number' on line numbers.
2. Goto beginning of buffer, before `forward-line'.
The changes still need a `save-excursion', though. For experimental
code, it shouldn't matter much.
[Message part 2 (text/plain, inline)]
=== modified file 'lisp/progmodes/compile.el'
--- lisp/progmodes/compile.el 2013-02-02 08:41:02 +0000
+++ lisp/progmodes/compile.el 2013-02-03 13:35:20 +0000
@@ -1318,6 +1318,24 @@ to `compilation-error-regexp-alist' if R
file line end-line col end-col (or type 2) fmt))
(when (integerp file)
+ (when (integerp line)
+ (let* ((file-name (match-string file))
+ (line-no (string-to-number (match-string line)))
+ (which-fn
+ (save-match-data
+ (with-current-buffer
+ (find-file-noselect file-name)
+ (goto-char (point-min))
+ (forward-line (1- line-no))
+ (which-function)))))
+ (overlay-put
+ (make-overlay (match-end file) (match-end file)
+ (current-buffer) t t)
+ 'after-string
+ (format "(%s)"
+ (propertize (or which-fn "global")
+ 'face 'cscope-function-face)))))
+
(compilation--put-prop
file 'font-lock-face
(if (consp type)
[Message part 3 (text/plain, inline)]
--
This bug report was last modified 11 years and 360 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.