changeset 30642:ae938744b6b1

(sql-magic-go): Use comint-bol instead of explicitly matching comint-prompt-regexp. (sql-copy-column): Use comint-line-beginning-position instead of explicitly matching comint-prompt-regexp.
author Miles Bader <miles@gnu.org>
date Mon, 07 Aug 2000 14:52:52 +0000
parents 297909766bad
children 4a6ff467897e
files lisp/progmodes/sql.el
diffstat 1 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/sql.el	Mon Aug 07 14:51:48 2000 +0000
+++ b/lisp/progmodes/sql.el	Mon Aug 07 14:52:52 2000 +0000
@@ -664,8 +664,8 @@
   (self-insert-command (prefix-numeric-value arg))
   (if (and (equal sql-electric-stuff 'go)
 	   (save-excursion
-	     (beginning-of-line)
-	     (looking-at (concat sql-prompt-regexp "go\\b"))))
+	     (comint-bol nil)
+	     (looking-at "go\\b")))
       (comint-send-input)))
 
 (defun sql-magic-semicolon (arg)
@@ -885,21 +885,21 @@
 		  (progn (forward-char 1) (backward-sexp 1) (point))
 		  (progn (forward-sexp 1) (point))))
       (goto-char (point-max))
-      (cond
-       ;; if empty command line, insert SELECT
-       ((save-excursion (beginning-of-line)
-			(looking-at (concat comint-prompt-regexp "$")))
-	(insert "SELECT "))
-       ;; else if appending to INTO .* (, SELECT or ORDER BY, insert a comma
-       ((save-excursion
-	  (re-search-backward "\\b\\(\\(into\\s-+\\S-+\\s-+(\\)\\|select\\|order by\\) .+"
-			      (save-excursion (beginning-of-line) (point)) t))
-	(insert ", "))
-       ;; else insert a space
-       (t
-	(if (eq (preceding-char) ? )
-	    nil
-	  (insert " "))))
+      (let ((bol (comint-line-beginning-position)))
+	(cond
+	 ;; if empty command line, insert SELECT
+	 ((= bol (point))
+	  (insert "SELECT "))
+	 ;; else if appending to INTO .* (, SELECT or ORDER BY, insert a comma
+	 ((save-excursion
+	    (re-search-backward "\\b\\(\\(into\\s-+\\S-+\\s-+(\\)\\|select\\|order by\\) .+"
+				bol t))
+	  (insert ", "))
+	 ;; else insert a space
+	 (t
+	  (if (eq (preceding-char) ? )
+	      nil
+	    (insert " ")))))
       ;; in any case, insert the column
       (insert column)
       (message "%s" column))))