branch: externals/po-mode
commit 25eb1bdca30ed25d2e5d51b9feeb28a3faff51ec
Author: Bruno Haible <[email protected]>
Commit: Bruno Haible <[email protected]>

    po-mode: Fix syntax highlighting of comment lines with double-quotes.
    
    Reported by Vincent Lefèvre <[email protected]> in
    <https://lists.gnu.org/archive/html/bug-gettext/2020-06/msg00000.html>.
    
    * gettext-tools/emacs/po-mode.el (po-mode-version-string): Bump.
    (po-font-lock-keywords): Move the rules that recognize comments to the
    beginning.
---
 po-mode.el | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/po-mode.el b/po-mode.el
index f05b0f420a..e04428772c 100644
--- a/po-mode.el
+++ b/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 <[email protected]>
@@ -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.")
 

Reply via email to