From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.bugs Subject: bug#13549: 24.3.50; FR: Improve grep output (show function names, when possible) Date: Sun, 03 Feb 2013 19:19:05 +0530 Message-ID: <87zjzlh5im.fsf@gmail.com> References: <87a9rxux7q.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1359899410 12543 80.91.229.3 (3 Feb 2013 13:50:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Feb 2013 13:50:10 +0000 (UTC) To: 13549@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 03 14:50:30 2013 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 1U1zxm-0007HH-4z for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Feb 2013 14:50:30 +0100 Original-Received: from localhost ([::1]:50221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1zxT-00051N-N9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Feb 2013 08:50:11 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1zxN-0004xM-Mq for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 08:50:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1zxM-0002rs-Cw for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 08:50:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1zxM-0002r1-7H for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 08:50:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U1zyI-0000OU-Ol for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 08:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jambunathan K Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Feb 2013 13:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13549 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13549-submit@debbugs.gnu.org id=B13549.13598994251469 (code B ref 13549); Sun, 03 Feb 2013 13:51:02 +0000 Original-Received: (at 13549) by debbugs.gnu.org; 3 Feb 2013 13:50:25 +0000 Original-Received: from localhost ([127.0.0.1]:33764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1zxg-0000Ne-Iq for submit@debbugs.gnu.org; Sun, 03 Feb 2013 08:50:24 -0500 Original-Received: from mail-pa0-f43.google.com ([209.85.220.43]:65107) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1zxe-0000NS-0B for 13549@debbugs.gnu.org; Sun, 03 Feb 2013 08:50:23 -0500 Original-Received: by mail-pa0-f43.google.com with SMTP id bh2so653423pad.30 for <13549@debbugs.gnu.org>; Sun, 03 Feb 2013 05:49:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=uHGs6vTeSA9TxqFqNtVvhqAm90IqBiNEeSd5xl/gBS4=; b=qr5uWvn99gUC+Z7xJr5/y+6Awo/9bN8L2xzqD0rEVCLZzvDhiJD5udvd6hgJ33mY6D 1LWcjuySlKxbj8WXBFS2HZo+39Gt26r+BzlMyYJAwtMvzmvUenSj6WKKotwA/jk8hbUE ONP6iXa0Mj1GtP6uDybDL+4qzN3ZDaqTF+NGZsaTZsFQ2OwaeDXqEFiQ+6ZREbCXRcdK 6JNonGdStzjWWNXych0RayW+th/34r0dosfa2JRqwUnMVG4qN5A/TWXiNut8NdFnyuW/ K8gCDp36Cj6MyfsObeUZnrgYulNP7oVWi4TQ+IaPsROnXSBXiKpGlxACbGCHKXvC2/oS /QxA== X-Received: by 10.66.81.166 with SMTP id b6mr44219152pay.7.1359899361746; Sun, 03 Feb 2013 05:49:21 -0800 (PST) Original-Received: from debian-6.05 ([101.63.246.134]) by mx.google.com with ESMTPS id o5sm15749623pay.5.2013.02.03.05.49.18 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Sun, 03 Feb 2013 05:49:20 -0800 (PST) In-Reply-To: <87a9rxux7q.fsf@gmail.com> (Jambunathan K.'s message of "Fri, 25 Jan 2013 20:27:29 +0530") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:70642 Archived-At: --=-=-= Content-Type: text/plain Jambunathan K 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. --=-=-= Content-Type: text/plain Content-Disposition: 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) --=-=-= Content-Type: text/plain -- --=-=-=--