diff options
| author | Stefan Monnier | 2007-06-18 20:10:06 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-06-18 20:10:06 +0000 |
| commit | 74ab576e4239e36191cbe7be28c0baec85916f90 (patch) | |
| tree | bc68c7feed5b9ef64b860fbaa38f292fca427ed7 | |
| parent | 92335d2a4a5c7fefb8a2f1214b1164cd9e9b7acc (diff) | |
| download | emacs-74ab576e4239e36191cbe7be28c0baec85916f90.tar.gz emacs-74ab576e4239e36191cbe7be28c0baec85916f90.zip | |
(sh-font-lock-paren): Mark the relevant text with font-lock-multiline.
| -rw-r--r-- | lisp/progmodes/sh-script.el | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index b29cf7fb141..4eea5e4925d 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -171,10 +171,6 @@ | |||
| 171 | ;; disadvantages: | 171 | ;; disadvantages: |
| 172 | ;; 1. We need to scan the buffer to find which ")" symbols belong to a | 172 | ;; 1. We need to scan the buffer to find which ")" symbols belong to a |
| 173 | ;; case alternative, to find any here documents, and handle "$#". | 173 | ;; case alternative, to find any here documents, and handle "$#". |
| 174 | ;; 2. Setting the text property makes the buffer modified. If the | ||
| 175 | ;; buffer is read-only buffer we have to cheat and bypass the read-only | ||
| 176 | ;; status. This is for cases where the buffer started read-only buffer | ||
| 177 | ;; but the user issued `toggle-read-only'. | ||
| 178 | ;; | 174 | ;; |
| 179 | ;; Bugs | 175 | ;; Bugs |
| 180 | ;; ---- | 176 | ;; ---- |
| @@ -183,6 +179,16 @@ | |||
| 183 | ;; | 179 | ;; |
| 184 | ;; - `sh-learn-buffer-indent' is extremely slow. | 180 | ;; - `sh-learn-buffer-indent' is extremely slow. |
| 185 | ;; | 181 | ;; |
| 182 | ;; - "case $x in y) echo ;; esac)" the last ) is mis-identified as being | ||
| 183 | ;; part of a case-pattern. You need to add a semi-colon after "esac" to | ||
| 184 | ;; coerce sh-script into doing the right thing. | ||
| 185 | ;; | ||
| 186 | ;; - "echo $z in ps | head)" the last ) is mis-identified as being part of | ||
| 187 | ;; a case-pattern. You need to put the "in" between quotes to coerce | ||
| 188 | ;; sh-script into doing the right thing. | ||
| 189 | ;; | ||
| 190 | ;; - A line starting with "}>foo" is not indented like "} >foo". | ||
| 191 | ;; | ||
| 186 | ;; Richard Sharman <rsharman@pobox.com> June 1999. | 192 | ;; Richard Sharman <rsharman@pobox.com> June 1999. |
| 187 | 193 | ||
| 188 | ;;; Code: | 194 | ;;; Code: |
| @@ -1052,7 +1058,18 @@ subshells can nest." | |||
| 1052 | (backward-char 1)) | 1058 | (backward-char 1)) |
| 1053 | (when (eq (char-before) ?|) | 1059 | (when (eq (char-before) ?|) |
| 1054 | (backward-char 1) t))) | 1060 | (backward-char 1) t))) |
| 1055 | (when (save-excursion (backward-char 2) (looking-at ";;\\|in")) | 1061 | ;; FIXME: ";; esac )" is a case that looks like a case-pattern but it's |
| 1062 | ;; really just a close paren after a case statement. I.e. if we skipped | ||
| 1063 | ;; over `esac' just now, we're not looking at a case-pattern. | ||
| 1064 | (when (progn (backward-char 2) | ||
| 1065 | (if (> start (line-end-position)) | ||
| 1066 | (put-text-property (point) (1+ start) | ||
| 1067 | 'font-lock-multiline t)) | ||
| 1068 | ;; FIXME: The `in' may just be a random argument to | ||
| 1069 | ;; a normal command rather than the real `in' keyword. | ||
| 1070 | ;; I.e. we should look back to try and find the | ||
| 1071 | ;; corresponding `case'. | ||
| 1072 | (looking-at ";;\\|in")) | ||
| 1056 | sh-st-punc))) | 1073 | sh-st-punc))) |
| 1057 | 1074 | ||
| 1058 | (defun sh-font-lock-backslash-quote () | 1075 | (defun sh-font-lock-backslash-quote () |