From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/50401 Path: main.gmane.org!not-for-mail From: sigurd@12move.de (Karl =?iso-8859-1?q?Pfl=E4sterer?=) Newsgroups: gmane.emacs.gnus.general Subject: Re: Slighty improved regexps for citations Date: Wed, 26 Feb 2003 18:05:28 +0100 Organization: Lemis World Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1046279520 4739 80.91.224.249 (26 Feb 2003 17:12:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 26 Feb 2003 17:12:00 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18o54O-000154-00 for ; Wed, 26 Feb 2003 18:10:12 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18o53c-0008Cq-00; Wed, 26 Feb 2003 11:09:24 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 26 Feb 2003 11:10:23 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id LAA13287 for ; Wed, 26 Feb 2003 11:10:09 -0600 (CST) Original-Received: (qmail 35940 invoked by alias); 26 Feb 2003 17:09:04 -0000 Original-Received: (qmail 35935 invoked from network); 26 Feb 2003 17:09:03 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by 66.230.238.6 with SMTP; 26 Feb 2003 17:09:03 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 18o5JW-0001Jk-00 for ; Wed, 26 Feb 2003 18:25:50 +0100 Original-To: ding@gnus.org Original-Path: wintendo.pflaesterer.de!not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 74 Original-NNTP-Posting-Host: p62.246.146.32.tisdip.tiscali.de Original-X-Trace: quimby.gnus.org 1046280350 5065 62.246.146.32 (26 Feb 2003 17:25:50 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 26 Feb 2003 17:25:50 GMT X-Face: #iIcL\6>Qj/G*F@AL9T*v/R$j@7Q`6#FU&Flg6u6aVsLdWf(H$U5>:;&*>oy>jOIWgA%8w* A!V7X`\fEGoQ[@D'@i^*p3FCC6&Rg~JT/H_*MOX;"o~flADb8^ Mail-Copies-To: never User-Agent: Oort Gnus v0.16 Hamster/2.0.0.1 Cancel-Lock: sha1:4/MfW4tXyEk6bheIC5j5v2vdfOY= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:50401 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:50401 On Wed, 26 Feb 2003, Maciej Matysiak <- phoner.ding@blah.pl wrote: > would it be possible to make gnus recongnize ':' as citation prefix, > but not ':)', ':-)' and other smiley mutations? that'd be prolly quite > ugly regexp i think, but at the moment i have to remove the colon from > m-c-p-r (or have hilighted every second line in some mails :( ). It is possible and the regexp would not be too ugly (well for some approbiate values of ugly). If we accept that the second char of a smiley is a dash (if you look at the value of `smiley-regexp-alist' at the moment that's true). Then we could write (I rewrote the definition a bit so it is easier to read): (setq message-cite-prefix-regexp (if (string-match "[[:digit:]]" "1");; support POSIX? (concat "\\(" "[ \t]*[-_.[:word:]]+>+\\|" "[ \t]*:+[^-]\\|" "[ \t]*[]>|#}+]" "\\)+") ;; ?-, ?_ or ?. MUST NOT be in syntax entry w. (let ((old-table (syntax-table)) non-word-constituents) (set-syntax-table text-mode-syntax-table) (setq non-word-constituents (concat (if (string-match "\\w" "-") "" "-") (if (string-match "\\w" "_") "" "_") (if (string-match "\\w" ".") "" "."))) (set-syntax-table old-table) (if (equal non-word-constituents "") (concat "\\(" "[ \t]*\\(\\w\\)+>+\\|" "[ \t]*:+[^-]\\|" "[ \t]*[]>|}+]" "\\)+") (concat "\\(" "[ \t]*\\(\\w\\|[" non-word-constituents "]\\)+>+\\|" "[ \t]*:+[^-]\\|" "[ \t]*[]>|#}+]" "\\)+"))))) Here a some lines to test if it works: > should be a citation > also : and here : and there :- but here not The best way would be IMO to use the keys of `smiley-regexp-alist'. They could be retrieved like that: (let ((smileyreg)) (dolist (entry smiley-regexp-alist) (setq smileyreg (concat smileyreg (and smileyreg "\\|") (car entry)))) smileyreg) but the problem is, there are some constructions which are not allowed in between square brackets. bye KP -- Der wahre Weltuntergang ist die Vernichtung des Geistes, der andere hängt von dem gleichgiltigen Versuch ab, ob nach der Vernichtung des Geistes noch eine Welt bestehen kann. Karl Kraus 'Untergang der Welt durch schwarze Magie'