From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Ivy Foster <joyfulgirl@archlinux.us>
Cc: bugs@gnus.org, ding@gnus.org
Subject: Re: `mm-replace-in-string' doesn't like taking things literally
Date: Wed, 17 Dec 2008 16:45:13 +0900 [thread overview]
Message-ID: <b4mtz93s0s6.fsf@jpl.org> (raw)
In-Reply-To: <87abaviox9.fsf@daedalus.localdomain>
>>>>> Ivy Foster wrote:
> Gnus v5.13
> GNU Emacs 23.0.60.13 (i686-pc-linux-gnu, GTK+ Version 2.14.5)
> of 2008-12-15 on daedalus
> Okay...you asked for verbosity, you're gonna get verbosity.
> The alias `mm-replace-in-string', defined in lisp/gnus/mm-util.el (lines 78-81)
> has an optional argument, `literal'. However, being called with that argument
> causes a wrong-number-of-arguments error.
> This can be reproduced in a couple of ways, as far as I can tell. One is set
> `mm-verify-option' to "known" and try to verify a gpg-signed, non-encrypted
> message in GNUS (I'm not sure whether this happens with people whose keys you
> don't already have). I have conveniently provided one of these for you,
> regardless. This is how I encountered the bug in the wild; interestingly, with a
> signed and encrypted message, there is no problem.
> The other way to reproduce it is to try to call the function directly. Here's an
> example based on line 1136 of lisp/gnus/mml2015.el:
> Original:
> (mm-replace-in-string part "\n" "\r\n" t)
> Working:
> (mm-replace-in-string "\n" "\n" "\r\n")
> Not Working:
> (mm-replace-in-string "\n" "\n" "\r\n" t)
> (mm-replace-in-string "\n" "\n" "\r\n" nil)
What does the doc-string of `mm-replace-in-string' say in your
system (try `C-h f mm-replace-in-string RET')? Mine is:
--8<---------------cut here---------------start------------->8---
mm-replace-in-string is a Lisp function in `mm-util.el'.
(mm-replace-in-string string regexp rep &optional literal)
See `replace-regexp-in-string', only the order of args differs.
--8<---------------cut here---------------end--------------->8---
`mm-replace-in-string' is provided as an interface to the Emacs
function `replace-regexp-in-string' if and only if there is not
the function named `replace-in-string'.
--8<---------------cut here---------------start------------->8---
replace-regexp-in-string is a compiled Lisp function in `subr.el'.
(replace-regexp-in-string regexp rep string &optional fixedcase
literal subexp start)
Replace all matches for regexp with rep in string.
[...]
--8<---------------cut here---------------end--------------->8---
XEmacs provides `replace-in-string' natively, and some packages
provide it in Emacs for keeping the compatibility with XEmacs.
In those cases, `mm-replace-in-string' is made an alias to just
that `replace-in-string'. So I guess you use such a package that
provides `replace-in-string' for Emacs. If so, an easy way to
solve it will be to put the following line in the beginning of
the ~/.emacs file:
(require 'mm-util)
If you modify the value of `load-path', put it just after that
section.
> As far as I could tell, there are only a couple of places that actually use the
> literal option. I've omitted uses of `mm-replace-in-string' that don't include
> the literal option from the following list:
> File Lines
> ---- -----
> mml-smime.el 530
> mml2015.el 1136*
> The later is used in the function `mml2015-epg-verify', which is how I encountered
> this bug in the wild.
> Anyway, I tried making the `literal' option non-`&optional', but that didn't
> seem to help. I can say, though, that as far as I can tell simply removing the
> `literal' option from the invocation `mml2015-epg-verify' causes GPG signature
> verification to work properly, at any rate. I have not tested the other
> invocation.
> Thanks, developers!
> Ivy
Regards,
parent reply other threads:[~2008-12-17 7:45 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <87abaviox9.fsf@daedalus.localdomain>]
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=b4mtz93s0s6.fsf@jpl.org \
--to=yamaoka@jpl.org \
--cc=bugs@gnus.org \
--cc=ding@gnus.org \
--cc=joyfulgirl@archlinux.us \
/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).