From: Bruno Haible Date: Sat, 6 Jun 2020 14:02:22 +0000 (+0200) Subject: po-mode: Fix syntax highlighting of comment lines with double-quotes. X-Git-Tag: v0.21~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71021c8633b276772cb75ec7705ddb2845df1ff9;p=thirdparty%2Fgettext.git po-mode: Fix syntax highlighting of comment lines with double-quotes. 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. --- 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.")