+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.
;;; 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>
;;; 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.
"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
(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))