bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53877: 29.0.50; [PATCH] async Gnus/nnml


From: Manuel Giraud
Subject: bug#53877: 29.0.50; [PATCH] async Gnus/nnml
Date: Wed, 09 Feb 2022 10:42:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Manuel Giraud <manuel@ledu-giraud.fr> writes:
>
>> -(defvar nnmail-article-buffer " *nnmail incoming*"
>> -  "The buffer used for splitting incoming mails.")
>
> [...]
>
>> -    (with-current-buffer (gnus-get-buffer-create nnmail-article-buffer)
>> -      (erase-buffer)
>
> No, this would break lots of Gnus installations -- people have splitting
> rules that go
>
>      (: split-on-body)
>
> where that function looks into nnmail-article-buffer to do whatever they
> want.

I've just test this with my patch in place:

--8<---------------cut here---------------start------------->8---
(defun foo-split ()
  (save-excursion
    (save-restriction
      (widen)
      (goto-char (point-min))
      (when (re-search-forward "booga" nil t)
        "booga"))))

;; Mail splitting (XXX order is important)
(setq nnmail-split-methods 'nnmail-split-fancy
      nnmail-split-fancy
      `(| (: foo-split)
          "elsewhere"))
--8<---------------cut here---------------end--------------->8---

…and it works as expected: splitting a mail containing "booga" to
"booga". `nnmail-split-it' does not seems to have a reference to
nnmail-buffer-article and just works on the current buffer:

--8<---------------cut here---------------start------------->8---
     ;; Builtin : operation.
     ((eq (car split) ':)
      (nnmail-log-split split)
      (nnmail-split-it (save-excursion (eval (cdr split) t))))
--8<---------------cut here---------------end--------------->8---
-- 
Manuel Giraud





reply via email to

[Prev in Thread] Current Thread [Next in Thread]