[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug#385005: gettext-el: po-mode inserts header if buffer is narrowed (fw
From: |
Santiago Vila |
Subject: |
Bug#385005: gettext-el: po-mode inserts header if buffer is narrowed (fwd) |
Date: |
Fri, 29 Jun 2007 15:06:16 +0200 (CEST) |
Hello.
I received this from the Debian BTS. The submitter sent it to this
list as well, but AFAIK there was no reply:
http://lists.gnu.org/archive/html/bug-gnu-utils/2006-08/msg00110.html
Thanks.
---------- Forwarded message ----------
From: Sven Joachim <address@hidden>
To: Debian Bug Tracking System <address@hidden>
Date: Mon, 28 Aug 2006 15:16:59 +0200
Subject: gettext-el: po-mode inserts header if buffer is narrowed
Package: gettext-el
Version: 0.15-1
Severity: minor
Tags: patch
[CC'ing gettext maintainer.]
There is a small bug in the function po-check-file-header. If the
buffer is narrowed, M-x po-mode can insert a header even if the buffer
already has one in its not currently visible part. Attached is a
patch which fixes this (tested only with Emacs 21 and 22, but I'm
certain it will work in XEmacs too).
[...]
diff -uw po-mode.el{~,}
--- po-mode.el~ 2006-08-28 12:40:34.000000000 +0200
+++ po-mode.el 2006-08-28 12:41:12.000000000 +0200
@@ -1226,6 +1226,8 @@
(defun po-check-file-header ()
"Create a missing PO mode file header, or replace an oldish one."
(save-excursion
+ (save-restriction
+ (widen)
(let ((buffer-read-only po-read-only)
insert-flag end-of-header)
(goto-char (point-min))
@@ -1257,7 +1259,7 @@
(progn
(insert po-default-file-header)
(if (not (eobp))
- (insert "\n")))))))
+ (insert "\n"))))))))
(defun po-replace-revision-date ()
"Replace the revision date by current time in the PO file header."
- Bug#385005: gettext-el: po-mode inserts header if buffer is narrowed (fwd),
Santiago Vila <=