help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tabs and ends of lines in sql mode


From: Thien-Thi Nguyen
Subject: Re: Tabs and ends of lines in sql mode
Date: Wed, 08 Feb 2006 13:24:11 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]