2001-02-23 22:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 24 Feb 2001 03:15:21 +0000 (03:15 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 24 Feb 2001 03:15:21 +0000 (03:15 +0000)
* gnus-sum.el (gnus-summary-import-article): Display it. Enable edit.
(gnus-summary-create-article): New.

* gnus-group.el (gnus-group-mark-article-read): New.

* gnus-msg.el (gnus-inews-do-gcc): Use it.

* gnus-art.el (gnus-article-edit-article): Set modified-p nil.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-group.el
lisp/gnus-msg.el
lisp/gnus-sum.el

index 6ed7b6a..e94b5b4 100644 (file)
@@ -1,3 +1,14 @@
+2001-02-23 22:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-sum.el (gnus-summary-import-article): Display it. Enable edit. 
+       (gnus-summary-create-article): New.
+
+       * gnus-group.el (gnus-group-mark-article-read): New.
+
+       * gnus-msg.el (gnus-inews-do-gcc): Use it.
+
+       * gnus-art.el (gnus-article-edit-article): Set modified-p nil.
+
 2001-02-23 17:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-art.el (gnus-article-edit-done): Don't use
 2001-02-23 17:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-art.el (gnus-article-edit-done): Don't use
index 5910096..cd49f78 100644 (file)
@@ -4589,6 +4589,7 @@ groups."
     (set-buffer gnus-article-buffer)
     (gnus-article-edit-mode)
     (funcall start-func)
     (set-buffer gnus-article-buffer)
     (gnus-article-edit-mode)
     (funcall start-func)
+    (set-buffer-modified-p nil)
     (gnus-configure-windows 'edit-article)
     (setq gnus-article-edit-done-function exit-func)
     (setq gnus-prev-winconf winconf)
     (gnus-configure-windows 'edit-article)
     (setq gnus-article-edit-done-function exit-func)
     (setq gnus-prev-winconf winconf)
index 8c6d2ae..7cde35e 100644 (file)
@@ -3935,6 +3935,30 @@ This command may read the active file."
   (let ((gnus-group-list-option 'limit))
     (gnus-group-list-plus args)))
 
   (let ((gnus-group-list-option 'limit))
     (gnus-group-list-plus args)))
 
+(defun gnus-group-mark-article-read (group article)
+  "Mark ARTICLE read." 
+  (gnus-activate-group group)
+  (let ((buffer (gnus-summary-buffer-name group))
+       (mark gnus-read-mark))
+    (unless
+       (and
+        (get-buffer buffer)
+        (with-current-buffer buffer
+          (when gnus-newsgroup-prepared
+            (when (and gnus-newsgroup-auto-expire
+                       (memq mark gnus-auto-expirable-marks))
+              (setq mark gnus-expirable-mark))
+            (setq mark (gnus-request-update-mark
+                        group article mark))
+            (gnus-mark-article-as-read article mark)
+            (setq gnus-newsgroup-active (gnus-active group))
+            t)))
+      (gnus-group-make-articles-read group
+                                    (list article))
+      (when (gnus-group-auto-expirable-p group)
+       (gnus-add-marked-articles
+        group 'expire (list article))))))
+
 (provide 'gnus-group)
 
 ;;; gnus-group.el ends here
 (provide 'gnus-group)
 
 ;;; gnus-group.el ends here
index 56b111d..07419ea 100644 (file)
@@ -1134,28 +1134,7 @@ this is a reply."
                                group (gnus-status-message method))
                  (sit-for 2))
                (when (and group-art gnus-inews-mark-gcc-as-read)
                                group (gnus-status-message method))
                  (sit-for 2))
                (when (and group-art gnus-inews-mark-gcc-as-read)
-                 (gnus-activate-group group)
-                 (let ((buffer (gnus-summary-buffer-name group))
-                       (mark gnus-read-mark)
-                       (article (cdr group-art)))
-                   (unless
-                       (and
-                        (get-buffer buffer)
-                        (with-current-buffer buffer
-                          (when gnus-newsgroup-prepared
-                            (when (and gnus-newsgroup-auto-expire
-                                       (memq mark gnus-auto-expirable-marks))
-                              (setq mark gnus-expirable-mark))
-                            (setq mark (gnus-request-update-mark
-                                        group article mark))
-                            (gnus-mark-article-as-read article mark)
-                            (setq gnus-newsgroup-active (gnus-active group))
-                            t)))
-                     (gnus-group-make-articles-read group
-                                                    (list article))
-                     (when (gnus-group-auto-expirable-p group)
-                       (gnus-add-marked-articles
-                        group 'expire (list article))))))
+                 (gnus-group-mark-article-read group (cdr group-art)))
                (kill-buffer (current-buffer))))))))))
 
 (defun gnus-inews-insert-gcc ()
                (kill-buffer (current-buffer))))))))))
 
 (defun gnus-inews-insert-gcc ()
index 16477eb..fe01c76 100644 (file)
@@ -1726,6 +1726,7 @@ increase the score of each group you read."
     "q" gnus-summary-respool-query
     "t" gnus-summary-respool-trace
     "i" gnus-summary-import-article
     "q" gnus-summary-respool-query
     "t" gnus-summary-respool-trace
     "i" gnus-summary-import-article
+    "I" gnus-summary-create-article
     "p" gnus-summary-article-posted-p)
 
   (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map)
     "p" gnus-summary-article-posted-p)
 
   (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map)
