From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/50402 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:59:20 +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 1046282787 22085 80.91.224.249 (26 Feb 2003 18:06:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 26 Feb 2003 18:06:27 +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 18o5v6-0005bA-00 for ; Wed, 26 Feb 2003 19:04:40 +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 18o5tZ-0008OG-00; Wed, 26 Feb 2003 12:03:05 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 26 Feb 2003 12:04:04 -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 MAA13386 for ; Wed, 26 Feb 2003 12:03:48 -0600 (CST) Original-Received: (qmail 38014 invoked by alias); 26 Feb 2003 18:02:44 -0000 Original-Received: (qmail 38009 invoked from network); 26 Feb 2003 18:02:44 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by 66.230.238.6 with SMTP; 26 Feb 2003 18:02:44 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 18o69S-0001sG-00 for ; Wed, 26 Feb 2003 19:19:30 +0100 Original-To: ding@gnus.org Original-Path: wintendo.pflaesterer.de!not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 137 Original-NNTP-Posting-Host: p62.246.146.206.tisdip.tiscali.de Original-X-Trace: quimby.gnus.org 1046283570 7206 62.246.146.206 (26 Feb 2003 18:19:30 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 26 Feb 2003 18:19:30 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:gTYK/nLyF5X1VYGe0fiX/q3Ki+w= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:50402 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:50402 On Wed, 26 Feb 2003, Reiner Steib <- 4.uce.03.r.s@nurfuerspam.de wrote: > On Wed, Feb 26 2003, Frank Schmitt wrote: >> sigurd@12move.de (Karl Pflästerer) writes: >>> I found the reason now and IMO it's worth to discuss again about >>> it. [...] >>> The reason was that people if they /wrote/ a message and a colon was >>> the first sign in a line gnus thought this line was a quote and so >>> used the text colour to indicate a citation. > Ah, `message' is required from `gnus-cite.el' and the function > `gnus-cite-parse' uses `message-cite-prefix-regexp'. Yep. [...] > What about adding a simpler variable `message-cite-prefix-chars' (or a > list?) with default value of say `>', `|' and `}' (string ">|}" or a > list). Then the user could easily add some chars (with concat, > add-to-list, ...?). Or add a variable for extra chars (empty by > default) that is integrated into `message-cite-prefix-regexp' during > the initialization of this variable. What do you think? Here is a version with an alist. The alist could hold a bunch of values and the user could select the approbiate one by changing the value of `message-cite-prefix-regexp-value' (which could be a symbol). With `add-to-list' the user could easily add new alist entrys. Or the alist could be written with `defcustom'. To add a variable seems to me not convenient enough and also not very flexible. We would end were we stay now: a lot of users frob that variable in `.gnus' to fit their preferences. For that they have to know a bit about regexps so a (possible long) alist would be easier to use especially for newbies[a] (defcustom message-cite-prefix-regexp-value 'full) (setq message-cite-prefix-regexp-alist (list (cons 'full (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]*[]>|#}+]" "\\)+"))))) (cons 'simple (if (string-match "[[:digit:]]" "1");; support POSIX? (concat "\\(" "[ \t]*[-_.[:word:]]+>+\\|" "[ \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]*[>|]" "\\)+") (concat "\\(" "[ \t]*\\(\\w\\|[" non-word-constituents "]\\)+>+\\|" "[ \t]*[>|]" "\\)+"))))))) (setq message-cite-prefix-regexp (cdr (assq message-cite-prefix-regexp-value message-cite-prefix-regexp-alist))) >> For the seldom used ones, Gnus should only mark lines beginning with >> those as quotes if the are several such lines. > Nice idea. It this feasible? (I don't grok that font-lock stuff.) But that happens already for *all* citation marks. ,------------------------------------------------------------------------. | `gnus-cite-minimum-match-count' is a variable declared in Lisp. | | -- loaded from "gnus-cite" | | | | Value: 2 | | | | Documentation: | | Minimum number of identical prefixes before we believe it's a citation. | | | `------------------------------------------------------------------------´ bye KP _____ [a] (BTW what's the name for new Gnus users: gnubies? :-) I like it -- And as in uffish thought he stood, The Jabberwock, with eyes of flame, Came whiffling through the tulgey wood, And burbled as it came! "Lewis Carroll" "Jabberwocky"