Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 2BAC41337BA3 for ; Thu, 5 May 2011 20:15:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 54413-06 for ; Thu, 5 May 2011 23:15:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by mail.postgresql.org (Postfix) with ESMTP id 16ED71337A5D for ; Thu, 5 May 2011 20:15:45 -0300 (ADT) Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1QI7lo-0005wf-CJ; Thu, 05 May 2011 17:15:44 -0600 Received: from [208.187.158.94] (helo=[172.16.1.234]) by in01.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1QI7lo-0000VY-8H; Thu, 05 May 2011 17:15:44 -0600 Message-ID: <4DC32F9D.6010405@gmail.com> Date: Thu, 05 May 2011 17:15:41 -0600 From: Rob Sargent User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: slightly OT - Using psql from Emacs with sql.el References: <87sjssajtb.fsf@kolob.sebmags.homelinux.org> <4DC328ED.1000705@gmail.com> <87ipto21w4.fsf@kolob.sebmags.homelinux.org> In-Reply-To: <87ipto21w4.fsf@kolob.sebmags.homelinux.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-XM-SPF: eid=; ; ; mid=; ; ; hst=in01.mta.xmission.com; ; ; ip=208.187.158.94; ; ; frm=robjsargent@gmail.com; ; ; spf=neutral X-XM-AID: U2FsdGVkX18xjYIYdiCAbyriit7wiCX3hRkTQZSCOZI= X-SA-Exim-Connect-IP: 208.187.158.94 X-SA-Exim-Mail-From: robjsargent@gmail.com X-SA-Exim-Scanned: No (on in01.mta.xmission.com); SAEximRunCond expanded to false X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.888 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/30 X-Sequence-Number: 35314 On 05/05/2011 04:55 PM, Seb wrote: > On Thu, 05 May 2011 16:47:09 -0600, > Rob Sargent wrote: > > [...] > >> Doesn't appear to. I use sql-mode alot/daily. The multiple prompts >> never bothers me, though the output not starting at the left kind of >> does. > > I've adapted someone's suggestion at the Emacs Wiki for that: > > (defun sl/sql-add-newline-before-output (output) > "Add newline to beginning of OUTPUT for `comint-preoutput-filter-functions'" > (concat "\n" output)) > > (add-hook 'sql-interactive-mode-hook > (lambda () > (add-hook 'comint-preoutput-filter-functions > 'sl/sql-add-newline-before-output))) > > ... but this breaks navigation (e.g. 'C-c C-p') > > Oooo, can't have that. Though my usage (sql-send-paragraph) does not get registered in the command history, I still like have a proper record of what I have typed into the *SQL* buffer. If I want a history of what I sent from my working buffer (of sql statements) I wipe/yank into *SQL*. Then the entire block returns on M-p.