From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Mauger Newsgroups: gmane.emacs.devel Subject: Re: Deffering redisplay in COMINT Date: Fri, 11 Jan 2013 06:40:24 -0800 (PST) Message-ID: <1357915224.58763.YahooMailNeo@web160903.mail.bf1.yahoo.com> References: <1354842513.76326.YahooMailNeo@web160901.mail.bf1.yahoo.com> <87obhi1j85.fsf@gmail.com> <1357459792.82082.YahooMailNeo@web160901.mail.bf1.yahoo.com> Reply-To: Michael Mauger NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1357915249 6558 80.91.229.3 (11 Jan 2013 14:40:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2013 14:40:49 +0000 (UTC) Cc: Vitalie Spinu , Emacs Devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 11 15:41:04 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ttfn2-0005zw-Rz for ged-emacs-devel@m.gmane.org; Fri, 11 Jan 2013 15:41:01 +0100 Original-Received: from localhost ([::1]:33977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttfmm-0006Ox-Ru for ged-emacs-devel@m.gmane.org; Fri, 11 Jan 2013 09:40:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttfmf-0006N7-5t for emacs-devel@gnu.org; Fri, 11 Jan 2013 09:40:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtfmY-00037j-Ct for emacs-devel@gnu.org; Fri, 11 Jan 2013 09:40:35 -0500 Original-Received: from nm31-vm3.bullet.mail.bf1.yahoo.com ([72.30.239.11]:29722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtfmX-00036s-8H for emacs-devel@gnu.org; Fri, 11 Jan 2013 09:40:30 -0500 Original-Received: from [98.139.212.149] by nm31.bullet.mail.bf1.yahoo.com with NNFMP; 11 Jan 2013 14:40:24 -0000 Original-Received: from [98.139.212.197] by tm6.bullet.mail.bf1.yahoo.com with NNFMP; 11 Jan 2013 14:40:24 -0000 Original-Received: from [127.0.0.1] by omp1006.mail.bf1.yahoo.com with NNFMP; 11 Jan 2013 14:40:24 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 864647.20040.bm@omp1006.mail.bf1.yahoo.com Original-Received: (qmail 79156 invoked by uid 60001); 11 Jan 2013 14:40:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1357915224; bh=w2o9YDusdgIU9+N/eowFUyBeZsZDwuep4oZ02gexX1A=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=xWaNAtYWNMOAsqZ4PouAIf3YSJn3uI7Ja+VNvxcj3oBIw8ehoKwvxoRGz4nTLVuFTPptjjLvFhesz/0pKUrndOyVvQUmCNxjGTGC4cmaLMODWYZE3y3u8iwXwUYFSGOgxh7fC26CkQV7SAHwawZn5hmTxVbDbcS7i4s9CeMw+Lc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qvxd4V4z4XcNL8EkbFMsudFMFo5KDVXa4zBVDPQGZPli/4Z7SwPWG7kydT0tnx0qiKMaSDe4712Bq4L9edfLLcKRIsfWQr0BLN1uo3EWBy7QXyENqecRBOCGOp7CgAqLG41XZsAg8gs8NHf9wNWmCbnivWJONRTpVDmYcguDNQg=; X-YMail-OSG: ZjtAmsUVM1kafNie0lAtcR5moTUjg6lo_WB5lpdQ7cBN19O v6hNznsP5roc9UTeDFffGGavy7DIDspIAqgsAyX2HiWCjVU1bToIF95XrvyD p3mLgOCc56nJrgNhxbtACFnqJh.IUPTMHklGS9b4XAEhypjKKqM3pjiHoQM2 vgUxHfwgN8Bk9oJ0hRNBiuP.y9BFcz7DHpSY4f9x1qeU6ha5cs3J9xWCni1S G1k3muoh6EiGLd53HT8UFhJPeZB_mw6ALgzMYxQeCvXrSQEXKjEhDa6nOZa2 6zJdY46U2ZIsInwYfcpwhRpOoWJbkmo11s7A.9ZHCdB_NS3p6Yd9w3Gjg8Wy CLXlvCQ7XOVHpMwIQ753ismhwh7PbSvFAlontp53xzZqIO8yCXTJtObafyi3 MP_a3JbNyHPhoFVb22mKa7zoE4QKPMbKZEWtFLq.Q3zlvS14lhsulyEqkqma avjuElLtRQP.Y4nMOWmBVgUOWjv8ce45xDab6lI.L8VwP5ToPG3bimdgoP61 ZJqaiqNIK.A-- Original-Received: from [98.216.52.54] by web160903.mail.bf1.yahoo.com via HTTP; Fri, 11 Jan 2013 06:40:24 PST X-Rocket-MIMEInfo: 001.001, PsKgCgo.PiAgVGhlIHByZSBob29rIG9ubHkgYWN0aXZhdGVzIGlmIHRoZSBtb2RlIGlzIGVuYWJsZWQgYW5kIHRydW5jYXRlLWxpbmVzCj4.ICBpcyBzZXQuIMKgV2hlbiBhY3RpdmUsIGl0IGRpc2FibGVzIGF1dG8taHNjcm9sbC1tb2RlLiDCoEl0IHRoZW4gYXBwZW5kc8KgCj4.ICB0aGUgb3V0cHV0IHRleHQgdG8gYSB0ZW1wb3JhcnkgYnVmZmVywqBhbmQgdGhlbiByZXR1cm5zwqBhwqB3aW5kb3cncwo.PiAgd2lkdGggd29ydGggb2YgY2hhcmFjdGVycyBvZiBlYWNoIGxpbmUgaW4gdGhlIHRlbXAgYnVmZmUBMAEBAQE- X-Mailer: YahooMailWebService/0.8.130.494 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 72.30.239.11 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156216 Archived-At: >=A0=0A=0A>> The pre hook only activates if the mode is enabled and trunca= te-lines=0A>> is set. =A0When active, it disables auto-hscroll-mode. =A0It= then appends=A0=0A>> the output text to a temporary buffer=A0and then ret= urns=A0a=A0window's=0A>> width worth of characters of each line in the tem= p buffer to=A0=0A>> be written to the=A0output buffer. =A0The output appea= rs to fill each=A0=0A>> line without the display slowdown due to long disp= layed lines.=0A>> And because hscroll is turned off, the text merely flows= up the=0A>> screen quickly.=0A> =0A> Have you tried the (presumably) simp= ler approach of only inserting the=0A> text one line at a time, i.e. accumu= late the output in some undisplayed=0A> "buffer area" (can be a buffer, a s= tring, or a list of strings, this=0A> last choice being probably the most e= fficient) until you see a \n and=0A> then insert that text (upto and includ= ing the \n, so the cursor stays in=0A> column 0 and doesn't risk triggering= auto-hscroll-mode) while keeping=0A> the rest in the "buffer area"?=0A> = =0A> =0A> =A0 =A0 =A0 =A0 Stefan=0A> =0A=0AI hate that after beating my hea= d against the wall for a month, you can=0Asay=A0"Have you tried..." and I'm= sitting here going "Duh!". =A0;-) =A0Thanks.=0A=0AYou are correct=A0that b= y=A0only passing along the incoming text thru=A0=0A(and=A0including) the la= st newline=A0of the preoutput text does reduce the=A0=0Aauto-hscroll-mode r= elated=A0flickering. =A0The trick is detecting the prompt=0Aat the end of t= he output to force the filter to flush everything. =A0The=A0=0Aimplementati= on is very=A0straightforward just using a string to hold=0Awhat is left ove= r from the prior iteration. =A0=0A=0AComparing the results to=A0not having = the filter, is dramatic. =A0I have a=A0=0Aquery that produces about 200 row= s of data x 8000 characters per=A0=0Arow (the database columns are=A0waaaay= too long for the data present,=A0=0Abut that's what I have to live with). = =A0Without the filter and=A0=0Aauto-hscroll-mode engaged, the results take = nearly 30 seconds to=A0=0Acomplete under Emacs. =A0(It is nearly instantane= ous=A0outside of Emacs.) =A0=0AWith the filter you suggest,=A0the results t= ake about=A08-10 seconds with=A0=0Aa=A0noticeable stutter between each row.= =A0With the solution=A0I had=A0=0Adeveloped (buffering the long lines in a= buffer and=A0restoring them=A0at=A0=0Athe end of output), the results scro= ll by quickly in about=A02-3 seconds,=A0=0Abut then it hesitates at the end= (as it restores the long lines=A0in the=A0=0Abuffer),=A0for another 2-3 se= conds. =A0So just reducing the horizontal=A0=0Ascrolling is=A0giving us the= big payback and the more complex=A0=0Agymnastics=A0is probably=A0not worth= code cost.=0A=0AThank you again, Stefan. =A0Thanks for the suggestion and = clarifying my=0Athinking about how process output and display is handled in= Emacs. =A0=0AYour leadership=A0and patience is appreciated. =A0=0A=0AI'll = be adding this filtering to an existing output=A0filter=A0in sql.el. =A0=0A= =0A-- Michael