From 10b5c0b73567c285a48282a22c36e142a95bbb67 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 7 May 2008 22:56:13 +0000 Subject: Fix editing of plural forms. --- gettext-tools/misc/ChangeLog | 9 +++++++++ gettext-tools/misc/po-mode.el | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'gettext-tools') diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog index 4442c04..6d245f3 100644 --- a/gettext-tools/misc/ChangeLog +++ b/gettext-tools/misc/ChangeLog @@ -1,3 +1,12 @@ +2008-05-07 Bruno Haible + + 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 * autopoint.in: Check that really all CVS directories are removed. diff --git a/gettext-tools/misc/po-mode.el b/gettext-tools/misc/po-mode.el index 8042848..bd4853f 100644 --- a/gettext-tools/misc/po-mode.el +++ b/gettext-tools/misc/po-mode.el @@ -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 ;; Greg McGary @@ -64,7 +64,7 @@ ;;; Code: -(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)) -- cgit v1.1