From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67935 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: `mm-replace-in-string' doesn't like taking things literally Date: Wed, 17 Dec 2008 16:45:13 +0900 Organization: Emacsen advocacy group Message-ID: References: <87abaviox9.fsf@daedalus.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1229500017 10784 80.91.229.12 (17 Dec 2008 07:46:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Dec 2008 07:46:57 +0000 (UTC) Cc: bugs@gnus.org, ding@gnus.org To: Ivy Foster Original-X-From: ding-owner+M16381@lists.math.uh.edu Wed Dec 17 08:48:03 2008 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1LCr8V-0002xx-8t for ding-account@gmane.org; Wed, 17 Dec 2008 08:48:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1LCr6a-00036b-Gk; Wed, 17 Dec 2008 01:46:04 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1LCr6W-00036H-PG for ding@lists.math.uh.edu; Wed, 17 Dec 2008 01:46:00 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1LCr6T-0002IM-GD for ding@lists.math.uh.edu; Wed, 17 Dec 2008 01:46:00 -0600 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1LCr6f-0000yO-00; Wed, 17 Dec 2008 08:46:09 +0100 Original-Received: from localhost ([127.0.0.1]:60421) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1LCr5s-0007Wa-0w; Wed, 17 Dec 2008 01:45:20 -0600 Mail-Followup-To: Ivy Foster , bugs@gnus.org, ding@gnus.org X-Hashcash: 1:20:081217:joyfulgirl@archlinux.us::BdozIojw1ukE6rEx:000000000000000000000000000000000000001tlP X-Hashcash: 1:20:081217:bugs@gnus.org::pF1xKivfGrAcpFS8:00002rIB X-Hashcash: 1:20:081217:ding@gnus.org::VM8M43q/6HdUIa4d:00002sMb X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:VTfkW8aMx5uZfuaQgYdouVIibAI= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67935 Archived-At: >>>>> 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,