* gnus-draft.el: Mark articles as replied.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 31 Dec 2000 04:27:07 +0000 (04:27 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 31 Dec 2000 04:27:07 +0000 (04:27 +0000)
* gnus-sum.el (gnus-summary-add-mark): New function.

* gnus-group.el (gnus-add-mark): New function.

* gnus-sum.el (gnus-summary-buffer-name): New function.
(gnus-summary-setup-buffer): Use it.

* gnus-draft.el: Set things up with the right post method and
stuff.

* message.el (message-ignored-news-headers): Remove X-Draft-From.

* gnus-msg.el (gnus-inews-insert-draft-meta-information): New function.

* gnus.el (gnus-draft-meta-information-header): New variable.

* gnus-art.el (gnus-treatment-function-alist): Move the date
functions before the header sorting functions.

* mm-uu.el (mm-uu-pgp-signed-extract-1): Unquote "- " quotes.

* dgnushack.el (dgnushack-compile): Message whether there is w3.
Don't (push "/usr/share/emacs/site-lisp" load-path).

12 files changed:
lisp/ChangeLog
lisp/dgnushack.el
lisp/gnus-agent.el
lisp/gnus-art.el
lisp/gnus-draft.el
lisp/gnus-group.el
lisp/gnus-msg.el
lisp/gnus-sum.el
lisp/gnus.el
lisp/lpath.el
lisp/message.el
lisp/mm-uu.el

index f61c344..11e78e5 100644 (file)
@@ -1,5 +1,33 @@
+2000-12-31 03:57:31  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-draft.el: Mark articles as replied.
+
+       * gnus-sum.el (gnus-summary-add-mark): New function.
+
+       * gnus-group.el (gnus-add-mark): New function.
+
+       * gnus-sum.el (gnus-summary-buffer-name): New function.
+       (gnus-summary-setup-buffer): Use it.
+
+       * gnus-draft.el: Set things up with the right post method and
+       stuff. 
+
+       * message.el (message-ignored-news-headers): Remove X-Draft-From.
+
+       * gnus-msg.el (gnus-inews-insert-draft-meta-information): New function.
+
+       * gnus.el (gnus-draft-meta-information-header): New variable.
+
 2000-12-30 00:17:38  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-art.el (gnus-treatment-function-alist): Move the date
+       functions before the header sorting functions.
+
+       * mm-uu.el (mm-uu-pgp-signed-extract-1): Unquote "- " quotes.
+
+       * dgnushack.el (dgnushack-compile): Message whether there is w3. 
+       Don't (push "/usr/share/emacs/site-lisp" load-path).
+
        * gnus-cite.el (gnus-article-fill-cited-article): Don't add space
        to empty fill prefixes.
 
index 1877a1e..1de86ed 100644 (file)
@@ -36,6 +36,7 @@
 (push (or (getenv "lispdir") 
          "/usr/share/emacs/site-lisp")
       load-path)
+
 (push (or (getenv "W3DIR") (expand-file-name "../../w3/lisp/" srcdir)) 
       load-path)
 
@@ -83,7 +84,6 @@
 
 (require 'bytecomp)
 
-(push "/usr/share/emacs/site-lisp" load-path)
 (push srcdir load-path)
 (load (expand-file-name "lpath.el" srcdir) nil t)
 
@@ -119,11 +119,12 @@ Modify to suit your needs."))
        file elc)
     (dolist (file '("dgnushack.el" "lpath.el"))
       (setq files (delete file files)))
-    (if (featurep 'base64)
-       (setq files (delete "base64.el" files)))
-    (condition-case ()
-       (require 'w3-forms)
+    (when (featurep 'base64)
+      (setq files (delete "base64.el" files)))
+    (condition-case code
+       (require 'w3-forms)
       (error
+       (message "No w3: %s %s" code (locate-library "w3-forms"))
        (dolist (file '("nnweb.el" "nnlistserv.el" "nnultimate.el"
                       "nnslashdot.el" "nnwarchive.el" "webmail.el"
                       "nnwfm.el"))
index 3375b93..764990e 100644 (file)
@@ -370,7 +370,7 @@ agent minor mode in all Gnus buffers."
 
 (defun gnus-agent-insert-meta-information (type &optional method)
   "Insert meta-information into the message that says how it's to be posted.
-TYPE can be either `mail' or `news'.  If the latter METHOD can
+TYPE can be either `mail' or `news'.  If the latter, then METHOD can
 be a select method."
   (save-excursion
     (message-remove-header gnus-agent-meta-information-header)
index 3a4cec4..f9fef4e 100644 (file)
@@ -1081,6 +1081,13 @@ It is a string, such as \"PGP\". If nil, ask user."
     (gnus-treat-strip-cr gnus-article-remove-cr)
     (gnus-treat-emphasize gnus-article-emphasize)
     (gnus-treat-display-xface gnus-article-display-x-face)
+    (gnus-treat-date-ut gnus-article-date-ut)
+    (gnus-treat-date-local gnus-article-date-local)
+    (gnus-treat-date-english gnus-article-date-english)
+    (gnus-treat-date-lapsed gnus-article-date-lapsed)
+    (gnus-treat-date-original gnus-article-date-original)
+    (gnus-treat-date-user-defined gnus-article-date-user)
+    (gnus-treat-date-iso8601 gnus-article-date-iso8601)
     (gnus-treat-hide-headers gnus-article-maybe-hide-headers)
     (gnus-treat-hide-boring-headers gnus-article-hide-boring-headers)
     (gnus-treat-hide-signature gnus-article-hide-signature)
@@ -1092,13 +1099,6 @@ It is a string, such as \"PGP\". If nil, ask user."
     (gnus-treat-highlight-headers gnus-article-highlight-headers)
     (gnus-treat-highlight-citation gnus-article-highlight-citation)
     (gnus-treat-highlight-signature gnus-article-highlight-signature)
-    (gnus-treat-date-ut gnus-article-date-ut)
-    (gnus-treat-date-local gnus-article-date-local)
-    (gnus-treat-date-english gnus-article-date-english)
-    (gnus-treat-date-lapsed gnus-article-date-lapsed)
-    (gnus-treat-date-original gnus-article-date-original)
-    (gnus-treat-date-user-defined gnus-article-date-user)
-    (gnus-treat-date-iso8601 gnus-article-date-iso8601)
     (gnus-treat-strip-trailing-blank-lines
      gnus-article-remove-trailing-blank-lines)
     (gnus-treat-strip-leading-blank-lines
index 79ca86a..020e340 100644 (file)
 
 (progn
   (defun gnus-draft-setup (narticle group &optional restore)
-    (gnus-setup-message 'forward
-      (let ((article narticle))
-       (message-mail)
-       (erase-buffer)
-       (if (not (gnus-request-restore-buffer article group))
-           (error "Couldn't restore the article")
-         (if (and restore (equal group "nndraft:queue"))
+    (let (ga)
+      (gnus-setup-message 'forward
+       (let ((article narticle))
+         (message-mail)
+         (erase-buffer)
+         (if (not (gnus-request-restore-buffer article group))
+             (error "Couldn't restore the article")
+           (when (and restore
+                      (equal group "nndraft:queue"))
              (mime-to-mml))
-         ;; Insert the separator.
-         (goto-char (point-min))
-         (search-forward "\n\n")
-         (forward-char -1)
-         (insert mail-header-separator)
-         (forward-line 1)
-         (message-set-auto-save-file-name))))))
+           ;; Insert the separator.
+           (goto-char (point-min))
+           (search-forward "\n\n")
+           (forward-char -1)
+           (insert mail-header-separator)
+           (forward-line 1)
+           (setq ga (message-fetch-field gnus-draft-meta-information-header))
+           (message-set-auto-save-file-name))))
+      (when (and ga
+                (ignore-errors (setq ga (car (read-from-string ga)))))
+       (setq message-post-method
+             `(lambda (arg)
+                (gnus-post-method arg ,(car ga))))
+       (message-add-action
+        `(gnus-add-mark ,(car ga) 'replied ,(cadr ga))
+        'send)))))
 
 (defun gnus-draft-article-sendable-p (article)
   "Say whether ARTICLE is sendable."
index b1dca09..e59b72b 100644 (file)
@@ -3746,7 +3746,8 @@ and the second element is the address."
            (setcar (nthcdr 2 entry) info)
            (when (and (not (eq (car entry) t))
                       (gnus-active (gnus-info-group info)))
-             (setcar entry (length (gnus-list-of-unread-articles (car info))))))
+             (setcar entry (length
+                            (gnus-list-of-unread-articles (car info))))))
        (error "No such group: %s" (gnus-info-group info))))))
 
 (defun gnus-group-set-method-info (group select-method)
@@ -3781,6 +3782,16 @@ and the second element is the address."
                     (sort (nconc (gnus-uncompress-range (cdr m))
                                  (copy-sequence articles)) '<) t))))))
 
+(defun gnus-add-mark (group mark article)
+  "Mark ARTICLE in GROUP with MARK, whether the group is displayed or not."
+  (let ((buffer (gnus-summary-buffer-name group)))
+    (if (gnus-buffer-live-p buffer)
+       (save-excursion
+         (set-buffer (get-buffer buffer))
+         (gnus-summary-add-mark article mark))
+      (gnus-add-marked-articles group (cdr (assq mark gnus-article-mark-lists))
+                               (list article)))))
+
 ;;;
 ;;; Group timestamps
 ;;;
index 4c62c53..811c8ea 100644 (file)
@@ -230,6 +230,7 @@ Thank you for your help in stamping out bugs.
           (progn
             ,@forms)
         (gnus-inews-add-send-actions ,winconf ,buffer ,article)
+        (gnus-inews-insert-draft-meta-information ,group ,article)
         (setq gnus-message-buffer (current-buffer))
         (set (make-local-variable 'gnus-message-group-art)
              (cons ,group ,article))
@@ -246,6 +247,15 @@ Thank you for your help in stamping out bugs.
        (gnus-configure-windows ,config t)
        (set-buffer-modified-p nil))))
 
+(defun gnus-inews-insert-draft-meta-information (group article)
+  (save-excursion
+    (when (and group
+              (not (string= group ""))
+              (not (message-fetch-field gnus-draft-meta-information-header)))
+      (goto-char (point-min))
+      (insert gnus-draft-meta-information-header ": (\"" group "\" "
+             (if article (number-to-string article) "\"\"") ")\n"))))
+
 ;;;###autoload
 (defun gnus-msg-mail (&rest args)
   "Start editing a mail message to be sent.
@@ -259,8 +269,8 @@ Gcc: header for archiving purposes."
 
 ;;;###autoload
 (define-mail-user-agent 'gnus-user-agent
-      'gnus-msg-mail 'message-send-and-exit
-      'message-kill-buffer 'message-send-hook)
+  'gnus-msg-mail 'message-send-and-exit
+  'message-kill-buffer 'message-send-hook)
 
 (defun gnus-setup-posting-charset (group)
   (let ((alist gnus-group-posting-charset-alist)
@@ -1106,7 +1116,7 @@ this is a reply."
                            (gnus-set-active group (cons (car active) 
                                                         (cdr group-art))))
                      (gnus-activate-group group)))
-                 (let ((buffer (concat "*Summary " group "*"))
+                 (let ((buffer (gnus-summary-buffer-name group))
                        (mark gnus-read-mark)
                        (article (cdr group-art)))
                    (unless 
index 460b47e..8827f14 100644 (file)
@@ -2611,9 +2611,13 @@ display only a single character."
          (aset table i [??]))))
     (setq buffer-display-table table)))
 
+(defun gnus-summary-buffer-name (group)
+  "Return the summary buffer name of GROUP."
+  (concat "*Summary " group "*"))
+
 (defun gnus-summary-setup-buffer (group)
   "Initialize summary buffer."
-  (let ((buffer (concat "*Summary " group "*")))
+  (let ((buffer (gnus-summary-buffer-name group)))
     (if (get-buffer buffer)
        (progn
          (set-buffer buffer)
@@ -8293,6 +8297,20 @@ the actual number of articles unmarked is returned."
       (gnus-summary-remove-process-mark (car gnus-newsgroup-processable))))
   (gnus-summary-position-point))
 
+(defun gnus-summary-add-mark (article type)
+  "Mark ARTICLE with a mark of TYPE."
+  (let ((vtype (car (assq type gnus-article-mark-lists)))
+       var)
+    (if (not vtype)
+       (error "No such mark type: %s" type)
+      (setq var (intern (format "gnus-newsgroup-%s" type)))
+      (set var (cons article (symbol-value var)))
+      (if (memq type '(processable cached replied saved))
+         (gnus-summary-update-secondary-mark article)
+       ;;; !!! This is bobus.  We should find out what primary
+       ;;; !!! mark we want to set.
+       (gnus-summary-update-mark gnus-del-mark 'unread)))))
+       
 (defun gnus-summary-mark-as-expirable (n)
   "Mark N articles forward as expirable.
 If N is negative, mark backward instead.  The difference between N and
index 10950f8..5ca0f5d 100644 (file)
@@ -1610,6 +1610,7 @@ If nil, no default charset is assumed when posting."
 
 (defvar gnus-agent-gcc-header "X-Gnus-Agent-Gcc")
 (defvar gnus-agent-meta-information-header "X-Gnus-Agent-Meta-Information")
+(defvar gnus-draft-meta-information-header "X-Draft-From")
 (defvar gnus-group-get-parameter-function 'gnus-group-get-parameter)
 (defvar gnus-original-article-buffer " *Original Article*")
 (defvar gnus-newsgroup-name nil)
index aeaec68..b8992a5 100644 (file)
@@ -61,7 +61,8 @@
                     set-buffer-multibyte set-char-table-range
                     set-face-stipple set-frame-face-alist track-mouse
                     url-retrieve w3-form-encode-xwfu window-at
-                    window-edges x-color-values x-popup-menu))
+                    window-edges x-color-values x-popup-menu browse-url
+                    frame-char-height frame-char-width))
       (maybe-bind '(buffer-display-table 
                    buffer-file-coding-system font-lock-defaults
                    global-face-data gnus-article-x-face-too-ugly
index c88b5c9..90785a8 100644 (file)
@@ -201,7 +201,7 @@ included.  Organization, Lines and User-Agent are optional."
   :type 'sexp)
 
 (defcustom message-ignored-news-headers
-  "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:"
+  "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|X-Draft-From:"
   "*Regexp of headers to be removed unconditionally before posting."
   :group 'message-news
   :group 'message-headers
index 33c9d5f..8de2ee5 100644 (file)
@@ -275,10 +275,12 @@ Return that buffer."
       (if (search-forward "\n\n" nil t)
          (delete-region (point-min) (point)))
       (if (re-search-forward mm-uu-pgp-beginning-signature nil t)
-         (delete-region (match-beginning 0) (point-max))))
-    (list
-     (mm-make-handle buf
-                    '("text/plain"  (charset . gnus-decoded))))))
+         (delete-region (match-beginning 0) (point-max)))
+      (goto-char (point-min))
+      (while (re-search-forward "^- " nil t)
+       (replace-match "" t t)
+       (forward-line 1)))
+    (list (mm-make-handle buf '("text/plain" (charset . gnus-decoded))))))
 
 (defun mm-uu-pgp-signed-extract ()
   (let ((mm-security-handle (list (format "multipart/signed"))))