Gnus development mailing list
 help / color / mirror / Atom feed
* Citation formatting improvements
@ 2000-10-05 19:06 Emerick Rogul
  2000-10-05 19:27 ` ShengHuo ZHU
  2000-10-06 10:35 ` Kai Großjohann
  0 siblings, 2 replies; 5+ messages in thread
From: Emerick Rogul @ 2000-10-05 19:06 UTC (permalink / raw)


The current citation formatting in message-mode doesn't always do the
right thing (it seems like the paragraph-start and paragraph-end
variables in particular could be improved a lot).  I've been using the
following bit of e-lisp (appears at the end of this message) from
Gareth Rees, and it's been a great improvement, IMO.

Is there any chance of getting some of these changes into CVS?  I
think it would really make filling in message-mode a lot more
pleasant...  :-)

-Emerick

;; Better filling behaviour in Message mode (from Gareth Rees).

(defvar gdr-message-quote-chars "|:>")

(defun gdr-message-mode-vars ()
  (let ((quote-prefix-regexp
	 (concat
	  "[ \t]*"                      ; possible initial space
	  "\\(\\(" (regexp-quote message-yank-prefix) "\\|" ; user's prefix
	  "\\w+>\\|"                    ; supercite-style prefix
	  "[" gdr-message-quote-chars "]" ; standard prefix
	  "\\)[ \t]*\\)+")))            ; possible space after each prefix
    (setq paragraph-start
	  (concat
	   (regexp-quote mail-header-separator) "$\\|"
	   "[ \t]*$\\|"                 ; blank lines
	   "-- $\\|"                    ; signature delimiter
	   "---+$\\|"                   ; delimiters for forwarded messages
	   page-delimiter "$\\|"        ; spoiler warnings
	   ".*wrote:$\\|"               ; attribution lines
	   quote-prefix-regexp "$"))    ; empty lines in quoted text
    (setq paragraph-separate paragraph-start)
    (setq adaptive-fill-regexp
	  (concat quote-prefix-regexp "\\|" adaptive-fill-regexp))
    (setq adaptive-fill-first-line-regexp
	  (concat quote-prefix-regexp "\\|"
		  adaptive-fill-first-line-regexp))))

(add-hook 'message-mode-hook 'gdr-message-mode-vars)

-- 
-------------------------------------------------------------------------
Emerick Rogul         /\/  "i was going to take every drug known to the
emerick@cs.bu.edu     /\/   human race and shag anything that moved."
------------------------------------------------- 'ecstasy', irvine welsh



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-10-06 12:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-05 19:06 Citation formatting improvements Emerick Rogul
2000-10-05 19:27 ` ShengHuo ZHU
2000-10-06  4:08   ` Emerick Rogul
2000-10-06 12:49     ` ShengHuo ZHU
2000-10-06 10:35 ` Kai Großjohann

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).