GNU bug report logs -
#10239
compilation-auto-jump-to-first-error vs. giant binary executables
Previous Next
Reported by: jidanni <at> jidanni.org
Date: Tue, 6 Dec 2011 23:26:02 UTC
Severity: wishlist
Tags: fixed, patch
Merged with 15032,
16218,
25329,
28035,
32968,
35745
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10239 in the body.
You can then email your comments to 10239 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10239
; Package
emacs
.
(Tue, 06 Dec 2011 23:26:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
jidanni <at> jidanni.org
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 06 Dec 2011 23:26:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
$ cat Makefile
a:;set -Y
$ emacs -Q -eval '(setq compilation-auto-jump-to-first-error t)' -f compile
RET
/bin/sh: line 0: set: -Y: invalid option
Wham pow! We are looking at a whole megabyte of binary ELF /bin/sh executable.
I didn't try it on lager files or with ones with strings the colorizer
would try to color etc.
Forcibly Merged 10239 15032.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Tue, 06 Aug 2013 02:07:02 GMT)
Full text and
rfc822 format available.
Forcibly Merged 10239 15032 16218.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Wed, 22 Jan 2014 03:26:01 GMT)
Full text and
rfc822 format available.
Severity set to 'wishlist' from 'normal'
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Wed, 15 May 2019 15:35:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10239
; Package
emacs
.
(Sun, 29 Sep 2019 17:09:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 10239 <at> debbugs.gnu.org (full text, mbox):
jidanni <at> jidanni.org writes:
> $ cat Makefile
> a:;set -Y
> $ emacs -Q -eval '(setq compilation-auto-jump-to-first-error t)' -f compile
> RET
> /bin/sh: line 0: set: -Y: invalid option
> Wham pow! We are looking at a whole megabyte of binary ELF /bin/sh executable.
> I didn't try it on lager files or with ones with strings the colorizer
> would try to color etc.
The problem is that compilation mode interprets this
/bin/sh: 1: test: -gt: unexpected operator
as an error (which is right), but believes that this error originates in
/bin/sh, so when you jump to the first error in the buffer, you're
presented with /bin/sh in a buffer, which isn't very helpful.
In addition, it identifies this line:
make: *** [Makefile:1: a] Error 2
as another error, which is even more right, but it thinks that the file
name is "*** [Makefile", which is wrong.
So I took a whack at fixing both these things with a new mechanism that
allows transformation of detected file names (and ignoring them in the
case of /bin/sh).
Patch included below.
Does this seems like a good mechanism for doing this stuff?
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index d80fef3103..a29dc5cc47 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -58,6 +58,16 @@ compilation-window-height
:type '(choice (const :tag "Default" nil)
integer))
+(defcustom compilation-transform-file-match-alist
+ '(("/bin/[a-z]*sh\\'" nil)
+ ("\\*+ \\[\\(Makefile\\)" "\\1"))
+ "Alist of regexp/replacements to alter file names in compilation errors.
+If the replacement is nil, the file will not be considered an
+error after all. If not nil, it should be a regexp replacement
+string."
+ :type '(repeat (list regexp string))
+ :version "27.1")
+
(defvar compilation-filter-hook nil
"Hook run after `compilation-filter' has inserted a string into the buffer.
It is called with the variable `compilation-filter-start' bound
@@ -1155,19 +1165,36 @@ compilation-error-properties
(setq end-col (match-string-no-properties end-col))
(- (string-to-number end-col) -1)))
(and end-line -1)))
- (if (consp type) ; not a static type, check what it is.
+ (if (consp type) ; not a static type, check what it is.
(setq type (or (and (car type) (match-end (car type)) 1)
(and (cdr type) (match-end (cdr type)) 0)
2)))
-
- (when (and compilation-auto-jump-to-next
- (>= type compilation-skip-threshold))
- (kill-local-variable 'compilation-auto-jump-to-next)
- (run-with-timer 0 nil 'compilation-auto-jump
- (current-buffer) (match-beginning 0)))
-
- (compilation-internal-error-properties
- file line end-line col end-col type fmt)))
+ ;; Remove matches like /bin/sh and do other file name transforms.
+ (save-match-data
+ (let ((transformed nil))
+ (dolist (f file)
+ (let ((match
+ (cl-loop for (regexp replacement)
+ in compilation-transform-file-match-alist
+ when (string-match regexp f)
+ return (or replacement t))))
+ (cond ((not match)
+ (push f transformed))
+ ((stringp match)
+ (push (replace-match match nil nil f) transformed)))))
+ (setq file (nreverse transformed))))
+ (if (not file)
+ ;; If we ignored all the files with errors on this line, then
+ ;; return nil.
+ nil
+ (when (and compilation-auto-jump-to-next
+ (>= type compilation-skip-threshold))
+ (kill-local-variable 'compilation-auto-jump-to-next)
+ (run-with-timer 0 nil 'compilation-auto-jump
+ (current-buffer) (match-beginning 0)))
+
+ (compilation-internal-error-properties
+ file line end-line col end-col type fmt))))
(defun compilation-beginning-of-line (&optional n)
"Like `beginning-of-line', but accounts for lines hidden by `selective-display'."
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) patch.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 29 Sep 2019 17:09:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10239
; Package
emacs
.
(Sun, 29 Sep 2019 17:31:01 GMT)
Full text and
rfc822 format available.
Message #27 received at 10239 <at> debbugs.gnu.org (full text, mbox):
>>>>> "LI" == Lars Ingebrigtsen <larsi <at> gnus.org> writes:
LI> Patch included below.
LI> Does this seems like a good mechanism for doing this stuff?
I bet it will. Thanks for fixing it!
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10239
; Package
emacs
.
(Sun, 29 Sep 2019 17:44:02 GMT)
Full text and
rfc822 format available.
Message #30 received at 10239 <at> debbugs.gnu.org (full text, mbox):
On Sep 29 2019, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
> index d80fef3103..a29dc5cc47 100644
> --- a/lisp/progmodes/compile.el
> +++ b/lisp/progmodes/compile.el
> @@ -58,6 +58,16 @@ compilation-window-height
> :type '(choice (const :tag "Default" nil)
> integer))
>
> +(defcustom compilation-transform-file-match-alist
> + '(("/bin/[a-z]*sh\\'" nil)
> + ("\\*+ \\[\\(Makefile\\)" "\\1"))
That doesn't make sense. "Makefile" can be anything.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10239
; Package
emacs
.
(Sun, 29 Sep 2019 18:49:02 GMT)
Full text and
rfc822 format available.
Message #33 received at 10239 <at> debbugs.gnu.org (full text, mbox):
Andreas Schwab <schwab <at> linux-m68k.org> writes:
>> +(defcustom compilation-transform-file-match-alist
>> + '(("/bin/[a-z]*sh\\'" nil)
>> + ("\\*+ \\[\\(Makefile\\)" "\\1"))
>
> That doesn't make sense. "Makefile" can be anything.
I wanted to be conservative when introducing the feature. If we decide
to add this feature, the regexps will evolve over the years.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10239
; Package
emacs
.
(Wed, 09 Oct 2019 23:21:02 GMT)
Full text and
rfc822 format available.
Message #36 received at 10239 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Andreas Schwab <schwab <at> linux-m68k.org> writes:
>
>>> +(defcustom compilation-transform-file-match-alist
>>> + '(("/bin/[a-z]*sh\\'" nil)
>>> + ("\\*+ \\[\\(Makefile\\)" "\\1"))
>>
>> That doesn't make sense. "Makefile" can be anything.
>
> I wanted to be conservative when introducing the feature. If we decide
> to add this feature, the regexps will evolve over the years.
There weren't any other comments, so I've now applied the patch and I'm
closing this bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 09 Oct 2019 23:21:06 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 27.1, send any further explanations to
35745 <at> debbugs.gnu.org and 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 09 Oct 2019 23:21:07 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10239
; Package
emacs
.
(Thu, 10 Oct 2019 08:33:01 GMT)
Full text and
rfc822 format available.
Message #43 received at 10239 <at> debbugs.gnu.org (full text, mbox):
On Okt 10 2019, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Andreas Schwab <schwab <at> linux-m68k.org> writes:
>>
>>>> +(defcustom compilation-transform-file-match-alist
>>>> + '(("/bin/[a-z]*sh\\'" nil)
>>>> + ("\\*+ \\[\\(Makefile\\)" "\\1"))
>>>
>>> That doesn't make sense. "Makefile" can be anything.
>>
>> I wanted to be conservative when introducing the feature. If we decide
>> to add this feature, the regexps will evolve over the years.
>
> There weren't any other comments, so I've now applied the patch and I'm
> closing this bug report.
This has been obsoleted by Pauls patch.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 07 Nov 2019 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 165 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.