]> git.eshelyaron.com Git - emacs.git/commitdiff
(sh-font-lock-close-heredoc): check the args for being non-nil
authorSam Steingold <sds@gnu.org>
Fri, 26 Oct 2001 13:54:45 +0000 (13:54 +0000)
committerSam Steingold <sds@gnu.org>
Fri, 26 Oct 2001 13:54:45 +0000 (13:54 +0000)
lisp/ChangeLog
lisp/progmodes/sh-script.el

index c61548b5a6c2f0b65b9ff8f8dcdbf847fbee7c6f..abd2605c98fd9231363fd335b3b47c59898e9138 100644 (file)
@@ -1,3 +1,9 @@
+2001-10-26  Sam Steingold  <sds@gnu.org>
+
+       * progmodes/sh-script.el (sh-font-lock-syntactic-keywords):
+       Protect the /= test by checking that the args are non-nil.
+       (sh-font-lock-close-heredoc): check eof for being non-nil.
+
 2001-10-26  Tomas Abrahamsson  <tab@lysator.liu.se>
 
        * textmodes/artist.el (artist-version): 1.2.4.
@@ -25,7 +31,7 @@
        `eval'.
        (numerous places): Add back-tick and tick around names in
        docstrings, fix punctuation in docstrings, remove trailing spaces.
-       
+
 2001-10-25  Sam Steingold  <sds@gnu.org>
 
        * add-log.el (add-log-always-start-new-record): New user option.
index 8c05826d7f44c455b3f25b4db631275cf20c059f..a3b95231774f16167153fe61a8ad9186108ce707 100644 (file)
@@ -828,7 +828,7 @@ See `sh-feature'.")
 (defun sh-font-lock-close-heredoc (bol eof indented)
   "Determine the syntax of the \\n after an EOF.
 If non-nil INDENTED indicates that the EOF was indented."
-  (let* ((eof-re (regexp-quote eof))
+  (let* ((eof-re (if eof (regexp-quote eof) ""))
          ;; A rough regexp that should find the opening <<EOF back.
         (sre (concat "<<\\(-?\\)\\s-*['\"\\]?"
                      ;; Use \s| to cheaply check it's an open-heredoc.
@@ -921,7 +921,8 @@ be indented (i.e. a <<- was used rather than just <<)."
         (match-beginning 0) (match-string 1)) nil t)
      (5 (sh-font-lock-close-heredoc
         (match-beginning 0) (match-string 4)
-         (/= (match-beginning 3) (match-end 3))) nil t))
+         (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)))))