summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
authorAndrew G Cohen <cohen@andy.bu.edu>2020-09-11 07:31:56 +0800
committerAndrew G Cohen <cohen@andy.bu.edu>2020-09-11 07:31:56 +0800
commitf7be259400b9e31704560d137562e6e9cbf2a0be (patch)
treee4879a6eb204ffefbf44636c337470a42c1e3547 /lisp/gnus
parent37c095a23fc8ac2f3f43acfe33c9dcd7664d9a89 (diff)
downloademacs-f7be259400b9e31704560d137562e6e9cbf2a0be.tar.gz
Allow editing articles in Gnus nnselect groups
* lisp/gnus/nnselect.el (nnselect-request-replace-article): New function.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/nnselect.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el
index 4916286e377..b9769310eac 100644
--- a/lisp/gnus/nnselect.el
+++ b/lisp/gnus/nnselect.el
@@ -418,6 +418,21 @@ If this variable is nil, or if the provided function returns nil,
to-newsgroup ; Not respooling
(gnus-group-real-name to-newsgroup)))))
+(deffoo nnselect-request-replace-article
+ (article _group buffer &optional no-encode)
+ (pcase-let ((`[,artgroup ,artnumber ,artrsv]
+ (with-current-buffer gnus-summary-buffer
+ (nnselect-artlist-article gnus-newsgroup-selection article))))
+ (unless (gnus-check-backend-function
+ 'request-replace-article artgroup)
+ (user-error "The group %s does not support article editing" artgroup))
+ (let ((newart
+ (gnus-request-replace-article artnumber artgroup buffer no-encode)))
+ (with-current-buffer gnus-summary-buffer
+ (cl-nsubstitute `[,artgroup ,newart ,artrsv]
+ `[,artgroup ,artnumber ,artrsv]
+ gnus-newsgroup-selection
+ :test #'equal :count 1)))))
(deffoo nnselect-request-expire-articles
(articles _group &optional _server force)