unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Any way to make sit-for avoid triggering redisplay in the general case?
@ 2018-02-08 22:40 Dmitry Gutov
  2018-02-08 22:49 ` Noam Postavsky
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2018-02-08 22:40 UTC (permalink / raw)
  To: emacs-devel

And not just "if input is available before it starts". Or is there a 
something I can call that would have a similar effect?

Effect like "wait until either a specified about of time passes, or the 
user types something, while allowing subprocess sentinels and filters to 
run, and hopefully timers as well, all without triggering redisplay".

company-mode has a flickering problem associated with asynchronous 
completion backends, and I have a seemingly easy solution in mind that 
turned out to depend on being able to do this.



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

* Re: Any way to make sit-for avoid triggering redisplay in the general case?
  2018-02-08 22:40 Any way to make sit-for avoid triggering redisplay in the general case? Dmitry Gutov
@ 2018-02-08 22:49 ` Noam Postavsky
  2018-02-08 22:52   ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Noam Postavsky @ 2018-02-08 22:49 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

On Thu, Feb 8, 2018 at 5:40 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:
> And not just "if input is available before it starts". Or is there a
> something I can call that would have a similar effect?
>
> Effect like "wait until either a specified about of time passes, or the user
> types something, while allowing subprocess sentinels and filters to run, and
> hopefully timers as well, all without triggering redisplay".

Does the NODISP arg not work?

(sit-for SECONDS &optional NODISP)

Redisplay, then wait for SECONDS seconds.  Stop when input is available.
[...]
If optional arg NODISP is t, don't redisplay, just wait for input.



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

* Re: Any way to make sit-for avoid triggering redisplay in the general case?
  2018-02-08 22:49 ` Noam Postavsky
@ 2018-02-08 22:52   ` Dmitry Gutov
  2018-02-08 22:55     ` Noam Postavsky
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2018-02-08 22:52 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: emacs-devel

On 2/9/18 01:49, Noam Postavsky wrote:

> Does the NODISP arg not work?

Nope: (progn (insert "a") (sit-for 0.2 t) (delete-char -1))

I read it the same way, but apparently it's just meant to avoid the 
initial redisplay. Looks pretty useless. Here's from the docstring 
continued:

   Redisplay does not happen if input is available before it starts.



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

* Re: Any way to make sit-for avoid triggering redisplay in the general case?
  2018-02-08 22:52   ` Dmitry Gutov
@ 2018-02-08 22:55     ` Noam Postavsky
  2018-02-08 23:08       ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Noam Postavsky @ 2018-02-08 22:55 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

On Thu, Feb 8, 2018 at 5:52 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:

>> Does the NODISP arg not work?
>
> Nope: (progn (insert "a") (sit-for 0.2 t) (delete-char -1))

Ah, how about inhibit-redisplay:

(let ((inhibit-redisplay t))
  (insert "a") (sit-for 0.2 t) (delete-char -1))



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

* Re: Any way to make sit-for avoid triggering redisplay in the general case?
  2018-02-08 22:55     ` Noam Postavsky
@ 2018-02-08 23:08       ` Dmitry Gutov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2018-02-08 23:08 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: emacs-devel

On 2/9/18 01:55, Noam Postavsky wrote:

> Ah, how about inhibit-redisplay:
> 
> (let ((inhibit-redisplay t))
>    (insert "a") (sit-for 0.2 t) (delete-char -1))

Ooh, that works! Thanks a lot.




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

end of thread, other threads:[~2018-02-08 23:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-08 22:40 Any way to make sit-for avoid triggering redisplay in the general case? Dmitry Gutov
2018-02-08 22:49 ` Noam Postavsky
2018-02-08 22:52   ` Dmitry Gutov
2018-02-08 22:55     ` Noam Postavsky
2018-02-08 23:08       ` Dmitry Gutov

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