[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug#504356: gettext-el: duplicates gettext header with Emacs 23 (fwd)
From: |
Santiago Vila |
Subject: |
Bug#504356: gettext-el: duplicates gettext header with Emacs 23 (fwd) |
Date: |
Tue, 4 Nov 2008 20:53:59 +0100 (CET) |
Hello.
I received this from the Debian bug system.
---------- Forwarded message ----------
From: address@hidden
To: Debian Bug Tracking System <address@hidden>
Date: Sun, 02 Nov 2008 22:30:40 +0100
Subject: Bug#504356: gettext-el: duplicates gettext header with Emacs 23
Package: gettext-el
Version: 0.17-4
Severity: important
Hello,
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
why.
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
attached).
[ ... ]
--- /usr/share/emacs/site-lisp/gettext/po-mode.el 2008-08-27
19:03:06.000000000 +0200
+++ po-mode.el 2008-11-02 22:15:21.000000000 +0100
@@ -1343,7 +1343,7 @@
(progn
;; 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.
- Bug#504356: gettext-el: duplicates gettext header with Emacs 23 (fwd),
Santiago Vila <=