all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@glug.org>
Subject: Re: Tabs and ends of lines in sql mode
Date: Wed, 08 Feb 2006 13:24:11 +0100	[thread overview]
Message-ID: <7eu0bajaxg.fsf@ada2.unipv.it> (raw)
In-Reply-To: 1139358187.831991.206830@f14g2000cwb.googlegroups.com

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

  reply	other threads:[~2006-02-08 12:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-08  0:23 Tabs and ends of lines in sql mode jiri.pejchal
2006-02-08 12:24 ` Thien-Thi Nguyen [this message]
2006-02-09 13:18 ` Tim X
2006-02-10  0:21   ` Thien-Thi Nguyen
  -- strict thread matches above, loose matches on Subject: below --
2006-04-22 17:31 Jiri Pejchal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7eu0bajaxg.fsf@ada2.unipv.it \
    --to=ttn@glug.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.