Function: sql-find-sqli-buffer
sql-find-sqli-buffer is a byte-compiled function defined in sql.el.gz.
Signature
(sql-find-sqli-buffer &optional PRODUCT CONNECTION)
Documentation
Return the name of the current default SQLi buffer or nil.
In order to qualify, the SQLi buffer must be alive, be in
sql-interactive-mode and have a process.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/sql.el.gz
(defun sql-find-sqli-buffer (&optional product connection)
"Return the name of the current default SQLi buffer or nil.
In order to qualify, the SQLi buffer must be alive, be in
`sql-interactive-mode' and have a process."
(let ((buf sql-buffer)
(prod (or product sql-product)))
(or
;; Current sql-buffer, if there is one.
(and (sql-buffer-live-p buf prod connection)
buf)
;; Global sql-buffer
(and (setq buf (default-value 'sql-buffer))
(sql-buffer-live-p buf prod connection)
buf)
;; Look thru each buffer
(car (apply #'append
(mapcar (lambda (b)
(and (sql-buffer-live-p b prod connection)
(list (buffer-name b))))
(buffer-list)))))))