+2012-10-31 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/sh-script.el (sh--inside-arithmetic-expression): New func.
+ (sh-font-lock-open-heredoc): Use it (bug#12770).
+
2012-10-30 Glenn Morris <rgm@gnu.org>
* emacs-lisp/cl-extra.el (cl-mapc): Add autoload cookie. Doc fix.
(concat "<<-?\\s-*\\\\?\\(\\(?:['\"][^'\"]+['\"]\\|\\sw\\|[-/~._]\\)+\\)"
sh-escaped-line-re "\\(\n\\)")))
+(defun sh--inside-arithmetic-expression (pos)
+ (save-excursion
+ (let ((ppss (syntax-ppss pos)))
+ (when (nth 1 ppss)
+ (goto-char (nth 1 ppss))
+ (and (eq ?\( (char-after))
+ (eq ?\( (char-before))
+ (eq ?\$ (char-before (1- (point)))))))))
+
(defun sh-font-lock-open-heredoc (start string eol)
"Determine the syntax of the \\n after a <<EOF.
START is the position of <<.
be indented (i.e. a <<- was used rather than just <<).
Point is at the beginning of the next line."
(unless (or (memq (char-before start) '(?< ?>))
- (sh-in-comment-or-string start))
+ (sh-in-comment-or-string start)
+ (sh--inside-arithmetic-expression start))
;; We're looking at <<STRING, so we add "^STRING$" to the syntactic
;; font-lock keywords to detect the end of this here document.
(let ((str (replace-regexp-in-string "['\"]" "" string))
--- /dev/null
+#!/usr/bin/perl
+# -*- eval: (bug-reference-mode 1) -*-
+
+$fileType_filesButNot # bug#12373?
+ = join( '|', map { quotemeta($_).'$' } @{$fileType->{filesButNot}} );