]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/sh-script.el (sh-font-lock-paren): Don't burp at BOB.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 29 Aug 2012 18:33:35 +0000 (14:33 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 29 Aug 2012 18:33:35 +0000 (14:33 -0400)
Fixes: debbugs:12222
lisp/ChangeLog
lisp/progmodes/sh-script.el

index 4ef437213a0e86859abbaedf0b70587d9d9fb4c5..0112dad334414fc0dd12b85acdb3d13c825a208e 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/sh-script.el (sh-font-lock-paren): Don't burp at BOB
+       (bug#12222).
+
 2012-08-27  Leo Liu  <sdl.web@gmail.com>
 
        * progmodes/sh-script.el (sh-dynamic-complete-functions): Adapt to
index 2d0cdeaeeaeeaed29f9317125042fbdac69ebfd9..d9f4678e6a59528fd62fe3f118245c695111dc38 100644 (file)
@@ -1064,21 +1064,22 @@ subshells can nest."
               (backward-char 1))
             (when (eq (char-before) ?|)
               (backward-char 1) t)))
-      (when (progn (backward-char 2)
-                   (if (> start (line-end-position))
-                       (put-text-property (point) (1+ start)
-                                          'syntax-multiline t))
-                   ;; FIXME: The `in' may just be a random argument to
-                   ;; a normal command rather than the real `in' keyword.
-                   ;; I.e. we should look back to try and find the
-                   ;; corresponding `case'.
-                   (and (looking-at ";[;&]\\|\\_<in")
-                        ;; ";; esac )" is a case that looks like a case-pattern
-                        ;; but it's really just a close paren after a case
-                        ;; statement.  I.e. if we skipped over `esac' just now,
-                        ;; we're not looking at a case-pattern.
-                        (not (looking-at "..[ \t\n]+esac[^[:word:]_]"))))
-        sh-st-punc))))
+      (and (> (point) (1+ (point-min)))
+           (progn (backward-char 2)
+                  (if (> start (line-end-position))
+                      (put-text-property (point) (1+ start)
+                                         'syntax-multiline t))
+                  ;; FIXME: The `in' may just be a random argument to
+                  ;; a normal command rather than the real `in' keyword.
+                  ;; I.e. we should look back to try and find the
+                  ;; corresponding `case'.
+                  (and (looking-at ";[;&]\\|\\_<in")
+                       ;; ";; esac )" is a case that looks like a case-pattern
+                       ;; but it's really just a close paren after a case
+                       ;; statement.  I.e. if we skipped over `esac' just now,
+                       ;; we're not looking at a case-pattern.
+                       (not (looking-at "..[ \t\n]+esac[^[:word:]_]"))))
+           sh-st-punc))))
 
 (defun sh-font-lock-backslash-quote ()
   (if (eq (save-excursion (nth 3 (syntax-ppss (match-beginning 0)))) ?\')