Function: sql-input-sender

sql-input-sender is a byte-compiled function defined in sql.el.gz.

Signature

(sql-input-sender PROC STRING)

Documentation

Send STRING to PROC after applying filters.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/sql.el.gz
(defun sql-input-sender (proc string)
  "Send STRING to PROC after applying filters."

  (let* ((product (buffer-local-value 'sql-product (process-buffer proc)))
	 (filter  (sql-get-product-feature product :input-filter)))

    ;; Apply filter(s)
    (cond
     ((not filter)
      nil)
     ((functionp filter)
      (setq string (funcall filter string)))
     ((listp filter)
      (mapc (lambda (f) (setq string (funcall f string))) filter))
     (t nil))

    ;; Count how many newlines in the string
    (setq sql-output-newline-count
          (apply #'+ (mapcar (lambda (ch) (if (eq ch ?\n) 1 0))
                             string)))

    ;; Send the string
    (comint-simple-send proc string)))