emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#33475: closed ([Wish list]: Display line and colum


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#33475: closed ([Wish list]: Display line and column numbers in warnings with `compile-defun')
Date: Wed, 28 Nov 2018 13:38:01 +0000

Your message dated Wed, 28 Nov 2018 13:34:12 +0000
with message-id <address@hidden>
and subject line Re: bug#33475: [Wish list]: Display line and column numbers in 
warnings with `compile-defun'
has caused the debbugs.gnu.org bug report #33475,
regarding [Wish list]: Display line and column numbers in warnings with 
`compile-defun'
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
33475: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33475
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [Wish list]: Display line and column numbers in warnings with `compile-defun' Date: Fri, 23 Nov 2018 17:58:39 +0000 User-agent: Mutt/1.10.1 (2018-07-13)
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).



--- End Message ---
--- Begin Message --- Subject: Re: bug#33475: [Wish list]: Display line and column numbers in warnings with `compile-defun' Date: Wed, 28 Nov 2018 13:34:12 +0000 User-agent: Mutt/1.10.1 (2018-07-13)
On Tue, Nov 27, 2018 at 07:15:31 +0000, Alan Mackenzie wrote:
> On Fri, Nov 23, 2018 at 17:58:39 +0000, Alan Mackenzie wrote:
> > 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:

> [ .... ]

> This patch was all very well, but was incomplete: hitting CR on such a
> warning message in *Compile-Log* failed to move to the position in the
> .el buffer, instead spuriously prompting for a file.

> The following patch, incorporating the patch from my original post,
> fixes this by amending compile.el to handle buffers as an alternative to
> file names, creating emacs-lisp-compilation-mode, which extracts the
> buffer from one of these warning messages, and calling this new mode
> from byte-compile-log-file in place of compilation-mode.

Committed to the master branch.

Closing the bug.

-- 
Alan Mackenzie (Nuremberg, Germany).


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]