Gnus development mailing list
 help / color / mirror / Atom feed
From: dme@dme.org
Cc: Vladimir Volovich <vvv@vvv.vsu.ru>, ding@gnus.org
Subject: Re: someone broke message-newline-and-reformat
Date: 12 Nov 2000 11:21:07 +0000	[thread overview]
Message-ID: <878zqph1wc.fsf@serafina-pekkala.dme.org> (raw)
In-Reply-To: <87k8aabbmx.fsf@serafina-pekkala.dme.org>

Here's the patch mentioned.

I'd be obliged of a couple of people could test this before it is
committed - particularly those who use or see non-us-ascii citation
leaders (as indicated by Vladimir).

Index: lisp/ChangeLog
===================================================================
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/12 09:40:13
@@ -1,3 +1,15 @@
+2000-11-12  David Edmondson  <dme@dme.org>
+
+	* 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ßjohann  <Kai.Grossjohann@CS.Uni-Dortmund.DE>
 
 	* gnus-sum.el (gnus-move-split-methods): Say that
Index: lisp/gnus-cite.el
===================================================================
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/12 09:40:22
@@ -26,6 +26,7 @@
 (require 'gnus)
 (require 'gnus-art)
 (require 'gnus-range)
+(require 'message)	; for message-cite-prefix-regexp
 
 ;;; Customization:
 
@@ -74,19 +75,13 @@
   :type '(choice (const :tag "all" nil)
 		 integer))
 
-(defcustom gnus-cite-prefix-regexp
-  "^[]>»|:}+ ]*[]>»|:}+]\\(.*>»\\)?\\|^.*>"
-  "*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)
 
 (defcustom gnus-supercite-regexp
-  (concat "^\\(" gnus-cite-prefix-regexp "\\)? *"
+  (concat "^\\(" message-cite-prefix-regexp "\\)? *"
 	  ">>>>> +\"\\([^\"\n]+\\)\" +==")
   "*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'.
 
 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.
 
 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
===================================================================
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/12 09:41:07
@@ -331,6 +331,12 @@
   :group 'message-insertion
   :type 'regexp)
 
+(defcustom message-cite-prefix-regexp
+  "^[]>»|:}+ ]*[]>»|:}+]\\(\\w*>»\\)?\\|^\\w*>"
+  "*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
@@ -1711,21 +1717,18 @@
 (defun message-newline-and-reformat ()
   "Insert four newlines, and then reformat if inside quoted text."
   (interactive)
-  (let ((prefix "[]>»|:}+ \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")
     (delete-region (point) (re-search-forward "[ \t]*"))
     (when quoted
-      (insert quoted))
+      (insert quoted " "))
     (fill-paragraph nil)
     (goto-char point)
     (forward-line 1)))
Index: texi/ChangeLog
===================================================================
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/12 09:41:15
@@ -1,3 +1,10 @@
+2000-11-12  David Edmondson  <dme@dme.org>
+
+	* 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ßjohann  <Kai.Grossjohann@CS.Uni-Dortmund.DE>
 
 	* gnus.texi (Mail Group Commands): `gnus-move-split-methods' uses
Index: texi/gnus.texi
===================================================================
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/12 09:44:48
@@ -6995,10 +6995,6 @@
 If the article size if bigger than this variable (which is 25000 by
 default), no citation highlighting will be performed.
 
-@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
===================================================================
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/12 09:45:00
@@ -464,6 +464,10 @@
 messages.  The default is @samp{.}, which means that all headers will be
 removed.
 
+@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.



  parent reply	other threads:[~2000-11-12 11:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-10 11:39 Vladimir Volovich
2000-11-10 12:20 ` dme
2000-11-10 12:58 ` dme
2000-11-10 15:16   ` Vladimir Volovich
2000-11-10 15:37     ` dme
2000-11-10 16:52     ` Kai Großjohann
2000-11-11 18:35       ` dme
2000-11-11 22:38         ` Kai Großjohann
2000-11-12 11:21         ` dme [this message]
2000-11-13 10:49     ` Vladimir Volovich
2000-11-13 12:17       ` dme
2000-11-13 12:23     ` Vladimir Volovich
2000-11-10 11:46 Vladimir Volovich
2000-11-17 11:42 Vladimir Volovich
2000-11-17 11:51 ` dme
2000-11-17 13:09   ` ShengHuo ZHU
2000-11-17 13:09 ` ShengHuo ZHU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878zqph1wc.fsf@serafina-pekkala.dme.org \
    --to=dme@dme.org \
    --cc=ding@gnus.org \
    --cc=vvv@vvv.vsu.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).