From 0f1057e9e8c9aa43c00b59b4752f9b3ce7927144 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Mon, 2 Nov 1998 19:53:05 +0000 Subject: [PATCH] Fix for fontification of strings lost somehow: (fortran-fontify-string): New function. (fortran-font-lock-keywords-1): Use it. --- lisp/progmodes/fortran.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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\\|" -- 2.39.2