changeset 35957:a35d9c07d074

2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu> * message.el (message-make-forward-subject): Argument decoded. (message-forward): Use it when digest. * gnus-uu.el (gnus-uu-grab-articles): Shoot down original article buffer. * gnus-sum.el (gnus-summary-make-menu-bar): Don't share menu bar in Emacs. * gnus-art.el (gnus-article-make-menu-bar): Make gnus-article-post-menu.
author ShengHuo ZHU <zsh@cs.rochester.edu>
date Wed, 07 Feb 2001 22:08:26 +0000
parents e4f3480df58c
children 6b6548798375
files lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/gnus-sum.el lisp/gnus/gnus-uu.el lisp/gnus/message.el
diffstat 5 files changed, 57 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Wed Feb 07 16:30:51 2001 +0000
+++ b/lisp/gnus/ChangeLog	Wed Feb 07 22:08:26 2001 +0000
@@ -1,3 +1,17 @@
+2001-02-07  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+	* message.el (message-make-forward-subject): Argument decoded.
+	(message-forward): Use it when digest.
+
+	* gnus-uu.el (gnus-uu-grab-articles): Shoot down original article
+	buffer.
+
+	* gnus-sum.el (gnus-summary-make-menu-bar): Don't share menu bar
+	in Emacs.
+
+	* gnus-art.el (gnus-article-make-menu-bar): Make
+	gnus-article-post-menu.
+
 2001-02-06  Dave Love  <fx@gnu.org>
 
 	* qp.el (quoted-printable-encode-region): Remove redundant code
--- a/lisp/gnus/gnus-art.el	Wed Feb 07 16:30:51 2001 +0000
+++ b/lisp/gnus/gnus-art.el	Wed Feb 07 22:08:26 2001 +0000
@@ -2289,8 +2289,9 @@
 				 gnus-newsgroup-name 'highlight-words t)))
 	     gnus-emphasis-alist)))))
 
-(defvar gnus-summary-article-menu)
-(defvar gnus-summary-post-menu)
+(eval-when-compile
+  (defvar gnus-summary-article-menu)
+  (defvar gnus-summary-post-menu))
 
 ;;; Saving functions.
 
@@ -2662,6 +2663,8 @@
 (substitute-key-definition
  'undefined 'gnus-article-read-summary-keys gnus-article-mode-map)
 
