Gnus development mailing list
 help / color / mirror / Atom feed
* Encryption unusable on XEmacs
@ 2011-03-02 16:15 Michael Piotrowski
  2011-03-02 17:21 ` Julien Danjou
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Piotrowski @ 2011-03-02 16:15 UTC (permalink / raw)
  To: ding

Hi,

I had already posted this in the thread "Encryption asking for
recipients," but under that heading it's easy to miss...

Commit d7f2cb176d4c7dfad075e3914bdde41553ef5a9f makes message-options a
buffer-local variable (in message.el).  This change essentially breaks
encryption on XEmacs 21.4.22.

The effect is that `mml2015-epg-encrypt' is unable to get the recipient
from the message and prompts for it. If you specify a recipient, it
prompts again. If you then enter no recipient, it complains

  No public key for <>; skip it? (y or n)

If you say "y", it says

  No recipient specified

The buffer then just stays open. However, the message is actually
encrypted and sent.

Could this this change please be reverted or be made Emacs-only?

Thanks and greetings

-- 
Dr.-Ing. Michael Piotrowski, M.A.                   <mxp@dynalabs.de>
Public key at <http://www.dynalabs.de/mxp/pubkey.txt> (ID 0x1614A044)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Encryption unusable on XEmacs
  2011-03-02 16:15 Encryption unusable on XEmacs Michael Piotrowski
@ 2011-03-02 17:21 ` Julien Danjou
  2011-03-02 17:28   ` Michael Piotrowski
  0 siblings, 1 reply; 6+ messages in thread
From: Julien Danjou @ 2011-03-02 17:21 UTC (permalink / raw)
  To: Michael Piotrowski; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

On Wed, Mar 02 2011, Michael Piotrowski wrote:

> The effect is that `mml2015-epg-encrypt' is unable to get the recipient
> from the message and prompts for it.

Why? I cannot see why it would fail.

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Encryption unusable on XEmacs
  2011-03-02 17:21 ` Julien Danjou
@ 2011-03-02 17:28   ` Michael Piotrowski
  2011-03-02 20:34     ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Piotrowski @ 2011-03-02 17:28 UTC (permalink / raw)
  To: ding

On 2011-03-02, Julien Danjou <julien@danjou.info> wrote:

>> The effect is that `mml2015-epg-encrypt' is unable to get the recipient
>> from the message and prompts for it.
>
> Why? I cannot see why it would fail.

If message-options is buffer-local, it fails.  This is reproducible.
Whether this is a bug in XEmacs or due to XEmacs-only code at some
point, I don't know.

Greetings

-- 
Dr.-Ing. Michael Piotrowski, M.A.                   <mxp@dynalabs.de>
Public key at <http://www.dynalabs.de/mxp/pubkey.txt> (ID 0x1614A044)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Encryption unusable on XEmacs
  2011-03-02 17:28   ` Michael Piotrowski
@ 2011-03-02 20:34     ` Ted Zlatanov
  2011-03-02 21:42       ` Daiki Ueno
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2011-03-02 20:34 UTC (permalink / raw)
  To: ding

On Wed, 02 Mar 2011 18:28:13 +0100 Michael Piotrowski <mxp@dynalabs.de> wrote: 

MP> On 2011-03-02, Julien Danjou <julien@danjou.info> wrote:
>>> The effect is that `mml2015-epg-encrypt' is unable to get the recipient
>>> from the message and prompts for it.
>> 
>> Why? I cannot see why it would fail.

MP> If message-options is buffer-local, it fails.  This is reproducible.
MP> Whether this is a bug in XEmacs or due to XEmacs-only code at some
MP> point, I don't know.

Me neither.  I put in code to do the old behavior for XEmacs but hope
that someone who uses it can tell what's wrong.

