From: Dave Love Date: Mon, 2 Nov 1998 19:53:05 +0000 (+0000) Subject: Fix for fontification of strings lost X-Git-Tag: emacs-20.4~1333 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0f1057e9e8c9aa43c00b59b4752f9b3ce7927144;p=emacs.git Fix for fontification of strings lost somehow: (fortran-fontify-string): New function. (fortran-font-lock-keywords-1): Use it. --- diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 292d92552a9..af5f6db9097 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -255,6 +255,13 @@ format style.") (defconst fortran-font-lock-keywords-3 nil "Gaudy level highlighting for Fortran mode.") +(defun fortran-fontify-string (limit) + (let ((match (match-string 1))) + (cond ((string= "'" match) + (re-search-forward "\\([^'\n]*'?\\)" limit)) + ((string= "\"" match) + (re-search-forward "\\([^\"\n]*\"?\\)" limit))))) + (let ((comment-chars "c!*") (fortran-type-types ; (eval-when-compile @@ -295,7 +302,9 @@ format style.") (list (concat "^[^" comment-chars "\t\n]" (make-string 71 ?.) "\\(.*\\)") '(1 font-lock-comment-face)) - '("\\(\\s\"\\)\"[^\n]*\\1?" . font-lock-string-face) + '("\\(\\s\"\\)" ; single- or double-quoted string + (1 font-lock-string-face) + (fortran-fontify-string nil nil (1 font-lock-string-face))) ;; ;; Program, subroutine and function declarations, plus calls. (list (concat "\\<\\(block[ \t]*data\\|call\\|entry\\|function\\|"