+(defvar gnus-article-post-menu nil)
+
 (defun gnus-article-make-menu-bar ()
   (gnus-turn-off-edit-menu 'article)
   (unless (boundp 'gnus-article-article-menu)
@@ -2692,8 +2695,15 @@
     ;; Note "Commands" menu is defined in gnus-sum.el for consistency
 
     (when (boundp 'gnus-summary-post-menu)
+      (cond 
+       ((not (keymapp gnus-summary-post-menu))
+ 	(setq gnus-article-post-menu gnus-summary-post-menu))
+       ((not gnus-article-post-menu)
+	;; Don't share post menu.
+ 	(setq gnus-article-post-menu
+ 	      (copy-keymap gnus-summary-post-menu))))
       (define-key gnus-article-mode-map [menu-bar post]
-	(cons "Post" gnus-summary-post-menu)))
+ 	(cons "Post" gnus-article-post-menu)))
 
     (gnus-run-hooks 'gnus-article-menu-hook)))
 
@@ -2716,13 +2726,13 @@
 \\[gnus-article-describe-briefly]\t Describe the current mode briefly
 \\[gnus-info-find-node]\t Go to the Gnus info node"
   (interactive)
-  (when (gnus-visual-p 'article-menu 'menu)
-    (gnus-article-make-menu-bar))
   (gnus-simplify-mode-line)
   (setq mode-name "Article")
   (setq major-mode 'gnus-article-mode)
   (make-local-variable 'minor-mode-alist)
   (use-local-map gnus-article-mode-map)
+  (when (gnus-visual-p 'article-menu 'menu)
+    (gnus-article-make-menu-bar))
   (gnus-update-format-specifications nil 'article-mode)
   (set (make-local-variable 'page-delimiter) gnus-page-delimiter)
   (make-local-variable 'gnus-page-broken)
--- a/lisp/gnus/gnus-sum.el	Wed Feb 07 16:30:51 2001 +0000
+++ b/lisp/gnus/gnus-sum.el	Wed Feb 07 22:08:26 2001 +0000
@@ -1315,6 +1315,8 @@
 
 (put 'gnus-summary-mode 'mode-class 'special)
 
+(defvar gnus-article-commands-menu)
+
 (when t
   ;; Non-orthogonal keys
 
@@ -1815,9 +1817,15 @@
        gnus-summary-article-menu gnus-summary-mode-map ""
        (cons "Article" innards))
 
-      (easy-menu-define
-       gnus-article-commands-menu gnus-article-mode-map ""
-       (cons "Commands" innards)))
+      (if (not (keymapp gnus-summary-article-menu))
+	  (easy-menu-define
+	    gnus-article-commands-menu gnus-article-mode-map ""
+	    (cons "Commands" innards))
+	;; in Emacs, don't share menu.
+	(setq gnus-article-commands-menu 
+	      (copy-keymap gnus-summary-article-menu))
+	(define-key gnus-article-mode-map [menu-bar commands]
+	  (cons "Commands" gnus-article-commands-menu))))
 
     (easy-menu-define
      gnus-summary-thread-menu gnus-summary-mode-map ""
--- a/lisp/gnus/gnus-uu.el	Wed Feb 07 16:30:51 2001 +0000
+++ b/lisp/gnus/gnus-uu.el	Wed Feb 07 22:08:26 2001 +0000
@@ -1,6 +1,6 @@
 ;;; gnus-uu.el --- extract (uu)encoded files in Gnus
-;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 2000
-;;        Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
+;;        2001 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Created: 2 Oct 1993
@@ -531,7 +531,7 @@
 	      n nil))
     (gnus-setup-message 'forward
       (setq gnus-uu-digest-from-subject nil)
-      (setq gnus-uu-digest-buffer 
+      (setq gnus-uu-digest-buffer
 	    (gnus-get-buffer-create " *gnus-uu-forward*"))
       (gnus-uu-decode-save n file)
       (switch-to-buffer gnus-uu-digest-buffer)
@@ -878,7 +878,7 @@
 	      ;; These two are necessary for XEmacs 19.12 fascism.
 	      (put-text-property (point-min) (point-max) 'invisible nil)
 	      (put-text-property (point-min) (point-max) 'intangible nil))
-	    (when (and message-forward-as-mime 
+	    (when (and message-forward-as-mime
 		       message-forward-show-mml
 		       gnus-uu-digest-buffer)
 	      (mm-enable-multibyte)
@@ -921,7 +921,7 @@
 		(insert sorthead)
 		(goto-char (point-min))
 		(when (re-search-forward "^Subject: \\(.*\\)$" nil t)
-		  (setq subj (buffer-substring (match-beginning 1) 
+		  (setq subj (buffer-substring (match-beginning 1)
 					       (match-end 1))))
 		(goto-char (point-max))
 		(insert body))
@@ -965,7 +965,7 @@
 		(with-current-buffer gnus-uu-digest-buffer
 		  (goto-char (point-max))
 		  (insert-buffer "*gnus-uu-body*"))
-	      (let ((coding-system-for-write mm-text-coding-system) 
+	      (let ((coding-system-for-write mm-text-coding-system)
 		    (file-name-coding-system nnmail-pathname-coding-system))
 		(write-region
 		 (point-min) (point-max) gnus-uu-saved-article-name t)))))
@@ -1393,6 +1393,9 @@
 	  (while article-series
 	    (gnus-summary-tick-article (pop article-series) t)))))
 
+    ;; The original article buffer is hosed, shoot it down.
+    (gnus-kill-buffer gnus-original-article-buffer)
+
     result-files))
 
 (defun gnus-uu-grab-view (file)
@@ -1570,7 +1573,7 @@
 	      (unless
 		  (unwind-protect
 		      (with-current-buffer buffer
-			(insert (substitute-command-keys 
+			(insert (substitute-command-keys
 				 gnus-uu-unshar-warning))
 			(goto-char (point-min))
 			(display-buffer buffer)
--- a/lisp/gnus/message.el	Wed Feb 07 16:30:51 2001 +0000
+++ b/lisp/gnus/message.el	Wed Feb 07 22:08:26 2001 +0000
@@ -4160,7 +4160,7 @@
 the message."
   (concat "Fwd: " subject))
 
-(defun message-make-forward-subject ()
+(defun message-make-forward-subject (&optional decoded)
   "Return a Subject header suitable for the message in the current buffer."
   (save-excursion
     (save-restriction
@@ -4169,7 +4169,9 @@
 	    (subject (message-fetch-field "Subject")))
 	(setq subject
 	      (if subject
-		  (mail-decode-encoded-word-string subject)
+		  (if decoded 
+		      subject
+		    (mail-decode-encoded-word-string subject))
 		""))
 	(if message-wash-forwarded-subjects
 	    (setq subject (message-wash-subject subject)))
@@ -4191,9 +4193,9 @@
 Optional NEWS will use news to forward instead of mail.
 Optional DIGEST will use digest to forward."
   (interactive "P")
-  (let* ((cur (current-buffer))
-	 (subject (message-make-forward-subject))
-	 art-beg)
+  (let ((cur (current-buffer))
+	(subject (message-make-forward-subject digest))
+	art-beg)
     (if news
 	(message-news nil subject)
       (message-mail nil subject))