Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
38bf5703
Commit
38bf5703
authored
Sep 08, 2014
by
Sam Steingold
Browse files
(sql-show-sqli-buffer): Display the buffer instead of its name
and bind the command to C-c C-z.
parent
11119fe0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
lisp/ChangeLog
lisp/ChangeLog
+2
-0
lisp/progmodes/sql.el
lisp/progmodes/sql.el
+11
-9
No files found.
lisp/ChangeLog
View file @
38bf5703
...
...
@@ -2,6 +2,8 @@
* progmodes/sql.el (sql-send-line-and-next): New command,
bound to C-c C-n.
(sql-show-sqli-buffer): Display the buffer instead of its name and
bind the command to C-c C-z.
2014-09-08 Glenn Morris <rgm@gnu.org>
...
...
lisp/progmodes/sql.el
View file @
38bf5703
...
...
@@ -1223,6 +1223,7 @@ Based on `comint-mode-map'.")
(
define-key
map
(
kbd
"C-c C-b"
)
'sql-send-buffer
)
(
define-key
map
(
kbd
"C-c C-n"
)
'sql-send-line-and-next
)
(
define-key
map
(
kbd
"C-c C-i"
)
'sql-product-interactive
)
(
define-key
map
(
kbd
"C-c C-z"
)
'sql-show-sqli-buffer
)
(
define-key
map
(
kbd
"C-c C-l a"
)
'sql-list-all
)
(
define-key
map
(
kbd
"C-c C-l t"
)
'sql-list-table
)
(
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
(
run-hooks
'sql-set-sqli-hook
)))))))
(
defun
sql-show-sqli-buffer
()
"
Show the name of
current SQLi buffer.
"
Display the
current SQLi buffer.
This is the buffer SQL strings are sent to. It is stored in the
variable `sql-buffer'. See `sql-help' on how to create such a buffer."
This is the buffer SQL strings are sent to.
It is stored in the variable `sql-buffer'.
I
See also `sql-help' on how to create such a buffer."
(
interactive
)
(
if
(
or
(
null
sql-buffer
)
(
null
(
buffer-live-p
(
get-buffer
sql-buffer
))))
(
user-error
"%s has no SQLi buffer set"
(
buffer-name
(
current-buffer
)))
(
if
(
null
(
get-buffer-process
sql-buffer
))
(
user-error
"Buffer %s has no process"
sql-buffer
)
(
user-error
"Current SQLi buffer is %s"
sql-buffer
))))
(
unless
(
and
sql-buffer
(
buffer-live-p
(
get-buffer
sql-buffer
)))
(
sql-set-sqli-buffer
))
(
unless
(
get-buffer-process
sql-buffer
)
(
user-error
"Buffer %s has no process"
sql-buffer
))
(
display-buffer
sql-buffer
))
(
defun
sql-make-alternate-buffer-name
()
"Return a string that can be used to rename a SQLi buffer.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment