aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
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
parent80d7f710f2fab902e46aa3fddb8e1c1795420af3 (diff)
parent8e82baf5a730ff542118ddba5b76afdc1db643f6 (diff)
downloademacs-12a982d9789052d8e85efcacb4b311f4876c882a.tar.gz
emacs-12a982d9789052d8e85efcacb4b311f4876c882a.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cperl-mode.el45
-rw-r--r--lisp/progmodes/project.el8
-rw-r--r--lisp/progmodes/sh-script.el2
-rw-r--r--lisp/progmodes/sql.el20
4 files changed, 50 insertions, 25 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index cdbb59a5add..6122caf5189 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -3560,19 +3560,18 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3560 "\\(\\`\n?\\|^\n\\)=" ; POD 3560 "\\(\\`\n?\\|^\n\\)=" ; POD
3561 "\\|" 3561 "\\|"
3562 ;; One extra () before this: 3562 ;; One extra () before this:
3563 "<<~?" ; HERE-DOC 3563 "<<\\(~?\\)" ; HERE-DOC, indented-p = capture 2
3564 "\\(" ; 1 + 1 3564 "\\(" ; 2 + 1
3565 ;; First variant "BLAH" or just ``. 3565 ;; First variant "BLAH" or just ``.
3566 "[ \t]*" ; Yes, whitespace is allowed! 3566 "[ \t]*" ; Yes, whitespace is allowed!
3567 "\\([\"'`]\\)" ; 2 + 1 = 3 3567 "\\([\"'`]\\)" ; 3 + 1 = 4
3568 "\\([^\"'`\n]*\\)" ; 3 + 1 3568 "\\([^\"'`\n]*\\)" ; 4 + 1
3569 "\\3" 3569 "\\4"
3570 "\\|" 3570 "\\|"
3571 ;; Second variant: Identifier or \ID (same as 'ID') or empty 3571 ;; Second variant: Identifier or \ID (same as 'ID') or empty
3572 "\\\\?\\(\\([a-zA-Z_][a-zA-Z_0-9]*\\)?\\)" ; 4 + 1, 5 + 1 3572 "\\\\?\\(\\([a-zA-Z_][a-zA-Z_0-9]*\\)?\\)" ; 5 + 1, 6 + 1
3573 ;; Do not have <<= or << 30 or <<30 or << $blah. 3573 ;; Do not have <<= or << 30 or <<30 or << $blah.
3574 ;; "\\([^= \t0-9$@%&]\\|[ \t]+[^ \t\n0-9$@%&]\\)" ; 6 + 1 3574 ;; "\\([^= \t0-9$@%&]\\|[ \t]+[^ \t\n0-9$@%&]\\)" ; 6 + 1
3575 "\\(\\)" ; To preserve count of pars :-( 6 + 1
3576 "\\)" 3575 "\\)"
3577 "\\|" 3576 "\\|"
3578 ;; 1+6 extra () before this: 3577 ;; 1+6 extra () before this:
@@ -3762,11 +3761,11 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3762 ;; ;; "\\([^= \t0-9$@%&]\\|[ \t]+[^ \t\n0-9$@%&]\\)" ; 6 + 1 3761 ;; ;; "\\([^= \t0-9$@%&]\\|[ \t]+[^ \t\n0-9$@%&]\\)" ; 6 + 1
3763 ;; "\\(\\)" ; To preserve count of pars :-( 6 + 1 3762 ;; "\\(\\)" ; To preserve count of pars :-( 6 + 1
3764 ;; "\\)" 3763 ;; "\\)"
3765 ((match-beginning 2) ; 1 + 1 3764 ((match-beginning 3) ; 2 + 1
3766 (setq b (point) 3765 (setq b (point)
3767 tb (match-beginning 0) 3766 tb (match-beginning 0)
3768 c (and ; not HERE-DOC 3767 c (and ; not HERE-DOC
3769 (match-beginning 5) 3768 (match-beginning 6)
3770 (save-match-data 3769 (save-match-data
3771 (or (looking-at "[ \t]*(") ; << function_call() 3770 (or (looking-at "[ \t]*(") ; << function_call()
3772 (save-excursion ; 1 << func_name, or $foo << 10 3771 (save-excursion ; 1 << func_name, or $foo << 10
@@ -3793,17 +3792,17 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3793 (looking-at "\\(printf?\\|say\\|system\\|exec\\|sort\\)\\>"))) 3792 (looking-at "\\(printf?\\|say\\|system\\|exec\\|sort\\)\\>")))
3794 (error t))))))) 3793 (error t)))))))
3795 (error nil))) ; func(<<EOF) 3794 (error nil))) ; func(<<EOF)
3796 (and (not (match-beginning 6)) ; Empty 3795 (and (not (match-beginning 7)) ; Empty
3797 (looking-at 3796 (looking-at
3798 "[ \t]*[=0-9$@%&(]")))))) 3797 "[ \t]*[=0-9$@%&(]"))))))
3799 (if c ; Not here-doc 3798 (if c ; Not here-doc
3800 nil ; Skip it. 3799 nil ; Skip it.
3801 (setq c (match-end 2)) ; 1 + 1 3800 (setq c (match-end 3)) ; 2 + 1
3802 (if (match-beginning 5) ;4 + 1 3801 (if (match-beginning 6) ;6 + 1
3803 (setq b1 (match-beginning 5) ; 4 + 1 3802 (setq b1 (match-beginning 6) ; 5 + 1
3804 e1 (match-end 5)) ; 4 + 1 3803 e1 (match-end 6)) ; 5 + 1
3805 (setq b1 (match-beginning 4) ; 3 + 1 3804 (setq b1 (match-beginning 5) ; 4 + 1
3806 e1 (match-end 4))) ; 3 + 1 3805 e1 (match-end 5))) ; 4 + 1
3807 (setq tag (buffer-substring b1 e1) 3806 (setq tag (buffer-substring b1 e1)
3808 qtag (regexp-quote tag)) 3807 qtag (regexp-quote tag))
3809 (cond (cperl-pod-here-fontify 3808 (cond (cperl-pod-here-fontify
@@ -3818,8 +3817,10 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3818 (setq b (point)) 3817 (setq b (point))
3819 ;; We do not search to max, since we may be called from 3818 ;; We do not search to max, since we may be called from
3820 ;; some hook of fontification, and max is random 3819 ;; some hook of fontification, and max is random
3821 (or (and (re-search-forward (concat "^[ \t]*" qtag "$") 3820 (or (and (re-search-forward
3822 stop-point 'toend) 3821 (concat "^" (when (equal (match-string 2) "~") "[ \t]*")
3822 qtag "$")
3823 stop-point 'toend)
3823 ;;;(eq (following-char) ?\n) ; XXXX WHY??? 3824 ;;;(eq (following-char) ?\n) ; XXXX WHY???
3824 ) 3825 )
3825 (progn ; Pretend we matched at the end 3826 (progn ; Pretend we matched at the end
@@ -5752,7 +5753,7 @@ indentation and initial hashes. Behaves usually outside of comment."
5752 (if (eq (char-after (match-beginning 2)) ?%) 5753 (if (eq (char-after (match-beginning 2)) ?%)
5753 'cperl-hash-face 5754 'cperl-hash-face
5754 'cperl-array-face) 5755 'cperl-array-face)
5755 t) ; arrays and hashes 5756 nil) ; arrays and hashes
5756 ("\\(\\([$@]+\\)[a-zA-Z_:][a-zA-Z0-9_:]*\\)[ \t]*\\([[{]\\)" 5757 ("\\(\\([$@]+\\)[a-zA-Z_:][a-zA-Z0-9_:]*\\)[ \t]*\\([[{]\\)"
5757 1 5758 1
5758 (if (= (- (match-end 2) (match-beginning 2)) 1) 5759 (if (= (- (match-end 2) (match-beginning 2)) 1)
@@ -6499,9 +6500,10 @@ If optional argument ALL is `recursive', will process Perl files
6499in subdirectories too." 6500in subdirectories too."
6500 (interactive) 6501 (interactive)
6501 (let ((cmd "etags") 6502 (let ((cmd "etags")
6502 (args '("-l" "none" "-r" 6503 (args `("-l" "none" "-r"
6503 ;; 1=fullname 2=package? 3=name 4=proto? 5=attrs? (VERY APPROX!) 6504 ;; 1=fullname 2=package? 3=name 4=proto? 5=attrs? (VERY APPROX!)
6504 "/\\<" cperl-sub-regexp "[ \\t]+\\(\\([a-zA-Z0-9:_]*::\\)?\\([a-zA-Z0-9_]+\\)\\)[ \\t]*\\(([^()]*)[ \t]*\\)?\\([ \t]*:[^#{;]*\\)?\\([{#]\\|$\\)/\\3/" 6505 ,(concat
6506 "/\\<" cperl-sub-regexp "[ \\t]+\\(\\([a-zA-Z0-9:_]*::\\)?\\([a-zA-Z0-9_]+\\)\\)[ \\t]*\\(([^()]*)[ \t]*\\)?\\([ \t]*:[^#{;]*\\)?\\([{#]\\|$\\)/\\3/")
6505 "-r" 6507 "-r"
6506 "/\\<package[ \\t]+\\(\\([a-zA-Z0-9:_]*::\\)?\\([a-zA-Z0-9_]+\\)\\)[ \\t]*\\([#;]\\|$\\)/\\1/" 6508 "/\\<package[ \\t]+\\(\\([a-zA-Z0-9:_]*::\\)?\\([a-zA-Z0-9_]+\\)\\)[ \\t]*\\([#;]\\|$\\)/\\1/"
6507 "-r" 6509 "-r"
@@ -6786,6 +6788,7 @@ Use as
6786 (or topdir 6788 (or topdir
6787 (setq topdir default-directory)) 6789 (setq topdir default-directory))
6788 (let ((tags-file-name "TAGS") 6790 (let ((tags-file-name "TAGS")
6791 (inhibit-read-only t)
6789 (case-fold-search nil) 6792 (case-fold-search nil)
6790 xs rel) 6793 xs rel)
6791 (save-excursion 6794 (save-excursion
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 51b9347bb93..b6161351f0b 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1166,7 +1166,9 @@ Save the result in `project-list-file' if the list of projects has changed."
1166 (project--ensure-read-project-list) 1166 (project--ensure-read-project-list)
1167 (let ((dir (project-root pr))) 1167 (let ((dir (project-root pr)))
1168 (unless (equal (caar project--list) dir) 1168 (unless (equal (caar project--list) dir)
1169 (setq project--list (assoc-delete-all dir project--list)) 1169 (dolist (ent project--list)
1170 (when (equal dir (car ent))
1171 (setq project--list (delq ent project--list))))
1170 (push (list dir) project--list) 1172 (push (list dir) project--list)
1171 (project--write-project-list)))) 1173 (project--write-project-list))))
1172 1174
@@ -1176,8 +1178,8 @@ If the directory was in the list before the removal, save the
1176result in `project-list-file'. Announce the project's removal 1178result in `project-list-file'. Announce the project's removal
1177from the list." 1179from the list."
1178 (project--ensure-read-project-list) 1180 (project--ensure-read-project-list)
1179 (when (assoc pr-dir project--list) 1181 (when-let ((ent (assoc pr-dir project--list)))
1180 (setq project--list (assoc-delete-all pr-dir project--list)) 1182 (setq project--list (delq ent project--list))
1181 (message "Project `%s' not found; removed from list" pr-dir) 1183 (message "Project `%s' not found; removed from list" pr-dir)
1182 (project--write-project-list))) 1184 (project--write-project-list)))
1183 1185
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 044d7820ee3..5a47594878e 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -838,7 +838,7 @@ See `sh-feature'.")
838 font-lock-variable-name-face)) 838 font-lock-variable-name-face))
839 839
840 (rc sh-append es) 840 (rc sh-append es)
841 (bash sh-append sh ("\\$(\\(\\sw+\\)" (1 'sh-quoted-exec t) )) 841 (bash sh-append sh ("\\$(\\([^)\n]+\\)" (1 'sh-quoted-exec t) ))
842 (sh sh-append shell 842 (sh sh-append shell
843 ;; Variable names. 843 ;; Variable names.
844 ("\\$\\({#?\\)?\\([[:alpha:]_][[:alnum:]_]*\\|[-#?@!]\\)" 2 844 ("\\$\\({#?\\)?\\([[:alpha:]_][[:alnum:]_]*\\|[-#?@!]\\)" 2
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