Your message dated Tue, 4 Nov 2008 20:53:59 +0100 (CET)
with message-id <[email protected]>
has caused the report #504356,
regarding gettext-el: duplicates gettext header with Emacs 23
to be marked as having been forwarded to the upstream software
author(s) [email protected]
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Bug#504356: gettext-el: duplicates gettext header with Emacs 23 fwd
Tue, 4 Nov 2008 20:53:59 +0100 CET
I received this from the Debian bug system.
---------- Forwarded message ----------
From: [email protected]
To: Debian Bug Tracking System <[email protected]>
Date: Sun, 02 Nov 2008 22:30:40 +0100
Subject: Bug#504356: gettext-el: duplicates gettext header with Emacs 23
at least in Emacs 23, opening a PO file with po-mode unconditionally
adds a new header on top of the file, even if one (or more... the
problem is recursive) header is already present.
This problem does not happen in Emacs 22, that's why I do not set this
as grave, but I believe it deserves "important", because po-mode does
not provide any easy way to remove this duplicate header: once the PO
has been saved, I have to edit it with another editor to fix the mess.
I've tracked down the issue to line 1346 (in po-check-file-header):
(previous-line 1) moves to the end of the previous line, don't ask me
The docstring for previous-line clearly says it should not be used
blindly in a Lisp program:
If you are thinking of using this in a Lisp program, consider using
`forward-line' with a negative argument instead. It is usually easier
to use and more reliable (no dependence on goal column, etc.).
Replacing this with (forward-line -1) fixes the issue (one-liner patch
[ ... ]
--- /usr/share/emacs/site-lisp/gettext/po-mode.el 2008-08-27
+++ po-mode.el 2008-11-02 22:15:21.000000000 +0100
@@ -1343,7 +1343,7 @@
;; There is at least one entry.
(goto-char (match-beginning 0))
- (previous-line 1)
+ (forward-line -1)
(setq end-of-header (match-end 0))
(if (looking-at "msgid \"\"\n")
;; There is indeed a PO file header.
--- End Message ---