aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2014-09-08 08:31:54 -0400
committerSam Steingold2014-09-08 08:31:54 -0400
commit38bf570325d786cbdc50d4fbf789809132c60e3d (patch)
treee0bd550e8458a55db83a036054b02074cffb3848
parent11119fe02a5340a0da502106b0d6074384202451 (diff)
downloademacs-38bf570325d786cbdc50d4fbf789809132c60e3d.tar.gz
emacs-38bf570325d786cbdc50d4fbf789809132c60e3d.zip
(sql-show-sqli-buffer): Display the buffer instead of its name
and bind the command to C-c C-z.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/progmodes/sql.el20
2 files changed, 13 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5529a252e27..28f0ef0c520 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
2 2
3 * progmodes/sql.el (sql-send-line-and-next): New command, 3 * progmodes/sql.el (sql-send-line-and-next): New command,
4 bound to C-c C-n. 4 bound to C-c C-n.
5 (sql-show-sqli-buffer): Display the buffer instead of its name and
6 bind the command to C-c C-z.
5 7
62014-09-08 Glenn Morris <rgm@gnu.org> 82014-09-08 Glenn Morris <rgm@gnu.org>
7 9
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 2d3e048ebd1..c63339d98c8 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -1223,6 +1223,7 @@ Based on `comint-mode-map'.")
1223 (define-key map (kbd "C-c C-b") 'sql-send-buffer) 1223 (define-key map (kbd "C-c C-b") 'sql-send-buffer)
1224 (define-key map (kbd "C-c C-n") 'sql-send-line-and-next) 1224 (define-key map (kbd "C-c C-n") 'sql-send-line-and-next)
1225 (define-key map (kbd "C-c C-i") 'sql-product-interactive) 1225 (define-key map (kbd "C-c C-i") 'sql-product-interactive)
1226 (define-key map (kbd "C-c C-z") 'sql-show-sqli-buffer)
1226 (define-key map (kbd "C-c C-l a") 'sql-list-all) 1227 (define-key map (kbd "C-c C-l a") 'sql-list-all)
1227 (define-key map (kbd "C-c C-l t") 'sql-list-table) 1228 (define-key map (kbd "C-c C-l t") 'sql-list-table)
1228 (define-key map [remap beginning-of-defun] 'sql-beginning-of-statement) 1229 (define-key map [remap beginning-of-defun] 'sql-beginning-of-statement)
@@ -3060,17 +3061,18 @@ If you call it from anywhere else, it sets the global copy of
3060 (run-hooks 'sql-set-sqli-hook))))))) 3061 (run-hooks 'sql-set-sqli-hook)))))))
3061 3062
3062(defun sql-show-sqli-buffer () 3063(defun sql-show-sqli-buffer ()
3063 "Show the name of current SQLi buffer. 3064 "Display the current SQLi buffer.
3064 3065
3065This is the buffer SQL strings are sent to. It is stored in the 3066This is the buffer SQL strings are sent to.
3066variable `sql-buffer'. See `sql-help' on how to create such a buffer." 3067It is stored in the variable `sql-buffer'.
3068I
3069See also `sql-help' on how to create such a buffer."
3067 (interactive) 3070 (interactive)
3068 (if (or (null sql-buffer) 3071 (unless (and sql-buffer (buffer-live-p (get-buffer sql-buffer)))
3069 (null (buffer-live-p (get-buffer sql-buffer)))) 3072 (sql-set-sqli-buffer))
3070 (user-error "%s has no SQLi buffer set" (buffer-name (current-buffer))) 3073 (unless (get-buffer-process sql-buffer)
3071 (if (null (get-buffer-process sql-buffer)) 3074 (user-error "Buffer %s has no process" sql-buffer))
3072 (user-error "Buffer %s has no process" sql-buffer) 3075 (display-buffer sql-buffer))
3073 (user-error "Current SQLi buffer is %s" sql-buffer))))
3074 3076
3075(defun sql-make-alternate-buffer-name () 3077(defun sql-make-alternate-buffer-name ()
3076 "Return a string that can be used to rename a SQLi buffer. 3078 "Return a string that can be used to rename a SQLi buffer.