From 71021c8633b276772cb75ec7705ddb2845df1ff9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 6 Jun 2020 16:02:22 +0200 Subject: [PATCH] po-mode: Fix syntax highlighting of comment lines with double-quotes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported by Vincent Lefèvre in . * gettext-tools/emacs/po-mode.el (po-mode-version-string): Bump. (po-font-lock-keywords): Move the rules that recognize comments to the beginning. --- gettext-tools/emacs/po-mode.el | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/gettext-tools/emacs/po-mode.el b/gettext-tools/emacs/po-mode.el index f05b0f420..e04428772 100644 --- a/gettext-tools/emacs/po-mode.el +++ b/gettext-tools/emacs/po-mode.el @@ -1,6 +1,6 @@ ;;; po-mode.el --- major mode for GNU gettext PO files -;; Copyright (C) 1995-2002, 2005-2008, 2010, 2013-2017, 2019 Free Software +;; Copyright (C) 1995-2002, 2005-2008, 2010, 2013-2017, 2019-2020 Free Software ;; Foundation, Inc. ;; Authors: François Pinard @@ -63,7 +63,7 @@ ;;; Code: -(defconst po-mode-version-string "2.26" "\ +(defconst po-mode-version-string "2.27" "\ Version number of this version of po-mode.el.") ;;; Emacs portability matters - part I. @@ -908,15 +908,12 @@ M-S Ignore path M-A Ignore PO file *M-L Ignore lexicon ;; Font lock based highlighting code. (defconst po-font-lock-keywords '( - ;; ("^\\(msgctxt \\|msgid \\|msgstr \\)?\"\\|\"$" . font-lock-keyword-face) - ;; (regexp-opt - ;; '("msgctxt " "msgid " "msgid_plural " "msgstr " "msgstr[0] " "msgstr[1] ")) - ("^\\(\\(msg\\(ctxt\\|id\\(_plural\\)?\\|str\\(\\[[0-9]\\]\\)?\\)\\) \\)?\"\\|\"$" - . font-lock-keyword-face) - ("\\\\.\\|%[*$-.0-9hjltuzL]*[a-zA-Z]" . font-lock-variable-name-face) ("^# .*\\|^#[:,]?" . font-lock-comment-face) ("^#:\\(.*\\)" 1 font-lock-reference-face) ("^#,\\(.*\\)" 1 font-lock-function-name-face) + ("^\\(\\(msg\\(ctxt\\|id\\(_plural\\)?\\|str\\(\\[[0-9]\\]\\)?\\)\\) \\)?\"\\|\"$" + . font-lock-keyword-face) + ("\\\\.\\|%[*$-.0-9hjltuzL]*[a-zA-Z]" . font-lock-variable-name-face) ) "Additional expressions to highlight in PO mode.") -- 2.47.3