[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unplugged gcc to remote server support



This makes unplugged gcc's work (gcc's are performed when `J S':ing
instead at C-c C-c).

Now to disconnected move/copy...

2000-08-05    <simon@josefsson.org>

	* gnus-draft.el (gnus-draft-send): Call `gnus-agent-restore-gcc'.

	* gnus-agent.el (gnus-agent-possibly-do-gcc): 
	(gnus-agent-restore-gcc): 
	(gnus-agent-possibly-save-gcc): New functions.

	* gnus-msg.el (gnus-inews-add-send-actions): Use
	`gnus-agent-possibly-do-gcc' if Agentized.
	(gnus-inews-add-send-actions): Add `gnus-agent-possibly-save-gcc'
	to `message-header-hook'.

	* gnus.el (gnus-agent-gcc-header): New variable.

Index: gnus.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v
retrieving revision 5.141
diff -w -u -u -w -r5.141 gnus.el
--- gnus.el	2000/07/13 23:11:45	5.141
+++ gnus.el	2000/07/31 13:45:15
@@ -1478,6 +1478,7 @@
 ;;; Internal variables
 
 (defvar gnus-agent-meta-information-header "X-Gnus-Agent-Meta-Information")
+(defvar gnus-agent-gcc-header "X-Gnus-Agent-Gcc")
 (defvar gnus-group-get-parameter-function 'gnus-group-get-parameter)
 (defvar gnus-original-article-buffer " *Original Article*")
 (defvar gnus-newsgroup-name nil)
Index: gnus-draft.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-draft.el,v
retrieving revision 5.18
diff -w -u -u -w -r5.18 gnus-draft.el
--- gnus-draft.el	2000/04/26 16:31:37	5.18
+++ gnus-draft.el	2000/07/31 13:43:03
@@ -143,6 +143,8 @@
 	(setq type (ignore-errors (read (current-buffer)))
 	      method (ignore-errors (read (current-buffer))))
 	(message-remove-header gnus-agent-meta-information-header)))
+    ;; Let Agent restore any GCC lines and h ave message perform them.
+    (gnus-agent-restore-gcc)
     ;; Then we send it.  If we have no meta-information, we just send
     ;; it and let Message figure out how.
     (when (and (or (null method)
Index: gnus-msg.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-msg.el,v
retrieving revision 5.66
diff -w -u -u -w -r5.66 gnus-msg.el
--- gnus-msg.el	2000/06/25 16:49:30	5.66
+++ gnus-msg.el	2000/07/31 13:43:17
@@ -262,7 +262,11 @@
 
 (defun gnus-inews-add-send-actions (winconf buffer article)
   (make-local-hook 'message-sent-hook)
-  (add-hook 'message-sent-hook 'gnus-inews-do-gcc nil t)
+  (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc
+				 'gnus-inews-do-gcc) nil t)
+  (when gnus-agent
+    (make-local-hook 'message-header-hook)
+    (add-hook 'message-header-hook 'gnus-agent-possibly-save-gcc nil t))
   (setq message-post-method
 	`(lambda (arg)
 	   (gnus-post-method arg ,gnus-newsgroup-name)))
Index: gnus-agent.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v
retrieving revision 5.55
diff -w -u -u -w -r5.55 gnus-agent.el
--- gnus-agent.el	2000/07/13 17:19:05	5.55
+++ gnus-agent.el	2000/07/31 13:43:31
@@ -371,6 +382,27 @@
     (while (search-backward "\n" nil t)
       (replace-match "\\n" t t))))
 
+(defun gnus-agent-restore-gcc ()
+  "Restore GCC field from saved header."
+  (save-excursion
+    (goto-char (point-min))
+    (while (re-search-forward (concat gnus-agent-gcc-header ":") nil t)
+      (replace-match "Gcc:" 'fixedcase))))
+  
+(defun gnus-agent-possibly-save-gcc ()
+  "Save GCC if Gnus is unplugged."
+  (unless gnus-plugged
+    (save-excursion
+      (goto-char (point-min))
+      (let ((case-fold-search t))
+	(while (re-search-forward "^gcc:" nil t)
+	  (replace-match (concat gnus-agent-gcc-header ":") 'fixedcase))))))
+
+(defun gnus-agent-possibly-do-gcc ()
+  "Do GCC if Gnus is plugged."
+  (when gnus-plugged
+    (gnus-inews-do-gcc)))
+
 ;;;
 ;;; Group mode commands
 ;;;