unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Deffering redisplay in COMINT
@ 2012-12-07  1:08 Michael Mauger
  2012-12-25 11:09 ` Vitalie Spinu
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Mauger @ 2012-12-07  1:08 UTC (permalink / raw)
  To: Emacs Devel

I don't believe this is possible, but I figured I'd run it past the brain trust....

In sql-interactive-mode, a derivative of comint, I will submit a SELECT statement that returns many very long rows (2000+ characters per line).  The redisplay fireworks that follow are impressive but slow.   As text streams to the buffer with `auto-hscroll-mode' enabled the screen flashes as it redraws the buffer with more lines of data and scrolled horizontally in different places until all the data stream is complete.  

I have figured out how to turn off horizontal scrolling with a `comint-preoutput-filter-function' and a `pre-command-hook' for the duration of SQL command so the redisplay is limited to a slow march straight down the page without the intervening horizontal scrolling but the column number in the mode line going crazy.  I've also discovered that if I switch to another buffer so that the SQL buffer is not displayed and then switch back, the SQL buffer is populated very quickly.  (That is, Emacs can fetch the results quickly, it just can't redraw it quickly a couple of hundred times)

So what I'm asking: Is there a way (say by setting `inhibit-redisplay' to t) for the duration of the comint command and then restoring redisplay when I am at the prompt at the end.  The trick that I use for `auto-hscroll-mode' won't work because I don't find out about the completion until the user causes an event.  I understand also that I don't want to universally block redisplay in case I switch to another buffer while the comint command is running and I want to interact with another buffer (i.e., I want to inhibit redisplay in that buffer only--buffer-local inhibit-redisplay).  Looking at comint.el and based on my understanding of how processes are handled, I don't believe that it is easy to do because I don't know when the output is complete.  (I've noticed in my disable auto-hscroll-mode code that the comint-preoutput-filter-function will get called a couple of hundred times with chunks of the output.  I'm probably getting a redisplay after
 each chunk.)  

My only thought is that I could route the output to a temp buffer until I see the prompt at the end of a chunk (ala the comint redirection code, a very non-Emacs 20+ way of doing things), and then move the output to the original buffer.  Essentially buffering the output until it's complete.  Thoughts?  Am I missing an obvious hook?  (pre-command isn't it, it fires only on input, unless I can feed input to it to force it when done)

Am I SOL?



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

end of thread, other threads:[~2013-01-16 14:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-07  1:08 Deffering redisplay in COMINT Michael Mauger
2012-12-25 11:09 ` Vitalie Spinu
2013-01-06  8:09   ` Michael Mauger
2013-01-08 18:19     ` Stefan Monnier
2013-01-11 14:40       ` Michael Mauger
2013-01-11 15:55         ` Stefan Monnier
2013-01-13  8:14           ` Michael Mauger
2013-01-13 16:46             ` Eli Zaretskii
2013-01-16 14:39             ` Stefan Monnier

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