* Beginning to use async.el to help Gnus' interactivity
@ 2012-07-08 5:31 John Wiegley
2012-07-09 5:22 ` Carson Chittom
2012-07-18 14:03 ` Ted Zlatanov
0 siblings, 2 replies; 7+ messages in thread
From: John Wiegley @ 2012-07-08 5:31 UTC (permalink / raw)
To: ding
Here is a function I'm now using to help out spam.el. Reporting SPAM to the
Internet takes about 5 seconds per messages, so this *really* helps after
leaving a busy spam group:
(require 'spam)
(require 'async)
(defun spam-spamassassin-register-with-sa-learn (articles spam
&optional unregister)
"Register articles with spamassassin's sa-learn as spam or non-spam."
(if articles
(let ((action (if unregister spam-sa-learn-unregister-switch
(if spam spam-sa-learn-spam-switch
spam-sa-learn-ham-switch)))
(summary-buffer-name (buffer-name)))
(with-temp-buffer
;; group the articles into mbox format
(dolist (article articles)
(let (article-string)
(with-current-buffer summary-buffer-name
(setq article-string (spam-get-article-as-string article)))
(when (stringp article-string)
;; mbox separator
(insert (concat "From nobody " (current-time-string) "\n"))
(insert article-string)
(insert "\n"))))
;; call sa-learn on all messages at the same time, and also report
;; them as SPAM to the Internet
(async-start
`(lambda ()
(with-temp-buffer
(insert ,(buffer-substring-no-properties
(point-min) (point-max)))
(call-process-region (point-min) (point-max)
,spam-sa-learn-program
nil nil nil "--mbox"
,@(if spam-sa-learn-rebuild
(list action)
(list "--no-rebuild" action)))
(if ,spam
(call-process-region (point-min) (point-max)
,(executable-find "spamassassin-5.12")
nil nil nil "--mbox" "-r"))))
`(lambda (&optional ignore)
(message "Finished learning messsages as %s"
,(if spam "spam" "ham"))))))))
John
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Beginning to use async.el to help Gnus' interactivity
2012-07-08 5:31 Beginning to use async.el to help Gnus' interactivity John Wiegley
@ 2012-07-09 5:22 ` Carson Chittom
2012-07-18 14:03 ` Ted Zlatanov
1 sibling, 0 replies; 7+ messages in thread
From: Carson Chittom @ 2012-07-09 5:22 UTC (permalink / raw)
To: ding
"John Wiegley" <johnw@newartisans.com> writes:
> Here is a function I'm now using to help out spam.el. Reporting SPAM to the
> Internet takes about 5 seconds per messages, so this *really* helps after
> leaving a busy spam group:
Much obliged for the tip.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Beginning to use async.el to help Gnus' interactivity
2012-07-08 5:31 Beginning to use async.el to help Gnus' interactivity John Wiegley
2012-07-09 5:22 ` Carson Chittom
@ 2012-07-18 14:03 ` Ted Zlatanov
2012-07-18 18:58 ` John Wiegley
1 sibling, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2012-07-18 14:03 UTC (permalink / raw)
To: John Wiegley; +Cc: ding
On Sun, 08 Jul 2012 00:31:31 -0500 "John Wiegley" <johnw@newartisans.com> wrote:
JW> Here is a function I'm now using to help out spam.el. Reporting SPAM to the
JW> Internet takes about 5 seconds per messages, so this *really* helps after
JW> leaving a busy spam group:
...
Cool. Do you want to add it as optional behavior to the mainline?
Ted
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Beginning to use async.el to help Gnus' interactivity
2012-07-18 14:03 ` Ted Zlatanov
@ 2012-07-18 18:58 ` John Wiegley
2012-07-18 19:23 ` Ted Zlatanov
0 siblings, 1 reply; 7+ messages in thread
From: John Wiegley @ 2012-07-18 18:58 UTC (permalink / raw)
To: Ted Zlatanov; +Cc: ding
>>>>> Ted Zlatanov <tzz@lifelogs.com> writes:
> Cool. Do you want to add it as optional behavior to the mainline?
Sure! Should I submit it to you as a patch, or do I get a write bit?
John
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Beginning to use async.el to help Gnus' interactivity
2012-07-18 18:58 ` John Wiegley
@ 2012-07-18 19:23 ` Ted Zlatanov
2012-07-18 21:27 ` Steinar Bang
0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2012-07-18 19:23 UTC (permalink / raw)
To: John Wiegley; +Cc: ding
On Wed, 18 Jul 2012 13:58:26 -0500 John Wiegley <johnw@newartisans.com> wrote:
>>>>>> Ted Zlatanov <tzz@lifelogs.com> writes:
>> Cool. Do you want to add it as optional behavior to the mainline?
JW> Sure! Should I submit it to you as a patch, or do I get a write bit?
Contact me off-list for write access. Same for anyone who believes they
need it. I'd prefer more developers to more patches :)
Ted
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Beginning to use async.el to help Gnus' interactivity
2012-07-18 19:23 ` Ted Zlatanov
@ 2012-07-18 21:27 ` Steinar Bang
2012-07-19 13:36 ` Ted Zlatanov
0 siblings, 1 reply; 7+ messages in thread
From: Steinar Bang @ 2012-07-18 21:27 UTC (permalink / raw)
To: ding
>>>>> Ted Zlatanov <tzz@lifelogs.com>:
> Contact me off-list for write access. Same for anyone who believes they
> need it. I'd prefer more developers to more patches :)
One possibility would be to create a git branch, push it to a repo on
github, and then Ted can add that repo as a remote, fetch the branch
from that remote, and then merge and push.
It's less work than it sounds like.
For the branch pusher, it should be something like:
1. if you've made the fixes against master, create a git branch for the
fixes:
git checkout jw-async-changes
2. create a git repo on github (or your own git server or whatever),
called for the purposes of these examples jw-gnus (this is the bit
that takes most work, if you don't already have a github account or
your own git server or a git account on a different provider)
3. add that repo as a remote to the local gnus repo
cd ~/git/gnus/
git remote add jw-gnus https://github.com/jw/jw-gnus.git
4. assuming you're already on the branch with the fixes push it to the
new git repo:
git push jw-gnus HEAD
Pulling and merging and pushing would then be:
1. Add the new remote, and fetch its branches:
git remote add jw-gnus https://github.com/jw/jw-gnus.git
git fetch jw-gnus
2. Merge the branch fetched from jw-gnus
git merge jw-gnus/jw-async-changes
3. Push the merge results:
git push origin HEAD
The result will have the full git history of the changes, with original
committer (unlike a patch).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Beginning to use async.el to help Gnus' interactivity
2012-07-18 21:27 ` Steinar Bang
@ 2012-07-19 13:36 ` Ted Zlatanov
0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2012-07-19 13:36 UTC (permalink / raw)
To: ding
On Wed, 18 Jul 2012 23:27:37 +0200 Steinar Bang <sb@dod.no> wrote:
>>>>>> Ted Zlatanov <tzz@lifelogs.com>:
>> Contact me off-list for write access. Same for anyone who believes they
>> need it. I'd prefer more developers to more patches :)
SB> One possibility would be to create a git branch, push it to a repo on
SB> github, and then Ted can add that repo as a remote, fetch the branch
SB> from that remote, and then merge and push.
Sure, but it's still work for someone to review the diff and merge. I
gave John commit access so he should be OK.
Ted
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-07-19 13:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-08 5:31 Beginning to use async.el to help Gnus' interactivity John Wiegley
2012-07-09 5:22 ` Carson Chittom
2012-07-18 14:03 ` Ted Zlatanov
2012-07-18 18:58 ` John Wiegley
2012-07-18 19:23 ` Ted Zlatanov
2012-07-18 21:27 ` Steinar Bang
2012-07-19 13:36 ` Ted Zlatanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).