From: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
To: ding@gnus.org
Subject: Re: Make ietf-drums-remove-comments() robust against broken header
Date: Thu, 30 Oct 2008 23:38:14 +0900 [thread overview]
Message-ID: <87iqra2lnt.fsf@tsuchiya.vaj.namazu.org> (raw)
In-Reply-To: <87prli5fb2.fsf@obelix.mork.no> (=?iso-8859-1?Q?=22Bj=F8rn?= Mork"'s message of "Thu, 30 Oct 2008 15:27:13 +0100")
>> On Thu, 30 Oct 2008 15:27:13 +0100
>> bmork@dod.no ( Bjørn Mork) said as follows:
>And won't the suggested patch kill something like this?:
> References: (") <200810150047.AA17342@mailhost.example.net>
>which AFAICS is allowed.
Really? Please try the following expression.
(progn
(defun ietf-drums-remove-comments (string)
"Remove comments from STRING."
(with-temp-buffer
(let (c)
(ietf-drums-init string)
(while (not (eobp))
(setq c (char-after))
(cond
((eq c ?\")
(forward-sexp 1))
((eq c ?\()
(delete-region (point)
(condition-case nil
(progn (forward-sexp 1) (point))
(error (point-max)))))
(t
(forward-char 1))))
(buffer-string))))
(ietf-drums-remove-comments "<200810150047.AA17342@mailhost.example.net> <7B77911B-167E-47BF-A826-1C4396FEF000@foo.example.net> <7B77911B-167E-47BF-A826-1C4396FEF000@foo.example.net> (=?iso-2022-jp?B?IhskQj0pTVUbKEIgGyRCTSdOSRsoQg==?= \"'s message of \"Fri, 17 Oct 2008 04:32:17 +0900\")"))
--
TSUCHIYA Masatoshi
next prev parent reply other threads:[~2008-10-30 14:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 7:11 TSUCHIYA Masatoshi
2008-10-30 8:54 ` Katsumi Yamaoka
2008-10-30 9:07 ` Bjørn Mork
2008-10-30 9:25 ` Katsumi Yamaoka
2008-10-30 14:27 ` Bjørn Mork
2008-10-30 14:38 ` TSUCHIYA Masatoshi [this message]
2008-10-30 23:33 ` Katsumi Yamaoka
2008-10-31 0:35 ` TSUCHIYA Masatoshi
2008-10-31 1:21 ` Katsumi Yamaoka
2008-10-31 3:19 ` Ted Zlatanov
2008-10-31 7:26 ` Katsumi Yamaoka
2008-10-31 9:06 ` Katsumi Yamaoka
2008-10-31 17:34 ` Ted Zlatanov
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=87iqra2lnt.fsf@tsuchiya.vaj.namazu.org \
--to=tsuchiya@namazu.org \
--cc=ding@gnus.org \
/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).