From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/33351 Path: main.gmane.org!not-for-mail From: dme@dme.org Newsgroups: gmane.emacs.gnus.general Subject: message-cite-prefix-regexp Date: 15 Nov 2000 10:17:14 +0000 Sender: owner-ding@hpc.uh.edu Message-ID: <877l657d5h.fsf@serafina-pekkala.dme.org> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035169476 24675 80.91.224.250 (21 Oct 2002 03:04:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:04:36 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by mailhost.sclp.com (Postfix) with ESMTP id 5CE55D049A for ; Wed, 15 Nov 2000 05:21:46 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id EAB03863; Wed, 15 Nov 2000 04:17:58 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 15 Nov 2000 04:17:18 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id EAA02979 for ; Wed, 15 Nov 2000 04:17:05 -0600 (CST) Original-Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by mailhost.sclp.com (Postfix) with ESMTP id 29AA3D049A for ; Wed, 15 Nov 2000 05:17:21 -0500 (EST) Original-Received: from serafina-pekkala.dme.org ([212.240.232.117]) by anchor-post-32.mail.demon.net with esmtp (Exim 2.12 #1) id 13vzcv-0000rT-0W for ding@gnus.org; Wed, 15 Nov 2000 10:17:13 +0000 Original-To: ding@gnus.org Original-Lines: 224 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Canyonlands) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:33351 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:33351 Another round of proposed changes for comment please. Since last time: * incorporate Vladimir's comments on the regexp, then apply some more changes. * use message-cite-prefix-regexp in message-mode highlighting. * anchor the regexp better in some searches. I'm particularly interested to know where: * message-newline-and-reformat does the wrong thing, * highlighting is annoying (I'm not convinced that it will ever be possible to get it exactly right). The new regexp is slightly more greedy than the old one, but it seems to be getting good hits more of the time for me. It will now correctly support a prefix such as: > foo> | bar> This the text that is cited and it... > foo> | bar> continues on the next line. which didn't work before. I would expect to get some false hits as a result of this, but it's difficult to know how bad they are from just my mailbox. Index: lisp/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 6.91 diff -u -r6.91 ChangeLog --- lisp/ChangeLog 2000/11/10 11:06:52 6.91 +++ lisp/ChangeLog 2000/11/15 09:07:17 @@ -1,3 +1,20 @@ +2000-11-12 David Edmondson + + * message.el (message-font-lock-keywords): use + message-cite-prefix-regexp. + +2000-11-12 David Edmondson + + * message.el (message-cite-prefix-regexp): moved from gnus-cite.el + and replace `.' with `\w' to allow for different syntax tables + (from Vladimir Volovich). + * message.el (message-newline-and-reformat): use + `message-cite-prefix-regexp'. + * gnus-cite.el (gnus-supercite-regexp): use + `message-cite-prefix-regexp'. + * gnus-cite.el (gnus-cite-parse): use + `message-cite-prefix-regexp'. + 2000-11-07 Kai Gro=DFjohann =20 * gnus-sum.el (gnus-move-split-methods): Say that Index: lisp/gnus-cite.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-cite.el,v retrieving revision 6.0 diff -u -r6.0 gnus-cite.el --- lisp/gnus-cite.el 2000/10/27 23:11:23 6.0 +++ lisp/gnus-cite.el 2000/11/15 09:07:21 @@ -26,6 +26,7 @@ (require 'gnus) (require 'gnus-art) (require 'gnus-range) +(require 'message) ; for message-cite-prefix-regexp =20 ;;; Customization: =20 @@ -74,19 +75,13 @@ :type '(choice (const :tag "all" nil) integer)) =20 -(defcustom gnus-cite-prefix-regexp - "^[]>=BB|:}+ ]*[]>=BB|:}+]\\(.*>=BB\\)?\\|^.*>" - "*Regexp matching the longest possible citation prefix on a line." - :group 'gnus-cite - :type 'regexp) - (defcustom gnus-cite-max-prefix 20 "Maximum possible length for a citation prefix." :group 'gnus-cite :type 'integer) =20 (defcustom gnus-supercite-regexp - (concat "^\\(" gnus-cite-prefix-regexp "\\)? *" + (concat "^\\(" message-cite-prefix-regexp "\\)? *" ">>>>> +\"\\([^\"\n]+\\)\" +=3D=3D") "*Regexp matching normal Supercite attribution lines. The first grouping must match prefixes added by other packages." @@ -306,7 +301,7 @@ corresponding citation merged with `gnus-cite-attribution-face'. =20 Text is considered cited if at least `gnus-cite-minimum-match-count' -lines matches `gnus-cite-prefix-regexp' with the same prefix. +lines matches `message-cite-prefix-regexp' with the same prefix. =20 Lines matching `gnus-cite-attribution-suffix' and perhaps `gnus-cite-attribution-prefix' are considered attribution lines." @@ -679,7 +674,7 @@ ;; Ignore very long prefixes. (when (> end (+ (point) gnus-cite-max-prefix)) (setq end (+ (point) gnus-cite-max-prefix))) - (while (re-search-forward gnus-cite-prefix-regexp (1- end) t) + (while (re-search-forward message-cite-prefix-regexp (1- end) t) ;; Each prefix. (setq end (match-end 0) prefix (buffer-substring begin end)) Index: lisp/message.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/message.el,v retrieving revision 6.7 diff -u -r6.7 message.el --- lisp/message.el 2000/11/04 17:13:56 6.7 +++ lisp/message.el 2000/11/15 09:07:45 @@ -331,6 +331,12 @@ :group 'message-insertion :type 'regexp) =20 +(defcustom message-cite-prefix-regexp + "[ \t]*\\(\\(\\w\\|[_-\\.]\\)+>+[ \t]*\\|[]>=C2=BB|:}+ ]*[]>=C2=BB|:}+][= \t]*\\)+" + "*Regexp matching the longest possible citation prefix on a line." + :group 'message-insertion + :type 'regexp) + (defcustom message-cancel-message "I am canceling my own article.\n" "Message to be inserted in the cancel message." :group 'message-interface @@ -820,9 +826,7 @@ :group 'message-faces) =20 (defvar message-font-lock-keywords - (let* ((cite-prefix "A-Za-z") - (cite-suffix (concat cite-prefix "0-9_.@-")) - (content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?")) + (let ((content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?")) `((,(concat "^\\([Tt]o:\\)" content) (1 'message-header-name-face) (2 'message-header-to-face nil t)) @@ -846,9 +850,7 @@ `((,(concat "^\\(" (regexp-quote mail-header-separator) "\\)$") 1 'message-separator-face)) nil) - (,(concat "^[ \t]*" - "\\([" cite-prefix "]+[" cite-suffix "]*\\)?" - "[:>|}].*") + (,(concat "^\\(" message-cite-prefix-regexp "\\).*") (0 'message-cited-text-face)) ("<#/?\\(multipart\\|part\\|external\\|mml\\).*>" (0 'message-mml-face)))) @@ -1711,15 +1713,12 @@ (defun message-newline-and-reformat () "Insert four newlines, and then reformat if inside quoted text." (interactive) - (let ((prefix "[]>=BB|:}+ \t]*") - (supercite-thing "[-._a-zA-Z0-9]*[>]+[ \t]*") - quoted point) + (let (quoted point) (unless (bolp) (save-excursion - (beginning-of-line) - (when (looking-at (concat prefix "\\|" - supercite-thing)) - (setq quoted (match-string 0)))) + (beginning-of-line) + (when (looking-at message-cite-prefix-regexp) + (setq quoted (match-string 0)))) (insert "\n")) (setq point (point)) (insert "\n\n\n") Index: texi/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/texi/ChangeLog,v retrieving revision 6.8 diff -u -r6.8 ChangeLog --- texi/ChangeLog 2000/11/10 11:06:46 6.8 +++ texi/ChangeLog 2000/11/15 09:07:53 @@ -1,3 +1,9 @@ +2000-11-12 David Edmondson + + * gnus.texi: remove `gnus-cite-prefix-regexp'. + * message.texi (Insertion): move `gnus-cite-prefix-regexp' from + gnus.texi to here and rename to `message-cite-prefix-regexp'. + 2000-11-07 Kai Gro=DFjohann =20 * gnus.texi (Mail Group Commands): `gnus-move-split-methods' uses Index: texi/gnus.texi =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v retrieving revision 6.10 diff -u -r6.10 gnus.texi --- texi/gnus.texi 2000/11/10 11:06:42 6.10 +++ texi/gnus.texi 2000/11/15 09:09:43 @@ -6995,10 +6995,6 @@ If the article size if bigger than this variable (which is 25000 by default), no citation highlighting will be performed. =20 -@item gnus-cite-prefix-regexp -@vindex gnus-cite-prefix-regexp -Regexp matching the longest possible citation prefix on a line. - @item gnus-cite-max-prefix @vindex gnus-cite-max-prefix Maximum possible length for a citation prefix (default 20). Index: texi/message.texi =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/texi/message.texi,v retrieving revision 6.0 diff -u -r6.0 message.texi --- texi/message.texi 2000/10/27 23:12:30 6.0 +++ texi/message.texi 2000/11/15 09:09:49 @@ -464,6 +464,10 @@ messages. The default is @samp{.}, which means that all headers will be removed. =20 +@item message-cite-prefix-regexp +@vindex message-cite-prefix-regexp +Regexp matching the longest possible citation prefix on a line. + @item message-citation-line-function @vindex message-citation-line-function Function called to insert the citation line. The default is dme.