changeset 43273:b8391c00e2c9

* gnus-art.el (gnus-article-edit-mode): Use define-derived-mode. From: Stefan Monnier <monnier@cs.yale.edu>
author ShengHuo ZHU <zsh@cs.rochester.edu>
date Wed, 13 Feb 2002 17:35:19 +0000
parents d05b5e007830
children 10d0cff733e2
files lisp/gnus/ChangeLog lisp/gnus/gnus-art.el
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Wed Feb 13 16:24:33 2002 +0000
+++ b/lisp/gnus/ChangeLog	Wed Feb 13 17:35:19 2002 +0000
@@ -1,3 +1,8 @@
+2002-02-13  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+	* gnus-art.el (gnus-article-edit-mode): Use define-derived-mode.
+	From:  Stefan Monnier  <monnier@cs.yale.edu>
+
 2002-02-07  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
 	* gnus-art.el (article-wash-html): Bind url-gateway-unplugged. 
--- a/lisp/gnus/gnus-art.el	Wed Feb 13 16:24:33 2002 +0000
+++ b/lisp/gnus/gnus-art.el	Wed Feb 13 17:35:19 2002 +0000
@@ -1400,7 +1400,7 @@
 	  (width (window-width (get-buffer-window (current-buffer)))))
       (save-restriction
 	(article-goto-body)
-	(let ((adaptive-fill-mode nil))
+	(let ((adaptive-fill-mode nil)) ;Why?  -sm
 	  (while (not (eobp))
 	    (end-of-line)
 	    (when (>= (current-column) (min fill-column width))
@@ -4137,21 +4137,18 @@
 		     "\C-c\C-w" gnus-article-edit-mode-map)
     "f" gnus-article-edit-full-stops))
 
-(defun gnus-article-edit-mode ()
+(define-derived-mode gnus-article-edit-mode text-mode "Article Edit"
   "Major mode for editing articles.
 This is an extended text-mode.
 
 \\{gnus-article-edit-mode-map}"
-  (interactive)
-  (setq major-mode 'gnus-article-edit-mode)
-  (setq mode-name "Article Edit")
-  (use-local-map gnus-article-edit-mode-map)
   (make-local-variable 'gnus-article-edit-done-function)
   (make-local-variable 'gnus-prev-winconf)
+  (set (make-local-variable 'font-lock-defaults)
+       '(message-font-lock-keywords t))
   (setq buffer-read-only nil)
   (buffer-enable-undo)
-  (widen)
-  (gnus-run-hooks 'text-mode-hook 'gnus-article-edit-mode-hook))
+  (widen))
 
 (defun gnus-article-edit (&optional force)
   "Edit the current article.