aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/gnus-sum.el54
-rw-r--r--lisp/gnus/mm-decode.el2
-rw-r--r--lisp/gnus/nnimap.el13
4 files changed, 47 insertions, 29 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 7093ebbcefb..77f5c6b1a4e 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,10 @@
12010-10-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-sum.el (gnus-summary-edit-article-done): Try to replace articles
4 that have gotten new numbers.
5
6 * nnimap.el (nnimap-request-replace-article): New function.
7
12010-10-21 Katsumi Yamaoka <yamaoka@jpl.org> 82010-10-21 Katsumi Yamaoka <yamaoka@jpl.org>
2 9
3 * nnrss.el (nnrss-wash-html-in-text-plain-parts): Remove. 10 * nnrss.el (nnrss-wash-html-in-text-plain-parts): Remove.
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 39f63149497..ce876399061 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -10257,7 +10257,7 @@ groups."
10257 "Make edits to the current article permanent." 10257 "Make edits to the current article permanent."
10258 (interactive) 10258 (interactive)
10259 (save-excursion 10259 (save-excursion
10260 ;; The buffer restriction contains the entire article if it exists. 10260 ;; The buffer restriction contains the entire article if it exists.
10261 (when (article-goto-body) 10261 (when (article-goto-body)
10262 (let ((lines (count-lines (point) (point-max))) 10262 (let ((lines (count-lines (point) (point-max)))
10263 (length (- (point-max) (point))) 10263 (length (- (point-max) (point)))
@@ -10277,15 +10277,24 @@ groups."
10277 (delete-region (match-beginning 1) (match-end 1)) 10277 (delete-region (match-beginning 1) (match-end 1))
10278 (insert (number-to-string lines)))))) 10278 (insert (number-to-string lines))))))
10279 ;; Replace the article. 10279 ;; Replace the article.
10280 (let ((buf (current-buffer))) 10280 (let ((buf (current-buffer))
10281 (article (cdr gnus-article-current)))
10281 (with-temp-buffer 10282 (with-temp-buffer
10282 (insert-buffer-substring buf) 10283 (insert-buffer-substring buf)
10283
10284 (if (and (not read-only) 10284 (if (and (not read-only)
10285 (not (gnus-request-replace-article 10285 (not (setq replace-result
10286 (cdr gnus-article-current) (car gnus-article-current) 10286 (gnus-request-replace-article
10287 (current-buffer) t))) 10287 article (car gnus-article-current)
10288 (current-buffer) t))))
10288 (error "Couldn't replace article") 10289 (error "Couldn't replace article")
10290 ;; If we got a number back, then that's the new article number
10291 ;; for this article. Otherwise, the article number didn't change.
10292 (when (numberp replace-result)
10293 (with-current-buffer gnus-summary-buffer
10294 (setq gnus-newsgroup-limit (delq article gnus-newsgroup-limit))
10295 (gnus-summary-limit gnus-newsgroup-limit)
10296 (setq article replace-result)
10297 (gnus-summary-goto-subject article t)))
10289 ;; Update the summary buffer. 10298 ;; Update the summary buffer.
10290 (if (and references 10299 (if (and references
10291 (equal (message-tokenize-header references " ") 10300 (equal (message-tokenize-header references " ")
@@ -10299,38 +10308,29 @@ groups."
10299 (point-min) (point-max))) 10308 (point-min) (point-max)))
10300 header) 10309 header)
10301 (with-temp-buffer 10310 (with-temp-buffer
10302 (insert (format "211 %d Article retrieved.\n" 10311 (insert (format "211 %d Article retrieved.\n" article))
10303 (cdr gnus-article-current)))
10304 (insert head) 10312 (insert head)
10305 (insert ".\n") 10313 (insert ".\n")
10306 (let ((nntp-server-buffer (current-buffer))) 10314 (let ((nntp-server-buffer (current-buffer)))
10307 (setq header (car (gnus-get-newsgroup-headers 10315 (setq header (car (gnus-get-newsgroup-headers nil t))))
10308 nil t))))
10309 (with-current-buffer gnus-summary-buffer 10316 (with-current-buffer gnus-summary-buffer
10310 (gnus-data-set-header 10317 (gnus-data-set-header (gnus-data-find article) header)
10311 (gnus-data-find (cdr gnus-article-current)) 10318 (gnus-summary-update-article-line article header)
10312 header) 10319 (if (gnus-summary-goto-subject article nil t)
10313 (gnus-summary-update-article-line 10320 (gnus-summary-update-secondary-mark article)))))))
10314 (cdr gnus-article-current) header)
10315 (if (gnus-summary-goto-subject
10316 (cdr gnus-article-current) nil t)
10317 (gnus-summary-update-secondary-mark
10318 (cdr gnus-article-current))))))))
10319 ;; Update threads. 10321 ;; Update threads.
10320 (set-buffer (or buffer gnus-summary-buffer)) 10322 (set-buffer (or buffer gnus-summary-buffer))
10321 (gnus-summary-update-article (cdr gnus-article-current)) 10323 (gnus-summary-update-article article)
10322 (if (gnus-summary-goto-subject (cdr gnus-article-current) nil t) 10324 (if (gnus-summary-goto-subject article nil t)
10323 (gnus-summary-update-secondary-mark 10325 (gnus-summary-update-secondary-mark article)))
10324 (cdr gnus-article-current))))
10325 ;; Prettify the article buffer again. 10326 ;; Prettify the article buffer again.
10326 (unless no-highlight 10327 (unless no-highlight
10327 (with-current-buffer gnus-article-buffer 10328 (with-current-buffer gnus-article-buffer
10328 ;;;!!! Fix this -- article should be rehighlighted. 10329 ;;!!! Fix this -- article should be rehighlighted.
10329 ;;;(gnus-run-hooks 'gnus-article-display-hook) 10330 ;;(gnus-run-hooks 'gnus-article-display-hook)
10330 (set-buffer gnus-original-article-buffer) 10331 (set-buffer gnus-original-article-buffer)
10331 (gnus-request-article 10332 (gnus-request-article
10332 (cdr gnus-article-current) 10333 article (car gnus-article-current) (current-buffer))))
10333 (car gnus-article-current) (current-buffer))))
10334 ;; Prettify the summary buffer line. 10334 ;; Prettify the summary buffer line.
10335 (when (gnus-visual-p 'summary-highlight 'highlight) 10335 (when (gnus-visual-p 'summary-highlight 'highlight)
10336 (gnus-run-hooks 'gnus-visual-mark-article-hook)))))) 10336 (gnus-run-hooks 'gnus-visual-mark-article-hook))))))
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 5b79b20eb8d..d18bb860f53 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1690,7 +1690,7 @@ If RECURSIVE, search recursively."
1690 (shr-blocked-images (if (and (boundp 'gnus-summary-buffer) 1690 (shr-blocked-images (if (and (boundp 'gnus-summary-buffer)
1691 (buffer-name gnus-summary-buffer)) 1691 (buffer-name gnus-summary-buffer))
1692 (with-current-buffer gnus-summary-buffer 1692 (with-current-buffer gnus-summary-buffer
1693 gnus-blocked-images) 1693 (gnus-blocked-images))
1694 shr-blocked-images)) 1694 shr-blocked-images))
1695 (shr-content-function (lambda (id) 1695 (shr-content-function (lambda (id)
1696 (let ((handle (mm-get-content-id id))) 1696 (let ((handle (mm-get-content-id id)))
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index d6ad40eeae8..701ed1e2412 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -881,7 +881,7 @@ textual parts.")
881 (let ((message-id (message-field-value "message-id")) 881 (let ((message-id (message-field-value "message-id"))
882 sequence message) 882 sequence message)
883 (nnimap-add-cr) 883 (nnimap-add-cr)
884 (setq message (buffer-string)) 884 (setq message (buffer-substring-no-properties (point-min) (point-max)))
885 (with-current-buffer (nnimap-buffer) 885 (with-current-buffer (nnimap-buffer)
886 (setq sequence (nnimap-send-command 886 (setq sequence (nnimap-send-command
887 "APPEND %S {%d}" (utf7-encode group t) 887 "APPEND %S {%d}" (utf7-encode group t)
@@ -899,6 +899,17 @@ textual parts.")
899 (cons group 899 (cons group
900 (nnimap-find-article-by-message-id group message-id)))))))) 900 (nnimap-find-article-by-message-id group message-id))))))))
901 901
902(deffoo nnimap-request-replace-article (article group buffer)
903 (let (group-art)
904 (when (and (nnimap-possibly-change-group group nil)
905 ;; Put the article into the group.
906 (with-current-buffer buffer
907 (setq group-art
908 (nnimap-request-accept-article group nil t))))
909 (nnimap-delete-article (list article))
910 ;; Return the new article number.
911 (cdr group-art))))
912
902(defun nnimap-add-cr () 913(defun nnimap-add-cr ()
903 (goto-char (point-min)) 914 (goto-char (point-min))
904 (while (re-search-forward "\r?\n" nil t) 915 (while (re-search-forward "\r?\n" nil t)