unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2048: Flymake Enhancement
@ 2009-01-25 17:13 Joseph Donaldson
  2009-01-26  2:05 ` Stefan Monnier
  2020-09-19 21:57 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Joseph Donaldson @ 2009-01-25 17:13 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]

Hello,

I hope this is the right forum for submitting this patch for flymake. If
it is not, please, direct me to the correct one. While working to get
flymake to work with the bigloo scheme compiler I discovered that when
it examines the compiler output it does so line-by-line. This prevents
flymake in the case of bigloo from being able to show complete
error/warning messages -- bigloo's error/warning messages span multiple
lines. To remedy this, I introduced a buffer-local variable named
flymake-split-output-pattern and modified the function
flymake-split-output to use it when splitting the output into individual
error/warning messages. The default value of
flymake-split-output-pattern is "[\n\r]+"; this matches the value
previously hard-coded in flymake-split-output. For bigloo, I added in
my .emacs file a hook to bee-mode-hook to set the value
flymake-split-ouput-pattern to "^[\r\n][\r\n]". This enabled flymake to
display the full error/warning messages provided bigloo. The patch for
this modification is attached. If there are any questions and or
comments, I would appreciate hearing them.

Thank You,
Joseph Donaldson

  

[-- Attachment #2: flymake.patch --]
[-- Type: text/x-patch, Size: 1365 bytes --]

*** flymake.el	2009-01-25 11:38:32.000000000 -0500
--- flymake_mod.el	2009-01-25 11:44:06.000000000 -0500
***************
*** 67,72 ****
--- 67,76 ----
    "Same as `flymake-err-info', effective when a syntax check is in progress.")
  (make-variable-buffer-local 'flymake-new-err-info)
  
+ (defvar  flymake-split-output-pattern "[\n\r]+"
+   "Regular expression used to split the output into individual error/warning messages")
+ (make-variable-buffer-local 'flymake-split-output-pattern)
+ 
  ;;;; [[ cross-emacs compatibility routines
  (defsubst flymake-makehash (&optional test)
    (if (fboundp 'make-hash-table)
***************
*** 863,869 ****
  Return last one as residual if it does not end with newline char.
  Returns ((LINES) RESIDUAL)."
    (when (and output (> (length output) 0))
!     (let* ((lines (flymake-split-string output "[\n\r]+"))
  	   (complete (equal "\n" (char-to-string (aref output (1- (length output))))))
  	   (residual nil))
        (when (not complete)
--- 867,873 ----
  Return last one as residual if it does not end with newline char.
  Returns ((LINES) RESIDUAL)."
    (when (and output (> (length output) 0))
!     (let* ((lines (flymake-split-string output  flymake-split-output-pattern))
  	   (complete (equal "\n" (char-to-string (aref output (1- (length output))))))
  	   (residual nil))
        (when (not complete)

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

* bug#2048: Flymake Enhancement
  2009-01-25 17:13 bug#2048: Flymake Enhancement Joseph Donaldson
@ 2009-01-26  2:05 ` Stefan Monnier
  2009-01-26  2:15   ` Processed: " Emacs bug Tracking System
  2020-09-19 21:57 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2009-01-26  2:05 UTC (permalink / raw)
  To: Joseph Donaldson; +Cc: 2048

severity 2048 wishlist
thanks

> lines. To remedy this, I introduced a buffer-local variable named
> flymake-split-output-pattern and modified the function
> flymake-split-output to use it when splitting the output into individual
> error/warning messages. The default value of
> flymake-split-output-pattern is "[\n\r]+"; this matches the value
> previously hard-coded in flymake-split-output. For bigloo, I added in
> my .emacs file a hook to bee-mode-hook to set the value
> flymake-split-ouput-pattern to "^[\r\n][\r\n]". This enabled flymake to
> display the full error/warning messages provided bigloo. The patch for
> this modification is attached. If there are any questions and or
> comments, I would appreciate hearing them.

I'd hope that flymake.el can be improved to match multi-line regexps
without having to tell it how to cut the output into chunks.
In any case, this change is too late for Emacs-23.1 which is in feature
freeze, but otherwise the goal is right.  I remember someone else
needing/implementing support for multiline error messages in flymake.el
a while back.


        Stefan






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

* Processed: Re: bug#2048: Flymake Enhancement
  2009-01-26  2:05 ` Stefan Monnier
@ 2009-01-26  2:15   ` Emacs bug Tracking System
  0 siblings, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-01-26  2:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs Bugs

Processing commands for control@emacsbugs.donarmstrong.com:

> severity 2048 wishlist
bug#2048: Flymake Enhancement
Severity set to `wishlist' from `normal'

> thanks
Stopping processing here.

Please contact me if you need assistance.

Don Armstrong
(administrator, Emacs bugs database)




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

* bug#2048: Flymake Enhancement
  2009-01-25 17:13 bug#2048: Flymake Enhancement Joseph Donaldson
  2009-01-26  2:05 ` Stefan Monnier
@ 2020-09-19 21:57 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-19 21:57 UTC (permalink / raw)
  To: Joseph Donaldson; +Cc: 2048

Joseph Donaldson <donaldsonjw@gmail.com> writes:

> I hope this is the right forum for submitting this patch for flymake. If
> it is not, please, direct me to the correct one. While working to get
> flymake to work with the bigloo scheme compiler I discovered that when
> it examines the compiler output it does so line-by-line. 

This was 11 years ago, and the bug report unfortunately didn't get a lot
of attention at the time.  However, I think the underlying problem was
fixed by João a few years back, so I'm closing this bug report.  If the
problem still persists in newer versions of Emacs, please respond to the
debbugs address and we'll reopen.

commit 6954270e87e3a9f829cd6e8c89febc2c0bc48845
Author:     João Távora <joaotavora@gmail.com>
AuthorDate: Wed Aug 23 02:23:41 2017 +0100

    Completely rewrite Flymake's subprocess output processing
    
    Instead of parsing and matching regexps line-by-line, insert
    subprocess output in a separate buffer and parse using
    `search-forward-regexp'.  This eventually enables multi-line error
    patterns and simplifies code all around.  Store per-check information
    in the subprocess using `process-get' and `process-put'.  Treat error
    messages, warnings, etc. more generically as "diagnostics".  Create
    these objects as soon as possible, reusing existing `flymake-ler'
    structure.  Fix some whitespace.


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2020-09-19 21:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-25 17:13 bug#2048: Flymake Enhancement Joseph Donaldson
2009-01-26  2:05 ` Stefan Monnier
2009-01-26  2:15   ` Processed: " Emacs bug Tracking System
2020-09-19 21:57 ` Lars Ingebrigtsen

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