+2010-05-08 Bruno Haible <bruno@clisp.org>
+
+ * po-mode.el (po-get-msgstr-flavor): Preserve the point's position.
+
2010-05-08 Noritada Kobayashi <nori1@dolphin.c.u-tokyo.ac.jp>
Fix failure of po-msgid-to-msgstr just after opening a buffer.
string))
(defun po-get-msgstr-flavor ()
- "Helper function to detect msgstr and msgstr[] variants."
- (goto-char po-start-of-msgstr-form)
- (re-search-forward "^\\(#~[ \t]*\\)?\\(msgstr\\(\\[[0-9]\\]\\)?\\)")
- (match-string 2))
+ "Helper function to detect msgstr and msgstr[] variants.
+Returns one of \"msgstr\" or \"msgstr[i]\" for some i."
+ (save-excursion
+ (goto-char po-start-of-msgstr-form)
+ (re-search-forward "^\\(#~[ \t]*\\)?\\(msgstr\\(\\[[0-9]\\]\\)?\\)")
+ (match-string 2)))
(defun po-get-msgstr-form ()
"Extract and return the unquoted msgstr string."