all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#33475: [Wish list]: Display line and column numbers in warnings with `compile-defun'
@ 2018-11-23 17:58 Alan Mackenzie
  2018-11-27  7:15 ` Alan Mackenzie
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Mackenzie @ 2018-11-23 17:58 UTC (permalink / raw)
  To: 33475

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).





^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-28 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-23 17:58 bug#33475: [Wish list]: Display line and column numbers in warnings with `compile-defun' Alan Mackenzie
2018-11-27  7:15 ` Alan Mackenzie
2018-11-28 13:34   ` Alan Mackenzie

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.