comparison lisp/progmodes/sql.el @ 42694:4664fcfde396

(sql-query-placeholders-and-send): Handle comint-input-sender-no-newline like comint-simple-send. (sql-escape-newlines-and-send): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Sun, 13 Jan 2002 04:44:22 +0000
parents 87ae537c4b14
children 2f56e7fc793a
comparison
equal deleted inserted replaced
42693:13a21b2786c0 42694:4664fcfde396
1026 (read-from-minibuffer 1026 (read-from-minibuffer
1027 (format "Enter value for %s: " (match-string 1 string)) 1027 (format "Enter value for %s: " (match-string 1 string))
1028 nil nil nil sql-placeholder-history) 1028 nil nil nil sql-placeholder-history)
1029 t t string))) 1029 t t string)))
1030 (comint-send-string proc string) 1030 (comint-send-string proc string)
1031 (comint-send-string proc "\n")) 1031 (if comint-input-sender-no-newline
1032 (if (not (string-equal input ""))
1033 (process-send-eof))
1034 (comint-send-string proc "\n")))
1032 1035
1033 ;; Using DB2 interactively, newlines must be escaped with " \". 1036 ;; Using DB2 interactively, newlines must be escaped with " \".
1034 ;; The space before the backslash is relevant. 1037 ;; The space before the backslash is relevant.
1035 (defun sql-escape-newlines-and-send (proc string) 1038 (defun sql-escape-newlines-and-send (proc string)
1036 "Send to PROC input STRING, escaping newlines if necessary. 1039 "Send to PROC input STRING, escaping newlines if necessary.
1044 (setq result (concat result (substring string start me))) 1047 (setq result (concat result (substring string start me)))
1045 (setq result (concat result (substring string start mb) " \\\n"))) 1048 (setq result (concat result (substring string start mb) " \\\n")))
1046 (setq start me)) 1049 (setq start me))
1047 (setq result (concat result (substring string start))) 1050 (setq result (concat result (substring string start)))
1048 (comint-send-string proc result) 1051 (comint-send-string proc result)
1049 (comint-send-string proc "\n"))) 1052 (if comint-input-sender-no-newline
1053 (if (not (string-equal input ""))
1054 (process-send-eof))
1055 (comint-send-string proc "\n"))))
1050 1056
1051 1057
1052 1058
1053 ;;; Sending the region to the SQLi buffer. 1059 ;;; Sending the region to the SQLi buffer.
1054 1060