[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] patch for po-msgid-to-msgstr working correctly on po-mode
From: |
Kobayashi Noritada |
Subject: |
Re: [PATCH] patch for po-msgid-to-msgstr working correctly on po-mode |
Date: |
Thu, 29 May 2008 14:40:23 +0900 (JST) |
From: Kobayashi Noritada <address@hidden>
Subject: [PATCH] patch for po-msgid-to-msgstr working correctly on po-mode
Date: Thu, 29 May 2008 14:34:54 +0900 (JST)
> Hi,
>
> Just after starting po-mode, trials to copy msgid to msgstr with C-j
> (po-msgid-to-msgstr) sometimes fails with an error:
>
> Symbol's value as variable is void: po-msgstr-form-flavor
>
> After some operations, this error does not occur.
>
> This is because po-msgid-to-msgstr calls po-set-msgstr-form and it tries
> to use po-msgstr-form-flavor, which is not set until po-get-msgstr-form
> is called.
>
> Since po-msgstr-form-flavor only caches a value returned by
> po-get-msgstr-flavor and is a variable used only in po-set-msgstr-form,
> I suggest eliminating that variable and directly using a returned value
> from po-get-msgstr-flavor to fix this issue. Could you please check a
> patch attached here to do so?
Sorry, I missed attachment...
-nori
Index: gettext-tools/misc/po-mode.el
===================================================================
RCS file: /sources/gettext/gettext/gettext-tools/misc/po-mode.el,v
retrieving revision 1.42
diff -u -r1.42 po-mode.el
--- gettext-tools/misc/po-mode.el 25 May 2008 11:18:51 -0000 1.42
+++ gettext-tools/misc/po-mode.el 28 May 2008 19:16:10 -0000
@@ -692,7 +692,6 @@
(defvar po-end-of-msgstr-form)
(defvar po-end-of-entry)
(defvar po-entry-type)
-(defvar po-msgstr-form-flavor)
;; A few counters are usefully shown in the Emacs mode line.
(defvar po-translated-counter)
@@ -1900,11 +1899,9 @@
(defun po-get-msgstr-form ()
"Extract and return the unquoted msgstr string."
- (let ((flavor (po-get-msgstr-flavor))
- (string (po-extract-unquoted (current-buffer)
+ (let ((string (po-extract-unquoted (current-buffer)
po-start-of-msgstr-form
po-end-of-msgstr-form)))
- (setq po-msgstr-form-flavor flavor)
string))
(defun po-set-msgid (form)
@@ -1935,7 +1932,7 @@
Returns 'nil' if the buffer has not been modified, for if the new msgstr
described by FORM is merely identical to the msgstr already in place."
(let ((string (po-eval-requoted form
- po-msgstr-form-flavor
+ (po-get-msgstr-flavor)
(eq po-entry-type 'obsolete))))
(save-excursion
(goto-char po-start-of-msgstr-form)