From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/30980 Path: main.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Fran=E7ois_Pinard?= Newsgroups: gmane.emacs.gnus.general Subject: Re: The .. rule Date: 16 May 2000 07:58:24 -0400 Sender: owner-ding@hpc.uh.edu Message-ID: References: <00May12.111709edt.115683@gateway.intersys.com> <200005121547.RAA12153@marcy.cs.uni-dortmund.de> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035167445 11469 80.91.224.250 (21 Oct 2002 02:30:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:30:45 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by mailhost.sclp.com (Postfix) with ESMTP id CBD94D0520 for ; Tue, 16 May 2000 08:01:52 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id HAB04289; Tue, 16 May 2000 07:00:25 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 16 May 2000 06:59:39 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id GAA12074 for ; Tue, 16 May 2000 06:59:25 -0500 (CDT) Original-Received: from ariel.progiciels-bpi.ca (ariel.grics.qc.ca [199.84.132.74]) by mailhost.sclp.com (Postfix) with ESMTP id 3BCCED0520 for ; Tue, 16 May 2000 07:59:46 -0400 (EDT) Original-Received: by ariel.progiciels-bpi.ca (Postfix, from userid 3) id 7CE83C18E; Tue, 16 May 2000 08:01:00 -0700 (EDT) Original-Received: from titan.progiciels-bpi.ca.progiciels-bpi.ca (unknown [199.84.132.86]) by icule.progiciels-bpi.ca (Postfix) with ESMTP id 04E073090; Tue, 16 May 2000 07:58:26 -0400 (EDT) Original-To: Hrvoje Niksic X-Face: "b_m|CE6#'Q8fliQrwHl9K,]PA_o'*S~Dva{~b1n*)K*A(BIwQW.:LY?t4~xhYka_.LV?Qq `}X|71X0ea&H]9Dsk!`kxBXlG;q$mLfv_vtaHK_rHFKu]4'<*LWCyUe@ZcI6"*wB5M@[m writes: > Miroslav Zubcic writes: > > I found good string posted by > > Per Abrahamsen This string is > > just fine, not too much, not too small. (Main problem was strings and > > regexps, this `|\(%' are hardly readible to me). > Sigh, a standard problem in languages that don't support a regexp syntax. I did not follow this thread in detail, but let me add my grain of salt nevertheless (or my grain of sand, depending on how you see it :-). When I saw all this new highlighting, my first impression was positive, as I like non-language to stand out in some way. It was not perfect: for example, the name part (before the `@') was forgotten, but overall, it looked like a step in a good direction. But when I realised that associated with the highlighting, was a button invariably presuming, wrongly in most cases, that we were facing an HTTP reference, my joy disappeared: this was far too dumb to be clever. In a word, I like non-language to be highlighted. However, button association should be done _much_ more carefully. I do not know if this might be useful, but here is some Python code I use to highlight, then buttonize plain text while converting it into HTML pages. The results are satisfying most of times, and maybe it could point towards some compromise? [Python regexps are Perlish more than Emacsish.] def enhance(text, verbatim=0): text = string.replace(text, '&', '&') text = string.replace(text, '<', '<') text = string.replace(text, '>', '>') text = string.replace(text, '\f', '') if verbatim: text = re.sub(r'((mailto:|http://|ftp://)[-_.@~/a-zA-Z0-9]+)', r'\1', text) else: text = re.sub(r'((mailto:|http://|ftp://)([-_.@~/a-zA-Z0-9]+))', r'\3', text) text = re.sub((r'(^|[^-_%+./a-zA-Z0-9:])' r'([-_%+./a-zA-Z0-9]+@[-a-zA-Z0-9]+\.[-.a-zA-Z0-9]+)'), r'\1\2', text) if verbatim: text = re.sub(r'_([-_@./a-zA-Z0-9]+)_', r'_\1_', text) text = re.sub(r'\*([-_@./a-zA-Z0-9]+)\*', r'*\1*', text) text = re.sub(r"`([-_@./a-zA-Z0-9]+)'", r"`\1'", text) else: text = re.sub(r'_([-_@./a-zA-Z0-9]+)_', r'\1', text) text = re.sub(r'\*([-_@./a-zA-Z0-9]+)\*', r'\1', text) text = re.sub(r"`([-_@./a-zA-Z0-9]+)'", r'\1', text) return text P.S. - By the way, Lars, I would much like having a Python version of Gnus! Would you add this to the Gnus TODO file? :-) :-) :-) -- François Pinard http://www.iro.umontreal.ca/~pinard