aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/sh-script.el
diff options
context:
space:
mode:
authorPaul Eggert2011-08-02 22:05:38 -0700
committerPaul Eggert2011-08-02 22:05:38 -0700
commit9a70f03d70e44db2ec9c6d2952cb8a1deae15000 (patch)
treec0efd5c0a208640c0a883f4566df1b40caa3aaad /lisp/progmodes/sh-script.el
parent29c8a348c5c9f326af54a3d30f69cde98fe300bb (diff)
downloademacs-9a70f03d70e44db2ec9c6d2952cb8a1deae15000.tar.gz
emacs-9a70f03d70e44db2ec9c6d2952cb8a1deae15000.zip
Merge from trunk.
Diffstat (limited to 'lisp/progmodes/sh-script.el')
-rw-r--r--lisp/progmodes/sh-script.el64
1 files changed, 32 insertions, 32 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 258f9be9237..31a4fbaef4d 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1028,45 +1028,45 @@ subshells can nest."
1028 1028
1029(defun sh-font-lock-paren (start) 1029(defun sh-font-lock-paren (start)
1030 (unless (nth 8 (syntax-ppss)) 1030 (unless (nth 8 (syntax-ppss))
1031 (save-excursion 1031 (save-excursion
1032 (goto-char start) 1032 (goto-char start)
1033 ;; Skip through all patterns 1033 ;; Skip through all patterns
1034 (while 1034 (while
1035 (progn 1035 (progn
1036 (while 1036 (while
1037 (progn 1037 (progn
1038 (forward-comment (- (point-max))) 1038 (forward-comment (- (point-max)))
1039 (when (and (eolp) (sh-is-quoted-p (point))) 1039 (when (and (eolp) (sh-is-quoted-p (point)))
1040 (forward-char -1) 1040 (forward-char -1)
1041 t))) 1041 t)))
1042 ;; Skip through one pattern 1042 ;; Skip through one pattern
1043 (while 1043 (while
1044 (or (/= 0 (skip-syntax-backward "w_")) 1044 (or (/= 0 (skip-syntax-backward "w_"))
1045 (/= 0 (skip-chars-backward "-$=?[]*@/\\\\")) 1045 (/= 0 (skip-chars-backward "-$=?[]*@/\\\\"))
1046 (and (sh-is-quoted-p (1- (point))) 1046 (and (sh-is-quoted-p (1- (point)))
1047 (goto-char (- (point) 2))) 1047 (goto-char (- (point) 2)))
1048 (when (memq (char-before) '(?\" ?\' ?\})) 1048 (when (memq (char-before) '(?\" ?\' ?\}))
1049 (condition-case nil (progn (backward-sexp 1) t) 1049 (condition-case nil (progn (backward-sexp 1) t)
1050 (error nil))))) 1050 (error nil)))))
1051 ;; Patterns can be preceded by an open-paren (Bug#1320). 1051 ;; Patterns can be preceded by an open-paren (Bug#1320).
1052 (if (eq (char-before (point)) ?\() 1052 (if (eq (char-before (point)) ?\()
1053 (backward-char 1)) 1053 (backward-char 1))
1054 (while (progn 1054 (while (progn
1055 (forward-comment (- (point-max))) 1055 (forward-comment (- (point-max)))
1056 ;; Maybe we've bumped into an escaped newline. 1056 ;; Maybe we've bumped into an escaped newline.
1057 (sh-is-quoted-p (point))) 1057 (sh-is-quoted-p (point)))
1058 (backward-char 1)) 1058 (backward-char 1))
1059 (when (eq (char-before) ?|) 1059 (when (eq (char-before) ?|)
1060 (backward-char 1) t))) 1060 (backward-char 1) t)))
1061 (when (progn (backward-char 2) 1061 (when (progn (backward-char 2)
1062 (if (> start (line-end-position)) 1062 (if (> start (line-end-position))
1063 (put-text-property (point) (1+ start) 1063 (put-text-property (point) (1+ start)
1064 'syntax-multiline t)) 1064 'syntax-multiline t))
1065 ;; FIXME: The `in' may just be a random argument to 1065 ;; FIXME: The `in' may just be a random argument to
1066 ;; a normal command rather than the real `in' keyword. 1066 ;; a normal command rather than the real `in' keyword.
1067 ;; I.e. we should look back to try and find the 1067 ;; I.e. we should look back to try and find the
1068 ;; corresponding `case'. 1068 ;; corresponding `case'.
1069 (and (looking-at ";[;&]\\|in") 1069 (and (looking-at ";[;&]\\|\\_<in")
1070 ;; ";; esac )" is a case that looks like a case-pattern 1070 ;; ";; esac )" is a case that looks like a case-pattern
1071 ;; but it's really just a close paren after a case 1071 ;; but it's really just a close paren after a case
1072 ;; statement. I.e. if we skipped over `esac' just now, 1072 ;; statement. I.e. if we skipped over `esac' just now,