From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67708 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Make ietf-drums-remove-comments() robust against broken header Date: Fri, 31 Oct 2008 08:33:52 +0900 Organization: Emacsen advocacy group Message-ID: References: <87wsfqsgk7.fsf@tsuchiya.vaj.namazu.org> <87zlkm78nq.fsf@obelix.mork.no> <87prli5fb2.fsf@obelix.mork.no> <87iqra2lnt.fsf@tsuchiya.vaj.namazu.org> 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 1225409741 31254 80.91.229.12 (30 Oct 2008 23:35:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Oct 2008 23:35:41 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M16159@lists.math.uh.edu Fri Oct 31 00:36:43 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 1Kvh4E-0008Tg-JF for ding-account@gmane.org; Fri, 31 Oct 2008 00:36:42 +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 1Kvh2B-0007EY-RV; Thu, 30 Oct 2008 18:34:35 -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 1Kvh2A-0007EH-DR for ding@lists.math.uh.edu; Thu, 30 Oct 2008 18:34:34 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1Kvh27-0001DE-JC for ding@lists.math.uh.edu; Thu, 30 Oct 2008 18:34:34 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1Kvh2F-00084x-00 for ; Fri, 31 Oct 2008 00:34:39 +0100 Original-Received: from localhost ([127.0.0.1]:36157) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1Kvh1X-0001ff-Eu for ding@gnus.org; Thu, 30 Oct 2008 18:33:56 -0500 X-Hashcash: 1:20:081030:ding@gnus.org::7rDqjfeKv3MWpaOn:00002xR4 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:QYXZstjtnfCWmyh66LpYziVxuok= 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:67708 Archived-At: >>>>> Bj=F8rn Mork wrote: > And won't the suggested patch kill something like this?: > References: (") <200810150047.AA17342@mailhost.example.net> > which AFAICS is allowed. The patch makes the function remove not only the odd comment but also things following it. You meant it has to behave like the following, didn't you? (ietf-drums-remove-comments "(\") <200810150047.AA17342@mailhost.example.ne= t>") =3D> " <200810150047.AA17342@mailhost.example.net>" Ok. It is below. Anyway I believe we need to fix the function whatever the way, or we cannot view messages having such odd comments. --8<---------------cut here---------------start------------->8--- (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) (or (ignore-errors (forward-sexp 1) (point)) (ignore-errors (with-syntax-table (copy-syntax-table ietf-drums-syntax-table) (modify-syntax-entry ?\" "w") (forward-sexp 1) (point))) (point-max)))) (t (forward-char 1)))) (buffer-string)))) --8<---------------cut here---------------end--------------->8--- TSUCHIYA-san, WDYT? Regards,