emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117841: (sql-send-line-and-next): New command, boun


From: Sam Steingold
Subject: [Emacs-diffs] trunk r117841: (sql-send-line-and-next): New command, bound to C-c C-n.
Date: Mon, 08 Sep 2014 12:27:38 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117841
revision-id: address@hidden
parent: address@hidden
committer: Sam Steingold <address@hidden>
branch nick: trunk
timestamp: Mon 2014-09-08 08:27:19 -0400
message:
  (sql-send-line-and-next): New command, bound to C-c C-n.
  
  * lisp/progmodes/sql.el (sql-send-line-and-next): New command,
  bound to C-c C-n.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/sql.el          sql.el-20091113204419-o5vbwnq5f7feedwu-1303
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-09-08 06:03:19 +0000
+++ b/lisp/ChangeLog    2014-09-08 12:27:19 +0000
@@ -1,3 +1,8 @@
+2014-09-08  Sam Steingold  <address@hidden>
+
+       * progmodes/sql.el (sql-send-line-and-next): New command,
+       bound to C-c C-n.
+
 2014-09-08  Glenn Morris  <address@hidden>
 
        * calendar/calendar.el (calendar-basic-setup):

=== modified file 'lisp/progmodes/sql.el'
--- a/lisp/progmodes/sql.el     2014-02-28 01:55:12 +0000
+++ b/lisp/progmodes/sql.el     2014-09-08 12:27:19 +0000
@@ -212,11 +212,11 @@
 ;; Michael Mauger <address@hidden> -- improved product support
 ;; Drew Adams <address@hidden> -- Emacs 20 support
 ;; Harald Maier <address@hidden> -- sql-send-string
-;; Stefan Monnier <address@hidden> -- font-lock corrections; 
+;; Stefan Monnier <address@hidden> -- font-lock corrections;
 ;;      code polish
 ;; Paul Sleigh <address@hidden> -- MySQL keyword enhancement
 ;; Andrew Schein <address@hidden> -- sql-port bug
-;; Ian Bjorhovde <address@hidden> -- db2 escape newlines 
+;; Ian Bjorhovde <address@hidden> -- db2 escape newlines
 ;;      incorrectly enabled by default
 ;; Roman Scherer <address@hidden> -- Connection documentation
 ;; Mark Wilkinson <address@hidden> -- file-local variables ignored
@@ -1221,6 +1221,7 @@
     (define-key map (kbd "C-c C-r") 'sql-send-region)
     (define-key map (kbd "C-c C-s") 'sql-send-string)
     (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-l a") 'sql-list-all)
     (define-key map (kbd "C-c C-l t") 'sql-list-table)
@@ -3073,7 +3074,6 @@
 
 (defun sql-make-alternate-buffer-name ()
   "Return a string that can be used to rename a SQLi buffer.
-
 This is used to set `sql-alternate-buffer-name' within
 `sql-interactive-mode'.
 
@@ -3323,7 +3323,7 @@
               (setq oline (replace-match "" nil nil oline)
                     sql-output-newline-count (1- sql-output-newline-count)
                     prompt-found t)))
-          
+
           ;; If we've found all the expected prompts, stop looking
           (if (= sql-output-newline-count 0)
               (setq sql-output-newline-count nil
@@ -3403,6 +3403,13 @@
   (interactive)
   (sql-send-region (point-min) (point-max)))
 
+(defun sql-send-line-and-next ()
+  "Send the current line to the SQL process and go to the next line."
+  (interactive)
+  (sql-send-region (line-beginning-position 1) (line-beginning-position 2))
+  (beginning-of-line 2)
+  (while (forward-comment 1)))  ; skip all comments and whitespace
+
 (defun sql-send-magic-terminator (buf str terminator)
   "Send TERMINATOR to buffer BUF if its not present in STR."
   (let (comint-input-sender-no-newline pat term)
@@ -3589,7 +3596,7 @@
          (apply c sqlbuf outbuf enhanced arg nil))
         (t (error "Unknown sql-execute item %s" c))))
    (if (consp command) command (cons command nil)))
-  
+
   (setq outbuf (get-buffer outbuf))
   (if (zerop (buffer-size outbuf))
       (kill-buffer outbuf)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]