* bug#416: flymake highlights errors from wrong file
@ 2008-08-18 19:21 Chong Yidong
0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2008-08-18 19:21 UTC (permalink / raw)
To: Pavel Kobyakov; +Cc: 416, Nikolaj Schumacher
Hi Pavel,
Could you review the patch sent by Nikolaj? Thanks.
Nikolaj Schumacher wrote:
> flymake will highlight errors in the current buffer, even if the error
> comes from a different file.
>
> This can be noted, for example, when using
>
> > check-syntax:
> > gcc -Wall -Wextra -fsyntax-only *.cpp
>
> instead of the more common
>
> > check-syntax:
> > gcc -Wall -Wextra -pedantic -fsyntax-only -S $(CHK_SOURCES)
>
> in the Makefile.
>
> It also happens when using ant, where it can't be avoided.
>
> The attached patch filters out these errors when parsing.
> Alternatively, they could be filtered out when highlighting.
--- lisp/progmodes/flymake.el 2008-06-02 23:30:29.000000000 +0200
+++ lisp/progmodes/flymake.el 2008-06-05 23:30:08.000000000 +0200
@@ -866,11 +867,10 @@
(flymake-ler-file line-err-info)))
(setq line-err-info (flymake-ler-set-full-file line-err-info real-file-name))
- (if (flymake-same-files real-file-name source-file-name)
- (setq line-err-info (flymake-ler-set-file line-err-info nil))
- (setq line-err-info (flymake-ler-set-file line-err-info (file-name-nondirectory real-file-name))))
+ (when (flymake-same-files real-file-name source-file-name)
+ (setq line-err-info (flymake-ler-set-file line-err-info nil))
+ (setq err-info-list (flymake-add-err-info err-info-list line-err-info))))
- (setq err-info-list (flymake-add-err-info err-info-list line-err-info)))
(flymake-log 3 "parsed '%s', %s line-err-info" (nth idx lines) (if line-err-info "got" "no"))
(setq idx (1+ idx)))
err-info-list))
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#416: flymake highlights errors from wrong file
@ 2008-06-15 16:27 Nikolaj Schumacher
0 siblings, 0 replies; 2+ messages in thread
From: Nikolaj Schumacher @ 2008-06-15 16:27 UTC (permalink / raw)
To: bug-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 566 bytes --]
Hello.
flymake will highlight errors in the current buffer, even if the error
comes from a different file.
This can be noted, for example, when using
> check-syntax:
> gcc -Wall -Wextra -fsyntax-only *.cpp
instead of the more common
> check-syntax:
> gcc -Wall -Wextra -pedantic -fsyntax-only -S $(CHK_SOURCES)
in the Makefile.
It also happens when using ant, where it can't be avoided.
The attached patch filters out these errors when parsing.
Alternatively, they could be filtered out when highlighting.
regards,
Nikolaj Schumacher
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 1239 bytes --]
diff -du /Users/nik/emacs/var/backup/\!Applications\!Emacs.app\!Contents\!Resources\!share\!emacs\!22.2\!lisp\!progmodes\!flymake.el.\~2\~ /Applications/Emacs.app/Contents/Resources/share/emacs/22.2/lisp/progmodes/flymake.el
--- lisp/progmodes/flymake.el 2008-06-02 23:30:29.000000000 +0200
+++ lisp/progmodes/flymake.el 2008-06-05 23:30:08.000000000 +0200
@@ -866,11 +867,10 @@
(flymake-ler-file line-err-info)))
(setq line-err-info (flymake-ler-set-full-file line-err-info real-file-name))
- (if (flymake-same-files real-file-name source-file-name)
- (setq line-err-info (flymake-ler-set-file line-err-info nil))
- (setq line-err-info (flymake-ler-set-file line-err-info (file-name-nondirectory real-file-name))))
+ (when (flymake-same-files real-file-name source-file-name)
+ (setq line-err-info (flymake-ler-set-file line-err-info nil))
+ (setq err-info-list (flymake-add-err-info err-info-list line-err-info))))
- (setq err-info-list (flymake-add-err-info err-info-list line-err-info)))
(flymake-log 3 "parsed '%s', %s line-err-info" (nth idx lines) (if line-err-info "got" "no"))
(setq idx (1+ idx)))
err-info-list))
Diff finished. Thu Jun 5 23:30:18 2008
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-18 19:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-18 19:21 bug#416: flymake highlights errors from wrong file Chong Yidong
-- strict thread matches above, loose matches on Subject: below --
2008-06-15 16:27 Nikolaj Schumacher
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.