]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix editing of plural forms.
authorBruno Haible <bruno@clisp.org>
Wed, 7 May 2008 22:56:13 +0000 (22:56 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:15:40 +0000 (12:15 +0200)
gettext-tools/misc/ChangeLog
gettext-tools/misc/po-mode.el

index 4442c044d04bd1fe71c0748213a9cb594c63a117..6d245f3bf70c6535105c26f5108f36c37e4d0af4 100644 (file)
@@ -1,3 +1,12 @@
+2008-05-07  Bruno Haible  <bruno@clisp.org>
+
+       Fix editing of plural forms.
+       * po-mode.el (po-mode-version-string): Bump to 2.11.
+       (po-any-msgstr-block-regexp): Must start with msgstr or msgstr[0];
+       needed for re-search-backward.
+       (po-get-msgstr-flavor): Set the point to po-start-of-msgstr-form, not
+       to the beginning of the line.
+
 2008-04-20  Bruno Haible  <bruno@clisp.org>
 
        * autopoint.in: Check that really all CVS directories are removed.
index 8042848e8f035147542fd8bcefbc6149e666ff8c..bd4853fb849c1aa36076b9b179312c08ec5d8e48 100644 (file)
@@ -1,6 +1,6 @@
 ;;; po-mode.el -- major mode for GNU gettext PO files
 
-;; Copyright (C) 1995-1999, 2000-2002, 2005-2007 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1999, 2000-2002, 2005-2008 Free Software Foundation, Inc.
 
 ;; Authors: François Pinard <pinard@iro.umontreal.ca>
 ;;          Greg McGary <gkm@magilla.cichlid.com>
@@ -64,7 +64,7 @@
 
 ;;; Code:
 \f
-(defconst po-mode-version-string "2.1" "\
+(defconst po-mode-version-string "2.11" "\
 Version number of this version of po-mode.el.")
 
 ;;; Emacs portability matters - part I.
@@ -1011,7 +1011,7 @@ Initialize or replace current translation with the original message"))])
   "Regexp matching a whole msgid field, whether obsolete or not.")
 
 (defvar po-any-msgstr-block-regexp
-  "^\\(#~[ \t]*\\)?msgstr.*\n\\(\\(#~[ \t]*\\)?\".*\n\\)*\\(\\(#~[ \t]*\\)?msgstr\\[[0-9]\\].*\n\\(\\(#~[ \t]*\\)?\".*\n\\)*\\)*"
+  "^\\(#~[ \t]*\\)?msgstr\\([ \t]\\|\\[0\\]\\).*\n\\(\\(#~[ \t]*\\)?\".*\n\\)*\\(\\(#~[ \t]*\\)?msgstr\\[[0-9]\\].*\n\\(\\(#~[ \t]*\\)?\".*\n\\)*\\)*"
   "Regexp matching a whole msgstr or msgstr[] field, whether obsolete or not.")
 
 (defvar po-any-msgstr-form-regexp
@@ -1893,7 +1893,7 @@ If FORM is itself a string, then this string is used for insertion."
 
 (defun po-get-msgstr-flavor ()
   "Helper function to detect msgstr and msgstr[] variants."
-  (beginning-of-line)
+  (goto-char po-start-of-msgstr-form)
   (re-search-forward "^\\(#~[ \t]*\\)?\\(msgstr\\(\\[[0-9]\\]\\)?\\)")
   (match-string 2))