diff options
| author | Stefan Monnier | 2012-08-29 14:33:35 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-08-29 14:33:35 -0400 |
| commit | 64f8c4bd616e110defc092ca8370739e34bbe183 (patch) | |
| tree | 6eff0f126ec583059f62be0a4b5149c3641f76ad | |
| parent | 806f0cc7302bd1dacfad8366f67a97e9bfbc8fc9 (diff) | |
| download | emacs-64f8c4bd616e110defc092ca8370739e34bbe183.tar.gz emacs-64f8c4bd616e110defc092ca8370739e34bbe183.zip | |
* lisp/progmodes/sh-script.el (sh-font-lock-paren): Don't burp at BOB.
Fixes: debbugs:12222
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 31 |
2 files changed, 21 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4ef437213a0..0112dad3344 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-08-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * progmodes/sh-script.el (sh-font-lock-paren): Don't burp at BOB | ||
| 4 | (bug#12222). | ||
| 5 | |||
| 1 | 2012-08-27 Leo Liu <sdl.web@gmail.com> | 6 | 2012-08-27 Leo Liu <sdl.web@gmail.com> |
| 2 | 7 | ||
| 3 | * progmodes/sh-script.el (sh-dynamic-complete-functions): Adapt to | 8 | * progmodes/sh-script.el (sh-dynamic-complete-functions): Adapt to |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 2d0cdeaeeae..d9f4678e6a5 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1064,21 +1064,22 @@ subshells can nest." | |||
| 1064 | (backward-char 1)) | 1064 | (backward-char 1)) |
| 1065 | (when (eq (char-before) ?|) | 1065 | (when (eq (char-before) ?|) |
| 1066 | (backward-char 1) t))) | 1066 | (backward-char 1) t))) |
| 1067 | (when (progn (backward-char 2) | 1067 | (and (> (point) (1+ (point-min))) |
| 1068 | (if (> start (line-end-position)) | 1068 | (progn (backward-char 2) |
| 1069 | (put-text-property (point) (1+ start) | 1069 | (if (> start (line-end-position)) |
| 1070 | 'syntax-multiline t)) | 1070 | (put-text-property (point) (1+ start) |
| 1071 | ;; FIXME: The `in' may just be a random argument to | 1071 | 'syntax-multiline t)) |
| 1072 | ;; a normal command rather than the real `in' keyword. | 1072 | ;; FIXME: The `in' may just be a random argument to |
| 1073 | ;; I.e. we should look back to try and find the | 1073 | ;; a normal command rather than the real `in' keyword. |
| 1074 | ;; corresponding `case'. | 1074 | ;; I.e. we should look back to try and find the |
| 1075 | (and (looking-at ";[;&]\\|\\_<in") | 1075 | ;; corresponding `case'. |
| 1076 | ;; ";; esac )" is a case that looks like a case-pattern | 1076 | (and (looking-at ";[;&]\\|\\_<in") |
| 1077 | ;; but it's really just a close paren after a case | 1077 | ;; ";; esac )" is a case that looks like a case-pattern |
| 1078 | ;; statement. I.e. if we skipped over `esac' just now, | 1078 | ;; but it's really just a close paren after a case |
| 1079 | ;; we're not looking at a case-pattern. | 1079 | ;; statement. I.e. if we skipped over `esac' just now, |
| 1080 | (not (looking-at "..[ \t\n]+esac[^[:word:]_]")))) | 1080 | ;; we're not looking at a case-pattern. |
| 1081 | sh-st-punc)))) | 1081 | (not (looking-at "..[ \t\n]+esac[^[:word:]_]")))) |
| 1082 | sh-st-punc)))) | ||
| 1082 | 1083 | ||
| 1083 | (defun sh-font-lock-backslash-quote () | 1084 | (defun sh-font-lock-backslash-quote () |
| 1084 | (if (eq (save-excursion (nth 3 (syntax-ppss (match-beginning 0)))) ?\') | 1085 | (if (eq (save-excursion (nth 3 (syntax-ppss (match-beginning 0)))) ?\') |