Article View: gnu.emacs.vm.bug
Article #221Re: Suggested fix to vm-pipe-message-part
From: blueman
Date: Tue, 05 Jan 2010 20:57
Date: Tue, 05 Jan 2010 20:57
58 lines
4069 bytes
4069 bytes
Uday S Reddy <uDOTsDOTreddy@cs.bham.ac.uk> writes:
> Sorry, JJK. I find this rather convoluted.
Personally, I think my way of doing it is "clever" ;) since:
- No new variables need to be used or learned
- vm-pipe-message-part is extended in a transparent fashion so the
added functionality can be used in other commands as needed
(Also, my extension allows for retrieving headers, bodies, messages
each with or without the separator and without having to set a
variable)
- The changes to vm-pipe-messages-to-command are done cleanly without
really even modifying any lines of existing code. It just
changes/resets the value of 3 variables. In fact the change is so
simple, it could be implemented with just a simple piece of around
advice.
> I have already added yesterday a variable called
> `vm-message-include-separators' to alter the meaning of what a
> "message" means. All that is needed now is to call
> vm-pipe-message-to-command after setting this variable to t.
OK. What happens to the variables vm-pipe-messages-to-command-start/end
when your variable is set to 't'?
Note that by default vm-pipe-messages-to-command-end is set to "\n", so
if it is still used then you will be inserting an extra newline between
messages.
If you don't automatically do something about it, then you have to
remember to set both variables to "" when you set
vm-message-include-separators=t or else you will have an extra newline
or other info inserted. This would not be a good idea since in addition
to being confusing, every time you want to "toggle" on/off this
functionality, you would now need to change (and potentially store) the
value 3 variables.
>
> In fact, it would seem to make sense for vm-pipe-message-to-command to
> do this automatically whenever it is dealing with multiple
> messages. (I can't imagine why one would want a sequence of messages
> without any separators between them.
I could definitely imagine many cases:
1. If you want to grep for something in message bodies, you don't want
the From_ separator (or even extra blank newlines)
2. Similarly if you just want to do something on the collection of all
RFC headers (e.g., grep for all messages with something in the
header), you don't want the From_ line
3. If you are trying to know the exact total length of all the messges,
again you don't want separators...
etc...
> But, anyway, I won't split hairs
> about that!)
>
> This will be in 8.1.1-devo version in a few minutes.
Thanks. Have you also included my bug fixes to:
vm-pipe-command-exit-handler
vm-pipe-messages-to-command
Technical Details
Message-ID:
<m21vi45kxy.fsf@consult.pretender>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!xlned.com!feeder3.xlned.com!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mailReferences:
<m2d41p7sho.fsf@consult.pretender> <hht5o0$9pd$1@scotsman.ed.ac.uk> <m23a2l7myy.fsf@consult.pretender> <hhti24$9ua$1@scotsman.ed.ac.uk> <m2tyv15eaz.fsf@consult.pretender> <hhv7u9$bf4$1@scotsman.ed.ac.uk> <m2iqbg5zjg.fsf@consult.pretender> <hi0018$1gk$1@north.jnrs.ja.net>Show Full Headers
Complete Article Headers
X-Google-Thread: a16957f451,747cd7667796b3e3 X-Google-Attributes: gida16957f451,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!xlned.com!feeder3.xlned.com!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: blueman <NOSPAM@nospam.com> Newsgroups: gnu.emacs.vm.bug Subject: Re: Suggested fix to vm-pipe-message-part Date: Tue, 05 Jan 2010 15:57:29 -0500 Organization: A noiseless patient Spider Lines: 58 Message-ID: <m21vi45kxy.fsf@consult.pretender> References: <m2d41p7sho.fsf@consult.pretender> <hht5o0$9pd$1@scotsman.ed.ac.uk> <m23a2l7myy.fsf@consult.pretender> <hhti24$9ua$1@scotsman.ed.ac.uk> <m2tyv15eaz.fsf@consult.pretender> <hhv7u9$bf4$1@scotsman.ed.ac.uk> <m2iqbg5zjg.fsf@consult.pretender> <hi0018$1gk$1@north.jnrs.ja.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Tue, 5 Jan 2010 20:57:31 +0000 (UTC) Injection-Info: news.motzarella.org; posting-host="o0xooYC/dlyFpPxuXQpbEw"; logging-data="19412"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NpVfNXRhagxnnFnOSyT8rFX5IJ/BLWfQ=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:qnHcvDMOqp3YodZXCMK/zAd5DV4= sha1:vl1YLGas5IEIA9Cr2BiQMYV7ZLQ=