From: Alan Mackenzie <acm@muc.de>
To: 33475@debbugs.gnu.org
Subject: bug#33475: [Wish list]: Display line and column numbers in warnings with `compile-defun'
Date: Fri, 23 Nov 2018 17:58:39 +0000 [thread overview]
Message-ID: <20181123175839.GA14199@ACM> (raw)
Hello, Emacs.
At the moment, if a warning is displayed for a compilation started by
`compile-defun', it appears something like:
Warning: assignment to free variable `foo'
. This is all very well, but it lacks the line and column number of the
place of the warning, meaning one must search through the source and
guess where the warning is.
Why not output this information, much like is done in a batch
compilation? It would then look like:
Buffer winkler2.el:3:14:Warning: assignment to free variable `foo'
. This would save guessing and irritation.
Here is a patch which achieves this:
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 0b8f8824b4..d16d0d3f22 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1165,7 +1165,7 @@ byte-compile-log-file
(with-current-buffer (get-buffer-create byte-compile-log-buffer)
(goto-char (point-max))
(let* ((inhibit-read-only t)
- (dir (and byte-compile-current-file
+ (dir (and (stringp byte-compile-current-file)
(file-name-directory byte-compile-current-file)))
(was-same (equal default-directory dir))
pt)
@@ -1981,7 +1981,7 @@ compile-defun
(save-excursion
(end-of-defun)
(beginning-of-defun)
- (let* ((byte-compile-current-file nil)
+ (let* ((byte-compile-current-file (current-buffer))
(byte-compile-current-buffer (current-buffer))
(byte-compile-read-position (point))
(byte-compile-last-position byte-compile-read-position)
--
Alan Mackenzie (Nuremberg, Germany).
next reply other threads:[~2018-11-23 17:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-23 17:58 Alan Mackenzie [this message]
2018-11-27 7:15 ` bug#33475: [Wish list]: Display line and column numbers in warnings with `compile-defun' Alan Mackenzie
2018-11-28 13:34 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181123175839.GA14199@ACM \
--to=acm@muc.de \
--cc=33475@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).