From: Daiki Ueno <ueno@unixuser.org>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: ding@gnus.org
Subject: Re: Encryption unusable on XEmacs
Date: Thu, 03 Mar 2011 06:42:08 +0900 [thread overview]
Message-ID: <8762s1gpxr.fsf@broken.deisui.org> (raw)
In-Reply-To: <871v2pmfc6.fsf@lifelogs.com> (Ted Zlatanov's message of "Wed, 02 Mar 2011 14:34:33 -0600")
[-- 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
next prev parent reply other threads:[~2011-03-02 21:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 16:15 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 [this message]
2011-03-02 22:10 ` Daiki Ueno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8762s1gpxr.fsf@broken.deisui.org \
--to=ueno@unixuser.org \
--cc=ding@gnus.org \
--cc=tzz@lifelogs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).