From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67701 Path: news.gmane.org!not-for-mail From: TSUCHIYA Masatoshi Newsgroups: gmane.emacs.gnus.general Subject: Re: Make ietf-drums-remove-comments() robust against broken header Date: Thu, 30 Oct 2008 23:38:14 +0900 Message-ID: <87iqra2lnt.fsf@tsuchiya.vaj.namazu.org> References: <87wsfqsgk7.fsf@tsuchiya.vaj.namazu.org> <87zlkm78nq.fsf@obelix.mork.no> <87prli5fb2.fsf@obelix.mork.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1225377548 11577 80.91.229.12 (30 Oct 2008 14:39:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Oct 2008 14:39:08 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M16152@lists.math.uh.edu Thu Oct 30 15:40:10 2008 connect(): Connection refused 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 1KvYgN-0007U7-Q9 for ding-account@gmane.org; Thu, 30 Oct 2008 15:39:32 +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 1KvYf9-0000Rw-N3; Thu, 30 Oct 2008 09:38:15 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1KvYf8-0000Rh-AY for ding@lists.math.uh.edu; Thu, 30 Oct 2008 09:38:14 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1KvYf5-0005v7-OE for ding@lists.math.uh.edu; Thu, 30 Oct 2008 09:38:14 -0500 Original-Received: from vaj.namazu.org ([202.221.179.42]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1KvYfC-0006pi-00 for ; Thu, 30 Oct 2008 15:38:19 +0100 Original-Received: from vaj.namazu.org (vaj.namazu.org [202.221.179.42]) by vaj.namazu.org (Postfix) with ESMTP id 27D1299E27 for ; Thu, 30 Oct 2008 23:38:08 +0900 (JST) X-cite: xcite 1.56 Mail-Followup-To: ding@gnus.org 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") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux) X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67701 Archived-At: >> On Thu, 30 Oct 2008 15:27:13 +0100 >> bmork@dod.no ( Bj=F8rn Mork) said as follows: >And won't the suggested patch kill something like this?: > References: (") <200810150047.AA17342@mailhost.example.net> >which AFAICS is allowed.=20=20 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> (=3D?iso-2022-jp?B?IhskQj0pTVUbKEIgGyRCT= SdOSRsoQg=3D=3D?=3D \"'s message of \"Fri, 17 Oct 2008 04:32:17 +0900\")")) --=20 TSUCHIYA Masatoshi