aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/sql.el
diff options
context:
space:
mode:
authorAndrea Corallo2020-08-09 15:03:23 +0200
committerAndrea Corallo2020-08-09 15:03:23 +0200
commit12a982d9789052d8e85efcacb4b311f4876c882a (patch)
treea452a8e888c6ee9c85d6a487359b7a1c0c9fa15b /lisp/progmodes/sql.el
parent80d7f710f2fab902e46aa3fddb8e1c1795420af3 (diff)
parent8e82baf5a730ff542118ddba5b76afdc1db643f6 (diff)
downloademacs-12a982d9789052d8e85efcacb4b311f4876c882a.tar.gz
emacs-12a982d9789052d8e85efcacb4b311f4876c882a.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/progmodes/sql.el')
-rw-r--r--lisp/progmodes/sql.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index c86fc59ac16..a70b5ed60d6 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -1508,6 +1508,22 @@ Based on `comint-mode-map'.")
1508 table) 1508 table)
1509 "Syntax table used in `sql-mode' and `sql-interactive-mode'.") 1509 "Syntax table used in `sql-mode' and `sql-interactive-mode'.")
1510 1510
1511;;; Syntax Properties
1512
1513;; `sql--syntax-propertize-escaped-apostrophe', as follows, was
1514;; (analysed and) adapted from `pascal--syntax-propertize' in
1515;; pascal.el because basic syntax parsing cannot handle the SQL ''
1516;; construct within strings.
1517
1518(defconst sql--syntax-propertize-escaped-apostrophe
1519 (syntax-propertize-rules
1520 ("''"
1521 (0
1522 (if (save-excursion (nth 3 (syntax-ppss (match-beginning 0))))
1523 (string-to-syntax ".")
1524 (forward-char -1)
1525 nil)))))
1526
1511;; Font lock support 1527;; Font lock support
1512 1528
1513(defvar sql-mode-font-lock-object-name 1529(defvar sql-mode-font-lock-object-name
@@ -4210,6 +4226,10 @@ must tell Emacs. Here's how to do that in your init file:
4210 (setq-local abbrev-all-caps 1) 4226 (setq-local abbrev-all-caps 1)
4211 ;; Contains the name of database objects 4227 ;; Contains the name of database objects
4212 (set (make-local-variable 'sql-contains-names) t) 4228 (set (make-local-variable 'sql-contains-names) t)
4229 ;; Activate punctuation syntax table property for
4230 ;; escaped apostrophes within strings:
4231 (setq-local syntax-propertize-function
4232 sql--syntax-propertize-escaped-apostrophe)
4213 ;; Set syntax and font-face highlighting 4233 ;; Set syntax and font-face highlighting
4214 ;; Catch changes to sql-product and highlight accordingly 4234 ;; Catch changes to sql-product and highlight accordingly
4215 (sql-set-product (or sql-product 'ansi)) ; Fixes bug#13591 4235 (sql-set-product (or sql-product 'ansi)) ; Fixes bug#13591