unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler
@ 2014-12-28 10:25 Leo Liu
  2014-12-28 11:54 ` Leo Liu
  2021-12-02 11:54 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: Leo Liu @ 2014-12-28 10:25 UTC (permalink / raw)
  To: 19457


why are these functions have a hard-coded 2 seconds wait while
inhibit-quit?

This can be problematic in a situation triggered by completion-at-point.
in my setup I have 3 items in completion-styles and it can trigger 6
sentinel/filter errors in a row for every char input. While the errors
are signalled and even if I keep hitting C-g I have to wait many
seconds.

Leo





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

* bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler
  2014-12-28 10:25 bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler Leo Liu
@ 2014-12-28 11:54 ` Leo Liu
  2015-01-01 16:29   ` Stefan Monnier
  2021-12-02 11:54 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 7+ messages in thread
From: Leo Liu @ 2014-12-28 11:54 UTC (permalink / raw)
  To: 19457

On 2014-12-28 21:25 +1100, Leo Liu wrote:
> This can be problematic in a situation triggered by completion-at-point.
> in my setup I have 3 items in completion-styles and it can trigger 6
> sentinel/filter errors in a row for every char input. While the errors
> are signalled and even if I keep hitting C-g I have to wait many
> seconds.

There is also this issue:

See completion--some; all errors are deferred to the end of the
function. There is no way a completion table can tell completion--some
"I am not ready" don't call me again. For example, when a completion
table involves running an external command and that command is not
installed in the system. In this case the completion table knows better
i.e. no need to retry so as to save precious time.

Leo





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

* bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler
  2014-12-28 11:54 ` Leo Liu
@ 2015-01-01 16:29   ` Stefan Monnier
  2015-01-04 23:04     ` Leo Liu
  2015-01-04 23:43     ` Dmitry Gutov
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Monnier @ 2015-01-01 16:29 UTC (permalink / raw)
  To: Leo Liu; +Cc: 19457

> See completion--some; all errors are deferred to the end of the
> function. There is no way a completion table can tell completion--some
> "I am not ready" don't call me again. For example, when a completion
> table involves running an external command and that command is not
> installed in the system. In this case the completion table knows better
> i.e. no need to retry so as to save precious time.

[ I understand this may not really solve your problem, but it might
  still help you find the right solution: ]

The repetition between the different calls to the completion-table
happening during completion--some is expected to be avoided (if
problematic) via caching.

Back then I tried to come up with some alternative API that would
provide directly the ability to share more work, but couldn't come
up with anything that was really better than just using straight caching
in the backend.


        Stefan





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

* bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler
  2015-01-01 16:29   ` Stefan Monnier
@ 2015-01-04 23:04     ` Leo Liu
  2015-01-04 23:43     ` Dmitry Gutov
  1 sibling, 0 replies; 7+ messages in thread
From: Leo Liu @ 2015-01-04 23:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19457

On 2015-01-02 03:29 +1100, Stefan Monnier wrote:
> The repetition between the different calls to the completion-table
> happening during completion--some is expected to be avoided (if
> problematic) via caching.
>
> Back then I tried to come up with some alternative API that would
> provide directly the ability to share more work, but couldn't come
> up with anything that was really better than just using straight caching
> in the backend.

Thanks for the information. For this instance I have chosen to silence
errors from sentinel/filter functions with logging of errors and
backtrace instead. The long unquittable wait is just too much. But
caching can reduce the multiple error instances to one.

Leo





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

* bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler
  2015-01-01 16:29   ` Stefan Monnier
  2015-01-04 23:04     ` Leo Liu
@ 2015-01-04 23:43     ` Dmitry Gutov
  2015-01-05  1:58       ` Stefan Monnier
  1 sibling, 1 reply; 7+ messages in thread
From: Dmitry Gutov @ 2015-01-04 23:43 UTC (permalink / raw)
  To: Stefan Monnier, Leo Liu; +Cc: 19457

On 01/01/2015 07:29 PM, Stefan Monnier wrote:

> Back then I tried to come up with some alternative API that would
> provide directly the ability to share more work, but couldn't come
> up with anything that was really better than just using straight caching
> in the backend.

A straightforward caching approach (like `completion-table-with-cache') 
won't be good enough, though: the completion styles that come later tend 
to query with shorter prefixes.

So all in all, it seems like the caching function has to return 
completions for an empty prefix, and then cache that. That might be 
pretty costly at times.





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

* bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler
  2015-01-04 23:43     ` Dmitry Gutov
@ 2015-01-05  1:58       ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2015-01-05  1:58 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 19457, Leo Liu

> So all in all, it seems like the caching function has to return completions
> for an empty prefix, and then cache that. That might be pretty costly
> at times.

Indeed.  And for the "error" case, the caching is yet different.  In my
experience, there can't really be a "one stop" caching solution.


        Stefan





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

* bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler
  2014-12-28 10:25 bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler Leo Liu
  2014-12-28 11:54 ` Leo Liu
@ 2021-12-02 11:54 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-02 11:54 UTC (permalink / raw)
  To: Leo Liu; +Cc: 19457

Leo Liu <sdl.web@gmail.com> writes:

> why are these functions have a hard-coded 2 seconds wait while
> inhibit-quit?

I've now introduced a new variable, `process-error-pause-time', in Emacs
29 for this.  (Setting it to 0 will disable these pauses.)

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





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

end of thread, other threads:[~2021-12-02 11:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-28 10:25 bug#19457: 24.4; exec_sentinel_error_handler and read_process_output_error_handler Leo Liu
2014-12-28 11:54 ` Leo Liu
2015-01-01 16:29   ` Stefan Monnier
2015-01-04 23:04     ` Leo Liu
2015-01-04 23:43     ` Dmitry Gutov
2015-01-05  1:58       ` Stefan Monnier
2021-12-02 11:54 ` 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).