From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: Tabs and ends of lines in sql mode Date: Wed, 08 Feb 2006 13:24:11 +0100 Organization: sometimes Message-ID: <7eu0bajaxg.fsf@ada2.unipv.it> References: <1139358187.831991.206830@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1139417623 743 80.91.229.2 (8 Feb 2006 16:53:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Feb 2006 16:53:43 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 08 17:53:36 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F6sWp-0001GJ-Ec for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Feb 2006 17:50:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6rsk-0005Kj-N4 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Feb 2006 11:09:26 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.uchicago.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!LF.net!quimby.gnus.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: ada2.unipv.it Original-X-Trace: quimby.gnus.org 1139401451 7118 193.204.44.145 (8 Feb 2006 12:24:11 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Wed, 8 Feb 2006 12:24:11 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:xftexjqbbq3UaiFobV3BjMZUkZA= Original-Xref: shelby.stanford.edu gnu.emacs.help:137446 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33069 Archived-At: jiri.pejchal@gmail.com writes: > Is there a way for sql-send-paragraph to not sends the tabs and ends > of lines? it has to send at least one newline (at the end of the paragraph). you probably meant to say internal tabs and newlines. the best solution would be to disable the secondary prompting and completion in the subproc, but here is a rewrite of `sql-send-paragraph' as a workaround: (defun sql-send-paragraph () "Send the current paragraph to the SQL process." (interactive) (let ((raw (buffer-substring-no-properties (save-excursion (backward-paragraph) (point)) (save-excursion (forward-paragraph) (point))))) ;; subdue secondary-prompting and completion over-helpfulness (while (string-match "\n\t*" raw) (setq raw (concat (substring raw 0 (match-beginning 0)) " " (substring raw (match-end 0))))) (sql-send-string raw))) i think this is ugly, however. mulling over comint.el now... thi