@@ -1874,6 +1875,7 @@ increase the score of each group you read."
                (gnus-check-backend-function
                 'request-replace-article gnus-newsgroup-name)]
               ["Import file..." gnus-summary-import-article t]
                (gnus-check-backend-function
                 'request-replace-article gnus-newsgroup-name)]
               ["Import file..." gnus-summary-import-article t]
+              ["Create article..." gnus-summary-create-article t]
               ["Check if posted" gnus-summary-article-posted-p t]
               ["Edit article" gnus-summary-edit-article
                (not (gnus-group-read-only-p))]
               ["Check if posted" gnus-summary-article-posted-p t]
               ["Edit article" gnus-summary-edit-article
                (not (gnus-group-read-only-p))]
@@ -7946,12 +7948,12 @@ latter case, they will be copied into the relevant groups."
       (gnus-summary-move-article n nil method)
     (gnus-summary-copy-article n nil method)))
 
       (gnus-summary-move-article n nil method)
     (gnus-summary-copy-article n nil method)))
 
-(defun gnus-summary-import-article (file)
+(defun gnus-summary-import-article (file &optional edit)
   "Import an arbitrary file into a mail newsgroup."
   "Import an arbitrary file into a mail newsgroup."
-  (interactive "fImport file: ")
+  (interactive "fImport file: \nP")
   (let ((group gnus-newsgroup-name)
        (now (current-time))
   (let ((group gnus-newsgroup-name)
        (now (current-time))
-       atts lines)
+       atts lines group-art)
     (unless (gnus-check-backend-function 'request-accept-article group)
       (error "%s does not support article importing" group))
     (or (file-readable-p file)
     (unless (gnus-check-backend-function 'request-accept-article group)
       (error "%s does not support article importing" group))
     (or (file-readable-p file)
@@ -7968,13 +7970,41 @@ latter case, they will be copied into the relevant groups."
              lines (count-lines (point-min) (point-max)))
        (insert "From: " (read-string "From: ") "\n"
                "Subject: " (read-string "Subject: ") "\n"
              lines (count-lines (point-min) (point-max)))
        (insert "From: " (read-string "From: ") "\n"
                "Subject: " (read-string "Subject: ") "\n"
-               "Date: " (message-make-date (nth 5 atts))
-               "\n"
+               "Date: " (message-make-date (nth 5 atts)) "\n"
                "Message-ID: " (message-make-message-id) "\n"
                "Lines: " (int-to-string lines) "\n"
                "Chars: " (int-to-string (nth 7 atts)) "\n\n"))
                "Message-ID: " (message-make-message-id) "\n"
                "Lines: " (int-to-string lines) "\n"
                "Chars: " (int-to-string (nth 7 atts)) "\n\n"))
-      (gnus-request-accept-article group nil t)
-      (kill-buffer (current-buffer)))))
+      (setq group-art (gnus-request-accept-article group nil t))
+      (kill-buffer (current-buffer)))
+    (setq gnus-newsgroup-active (gnus-activate-group group))
+    (forward-line 1)
+    (gnus-summary-goto-article (cdr group-art) nil t)
+    (when edit
+      (gnus-summary-edit-article))))
+
+(defun gnus-summary-create-article ()
+  "Create an article in a mail newsgroup."
+  (interactive)
+  (let ((group gnus-newsgroup-name)
+       (now (current-time))
+       group-art)
+    (unless (gnus-check-backend-function 'request-accept-article group)
+      (error "%s does not support article importing" group))
+    (save-excursion
+      (set-buffer (gnus-get-buffer-create " *import file*"))
+      (erase-buffer)
+      (goto-char (point-min))
+      ;; This doesn't look like an article, so we fudge some headers.
+      (insert "From: " (read-string "From: ") "\n"
+             "Subject: " (read-string "Subject: ") "\n"
+             "Date: " (message-make-date now) "\n"
+             "Message-ID: " (message-make-message-id) "\n")
+      (setq group-art (gnus-request-accept-article group nil t))
+      (kill-buffer (current-buffer)))
+    (setq gnus-newsgroup-active (gnus-activate-group group))
+    (forward-line 1)
+    (gnus-summary-goto-article (cdr group-art) nil t)
+    (gnus-summary-edit-article)))
 
 (defun gnus-summary-article-posted-p ()
   "Say whether the current (mail) article is available from news as well.
 
 (defun gnus-summary-article-posted-p ()
   "Say whether the current (mail) article is available from news as well.