Ted




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Encryption unusable on XEmacs
  2011-03-02 20:34     ` Ted Zlatanov
@ 2011-03-02 21:42       ` Daiki Ueno
  2011-03-02 22:10         ` Daiki Ueno
  0 siblings, 1 reply; 6+ messages in thread
From: Daiki Ueno @ 2011-03-02 21:42 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Wed, 02 Mar 2011 18:28:13 +0100 Michael Piotrowski <mxp@dynalabs.de> wrote: 
>
> MP> On 2011-03-02, Julien Danjou <julien@danjou.info> wrote:
>>>> The effect is that `mml2015-epg-encrypt' is unable to get the recipient
>>>> from the message and prompts for it.
>>> 
>>> Why? I cannot see why it would fail.
>
> MP> If message-options is buffer-local, it fails.  This is reproducible.
> MP> Whether this is a bug in XEmacs or due to XEmacs-only code at some
> MP> point, I don't know.
>
> Me neither.  I put in code to do the old behavior for XEmacs but hope
> that someone who uses it can tell what's wrong.

I guess the cause is: mml-generate-mime calls mml-generate-mime-1,
etc. in mm-with-multibyte-buffer.  On XEmacs, however,
mm-with-multibyte-buffer is defined using with-temp-buffer and local
variables are not copied into the new buffer.

Here is a patch (not tested).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-mm-with-multibyte-buffer-Inherit-local-variables.patch --]
[-- Type: text/x-diff, Size: 1274 bytes --]

From 02e2d68fa6e440e6d9435ca3e90b11c9392431b1 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@unixuser.org>
Date: Thu, 3 Mar 2011 06:38:41 +0900
Subject: [PATCH] (mm-with-multibyte-buffer): Inherit local variables.

---
 lisp/mm-util.el |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/lisp/mm-util.el b/lisp/mm-util.el
index 435c3bb..683d143 100644
--- a/lisp/mm-util.el
+++ b/lisp/mm-util.el
@@ -1226,9 +1226,18 @@ Use unibyte mode for this."
 (defmacro mm-with-multibyte-buffer (&rest forms)
   "Create a temporary buffer, and evaluate FORMS there like `progn'.
 Use multibyte mode for this."
-  `(with-temp-buffer
-     (mm-enable-multibyte)
-     ,@forms))
+  (let ((variables (make-symbol "variables")))
+    `(let ((,variables (buffer-local-variables)))
+       (with-temp-buffer
+	 ;; copy local variables from the original buffer
+	 (while ,variables
+	   ;; a variable may be a constant and setting it may fail
+	   (condition-case nil
+	       (set (car (car ,variables)) (cdr (car ,variables)))
+	     (error))
+	   (setq ,variables (cdr ,variables)))
+	 (mm-enable-multibyte)
+	 ,@forms))))
 (put 'mm-with-multibyte-buffer 'lisp-indent-function 0)
 (put 'mm-with-multibyte-buffer 'edebug-form-spec '(body))
 
-- 
1.7.2.3


[-- Attachment #3: Type: text/plain, Size: 25 bytes --]


Regards,
-- 
Daiki Ueno

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Encryption unusable on XEmacs
  2011-03-02 21:42       ` Daiki Ueno
@ 2011-03-02 22:10         ` Daiki Ueno
  0 siblings, 0 replies; 6+ messages in thread
From: Daiki Ueno @ 2011-03-02 22:10 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

Daiki Ueno <ueno@unixuser.org> writes:

> I guess the cause is: mml-generate-mime calls mml-generate-mime-1,
> etc. in mm-with-multibyte-buffer.  On XEmacs, however,
> mm-with-multibyte-buffer is defined using with-temp-buffer and local
> variables are not copied into the new buffer.

Hmm, it seems wrong, sorry.  I can't reproduce the original problem even
with XEmacs 21.4 (patch 22) and the current Gnus git master.

Regards,
-- 
Daiki Ueno



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-02 22:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 16:15 Encryption unusable on XEmacs Michael Piotrowski
2011-03-02 17:21 ` Julien Danjou
2011-03-02 17:28   ` Michael Piotrowski
2011-03-02 20:34     ` Ted Zlatanov
2011-03-02 21:42       ` Daiki Ueno
2011-03-02 22:10         ` Daiki Ueno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).