X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fgnus.git-;a=blobdiff_plain;f=lisp%2Fgnus-sum.el;h=9a8a28c86b76995b0c6fe45edb786adf433d99c8;hp=bf22138e25165c110edef50e59b6b0b3eb8c162c;hb=9b2fb1b90d4ff43730e19ffbfd10f5f91f98a2e9;hpb=f9c8170d647a9e61dd1d8bb7c4f7d4d8c6721280 diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index bf22138..9a8a28c 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -4524,15 +4524,6 @@ The resulting hash table is returned, or nil if no Xrefs were found." ;; Update the group buffer. (gnus-group-update-group group t))))) -(defun gnus-methods-equal-p (m1 m2) - (let ((m1 (or m1 gnus-select-method)) - (m2 (or m2 gnus-select-method))) - (or (equal m1 m2) - (and (eq (car m1) (car m2)) - (or (not (memq 'address (assoc (symbol-name (car m1)) - gnus-valid-select-methods))) - (equal (nth 1 m1) (nth 1 m2))))))) - (defvar gnus-newsgroup-none-id 0) (defun gnus-get-newsgroup-headers (&optional dependencies force-new) @@ -7029,8 +7020,10 @@ If ARG is a negative number, hide the unwanted header lines." (save-restriction (let* ((buffer-read-only nil) (inhibit-point-motion-hooks t) - (hidden (gnus-article-hidden-text-p 'headers)) - e) + hidden e) + (save-restriction + (message-narrow-to-head) + (setq hidden (gnus-article-hidden-text-p 'headers))) (goto-char (point-min)) (when (search-forward "\n\n" nil t) (delete-region (point-min) (1- (point)))) @@ -9237,6 +9230,38 @@ treated as multipart/mixed." (gnus-summary-show-article)) (gnus-summary-show-article))) +;;; +;;; with article +;;; + +(defmacro gnus-with-article (article &rest forms) + "Select ARTICLE and perform FORMS in the original article buffer. +Then replace the article with the result." + `(progn + ;; We don't want the article to be marked as read. + (let (gnus-mark-article-hook) + (gnus-summary-select-article t t nil ,article)) + (set-buffer gnus-original-article-buffer) + ,@forms + (if (not (gnus-check-backend-function + 'request-replace-article (car gnus-article-current))) + (gnus-message 5 "Read-only group; not replacing") + (unless (gnus-request-replace-article + ,article (car gnus-article-current) + (current-buffer) t) + (error "Couldn't replace article"))) + ;; The cache and backlog have to be flushed somewhat. + (when gnus-keep-backlog + (gnus-backlog-remove-article + (car gnus-article-current) (cdr gnus-article-current))) + (when gnus-use-cache + (gnus-cache-update-article + (car gnus-article-current) (cdr gnus-article-current))))) + +(put 'gnus-with-article 'lisp-indent-function 1) +(put 'gnus-with-article 'edebug-form-spec '(form body)) + + (gnus-ems-redefine) (provide 'gnus-sum)