]> git.eshelyaron.com Git - emacs.git/commitdiff
(sh-quoted-subshell): Make sure we don't mistake a closing " for an opening one.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 8 Aug 2006 15:09:26 +0000 (15:09 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 8 Aug 2006 15:09:26 +0000 (15:09 +0000)
lisp/ChangeLog
lisp/progmodes/sh-script.el

index ceff0ca111a8b66b942e12ebed5c96b0506d2b71..8abe7e99f71320289a204239d329b76c3c263bbf 100644 (file)
@@ -1,11 +1,17 @@
+2006-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/sh-script.el (sh-quoted-subshell): Make sure we don't
+       mistake a closing " for an opening one.
+
 2006-08-07  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * term/xterm.el (terminal-init-xterm): Add more key bindings.
 
 2006-08-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * complete.el (PC-do-completion): Strip out completion-ignored-extensions
-       before checking whether there are multiple completions.
+       * complete.el (PC-do-completion): Filter out completions matching
+       completion-ignored-extensions before checking whether there are
+       multiple completions.
        Don't use `list' unnecessarily when building completion tables.
 
 2006-08-06  Richard Stallman  <rms@gnu.org>
index 6098c8be06703ab096b65e9d8ac41718b94f7151..f828c36917bff1bda198d6d5dc0d82b94d3787f0 100644 (file)
@@ -986,7 +986,9 @@ subshells can nest."
   ;; FIXME: This can (and often does) match multiple lines, yet it makes no
   ;; effort to handle multiline cases correctly, so it ends up being
   ;; rather flakey.
-  (when (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t)
+  (when (and (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t)
+             ;; Make sure the " we matched is an opening quote.
+            (eq ?\" (nth 3 (syntax-ppss))))
     ;; bingo we have a $( or a ` inside a ""
     (let ((char (char-after (point)))
           (continue t)
@@ -1081,9 +1083,6 @@ This is used to flag quote characters in subshell constructs inside strings
     ("\\(\\\\\\)'" 1 ,sh-st-punc)
     ;; Make sure $@ and @? are correctly recognized as sexps.
     ("\\$\\([?@]\\)" 1 ,sh-st-symbol)
-    ;; highlight (possibly nested) subshells inside "" quoted regions correctly.
-    (sh-quoted-subshell
-     (1 (sh-apply-quoted-subshell) t t))
     ;; Find HEREDOC starters and add a corresponding rule for the ender.
     (sh-font-lock-here-doc
      (2 (sh-font-lock-open-heredoc
@@ -1093,7 +1092,11 @@ This is used to flag quote characters in subshell constructs inside strings
          (and (match-beginning 3) (/= (match-beginning 3) (match-end 3))))
       nil t))
     ;; Distinguish the special close-paren in `case'.
-    (")" 0 (sh-font-lock-paren (match-beginning 0)))))
+    (")" 0 (sh-font-lock-paren (match-beginning 0)))
+    ;; highlight (possibly nested) subshells inside "" quoted regions correctly.
+    ;; This should be at the very end because it uses syntax-ppss.
+    (sh-quoted-subshell
+     (1 (sh-apply-quoted-subshell) t t))))
 
 (defun sh-font-lock-syntactic-face-function (state)
   (let ((q (nth 3 state)))