unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42806: [PATCH 0/1] Parse whole buffer of compilation output at once
@ 2020-08-10 21:27 Jonas Bernoulli
  2020-08-10 21:30 ` bug#42806: [PATCH 1/1] " Jonas Bernoulli
  0 siblings, 1 reply; 4+ messages in thread
From: Jonas Bernoulli @ 2020-08-10 21:27 UTC (permalink / raw)
  To: 42806

Remove the comment that mentioned that it is an option to do it in one
go as we now actually start doing.  As the existence of that comment
suggested, there is not really a reason to process the buffer in small
chunks.  On the contrary, processing the output in arbitrary units can
result in certain constructs not being recognized because they begin
in one arbitrary chunk, while ending in another.

`rustc' was one compiler that was often affected by this.  I am sure
there are others.

     Cheers,
     Jonas

Jonas Bernoulli (1):
  Parse whole buffer of compilation output at once

 lisp/progmodes/compile.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

-- 
2.28.0






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

* bug#42806: [PATCH 1/1] Parse whole buffer of compilation output at once
  2020-08-10 21:27 bug#42806: [PATCH 0/1] Parse whole buffer of compilation output at once Jonas Bernoulli
@ 2020-08-10 21:30 ` Jonas Bernoulli
  2020-08-14 14:19   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Jonas Bernoulli @ 2020-08-10 21:30 UTC (permalink / raw)
  To: 42806

* lisp/progmodes/compile.el (compilation-next-single-property-change):
Parse whole buffer at once.

Remove the comment that mentioned that it is an option to do it in one
go as we now actually start doing.  As the existence of that comment
suggested, there is not really a reason to process the buffer in small
chunks.  On the contrary, processing the output in arbitrary units can
result in certain constructs not being recognized because they begin
in one arbitrary chunk, while ending in another.
---
 lisp/progmodes/compile.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0b9f417845..5b171fe966 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -2417,12 +2417,9 @@ compilation-next-single-property-change
                                                 &optional object limit)
   (let (parsed res)
     (while (progn
-             ;; We parse the buffer here "on-demand" by chunks of 500 chars.
-             ;; But we could also just parse the whole buffer.
              (compilation--ensure-parse
               (setq parsed (max compilation--parsed
-                                (min (+ position 500)
-                                     (or limit (point-max))))))
+                                (or limit (point-max)))))
              (and (or (not (setq res (next-single-property-change
                                       position prop object limit)))
                       (eq res limit))
-- 
2.28.0






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

* bug#42806: [PATCH 1/1] Parse whole buffer of compilation output at once
  2020-08-10 21:30 ` bug#42806: [PATCH 1/1] " Jonas Bernoulli
@ 2020-08-14 14:19   ` Lars Ingebrigtsen
  2020-08-14 14:56     ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-14 14:19 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: 42806

Jonas Bernoulli <jonas@bernoul.li> writes:

> * lisp/progmodes/compile.el (compilation-next-single-property-change):
> Parse whole buffer at once.
>
> Remove the comment that mentioned that it is an option to do it in one
> go as we now actually start doing.  As the existence of that comment
> suggested, there is not really a reason to process the buffer in small
> chunks.  On the contrary, processing the output in arbitrary units can
> result in certain constructs not being recognized because they begin
> in one arbitrary chunk, while ending in another.

Makes sense to me, but I wonder what the reason for this
500-chars-at-a-time parsing was in the first place.

I guess we'll find out if it breaks something, and should be ready to
revert.  :-)

So I've applied this to Emacs 28.

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





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

* bug#42806: [PATCH 1/1] Parse whole buffer of compilation output at once
  2020-08-14 14:19   ` Lars Ingebrigtsen
@ 2020-08-14 14:56     ` Noam Postavsky
  0 siblings, 0 replies; 4+ messages in thread
From: Noam Postavsky @ 2020-08-14 14:56 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Jonas Bernoulli, 42806

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Jonas Bernoulli <jonas@bernoul.li> writes:
>
>> * lisp/progmodes/compile.el (compilation-next-single-property-change):
>> Parse whole buffer at once.
>>
>> Remove the comment that mentioned that it is an option to do it in one
>> go as we now actually start doing.  As the existence of that comment
>> suggested, there is not really a reason to process the buffer in small
>> chunks.  On the contrary, processing the output in arbitrary units can
>> result in certain constructs not being recognized because they begin
>> in one arbitrary chunk, while ending in another.
>
> Makes sense to me, but I wonder what the reason for this
> 500-chars-at-a-time parsing was in the first place.
>
> I guess we'll find out if it breaks something, and should be ready to
> revert.  :-)

I suspect it would be to avoid long pauses if there is a lot of output
from the subprocess at once.





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

end of thread, other threads:[~2020-08-14 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10 21:27 bug#42806: [PATCH 0/1] Parse whole buffer of compilation output at once Jonas Bernoulli
2020-08-10 21:30 ` bug#42806: [PATCH 1/1] " Jonas Bernoulli
2020-08-14 14:19   ` Lars Ingebrigtsen
2020-08-14 14:56     ` Noam Postavsky

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