bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gettext] po-mode and emacs 25


From: Daiki Ueno
Subject: Re: [bug-gettext] po-mode and emacs 25
Date: Wed, 03 Aug 2016 14:12:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Göran Uddeborg <address@hidden> writes:

> After upgrading to emacs 25 (emacs-25.0.94-1.fc24.x86_64 on Fedora)
> the po-send-mail function in po-mode stopped working.  It creates a
> mail buffer, but it then base64 encodes the entire buffer, including
> the header.  Not surprisingly, the mail functions doesn't know what to
> do with that afterwards.

I can reproduce it on Emacs 25.  On the other hand, I doubt that it
worked as expected on earlier Emacs versions.  On Emacs 24, I got "The
mark is not set now, so there is no region" error and the content is not
uuencoded.

> I've tracked this down to the use of "(region-beginning)" near line
> 3525 in po-mode.el as included in emacs-gettext-0.19.8.1-1.fc24.  I
> guess something that used to set the mark in previous emacs version
> doesn't do so any more.  Or something like that.  I tried to change
> the save-excursion part to use the code below instead, and that seems
> to work.  It would be one possible way to do it, I'm not too
> proficient in emacs lisp, som I'm not sure if it is the preferred one.
>
>             (save-excursion
>               (let
>                   ((beginning (point)))
>                 (insert-buffer-substring buffer)
>                 (shell-command-on-region
>                  beginning (region-end)
>                  (concat po-gzip-uuencode-command " " name ".gz") t t)))))))

Thank you for tracking it down.  I would rather avoid the use of marker
at all, like the attached patch.

Regards,
-- 
Daiki Ueno
>From a0ecec28cdc4a7a69e499077ca62a0fee4180729 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <address@hidden>
Date: Wed, 3 Aug 2016 14:10:13 +0200
Subject: [PATCH] po-mode: Fix po-send-mail behaviour on Emacs 25
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gettext-tools/misc/po-mode.el (po-send-mail): Don't rely on
region markers.
Reported by Göran Uddeborg in:
http://lists.gnu.org/archive/html/bug-gettext/2016-07/msg00027.html
---
 gettext-tools/misc/po-mode.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gettext-tools/misc/po-mode.el b/gettext-tools/misc/po-mode.el
index 9189cb3..b0eed21 100644
--- a/gettext-tools/misc/po-mode.el
+++ b/gettext-tools/misc/po-mode.el
@@ -3518,10 +3518,12 @@ Write to your team?  ('n' if writing to the Translation 
Project robot) ")))
             (re-search-forward
              (concat "^" (regexp-quote mail-header-separator) "\n"))
             (save-excursion
-              (insert-buffer-substring buffer)
-              (shell-command-on-region
-               (region-beginning) (region-end)
-               (concat po-gzip-uuencode-command " " name ".gz") t t))))))
+              (save-restriction
+                (narrow-to-region (point) (point))
+                (insert-buffer-substring buffer)
+                (shell-command-on-region
+                 (point-min) (point-max)
+                 (concat po-gzip-uuencode-command " " name ".gz") t t)))))))
   (message ""))
 
 (defun po-confirm-and-quit ()
-- 
2.7.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]