Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Problem trying to get new email every 10 minutes automatically
@ 2015-10-18  1:44 cseberino
  2015-10-18 10:12 ` Peter Münster
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: cseberino @ 2015-10-18  1:44 UTC (permalink / raw)
  To: info-gnus-english

The last line below of my Gnus config I assumed was to grab new email every 10 minutes.  I sent an email to my Gmail account and noticed it showed up in my other non-Emacs email client inbox but not in Gnus inbox.  Why?

(If I type "g" manually in Gnus then it DOES get new email!?!?)

cs


(setq-default gnus-permanently-visible-groups ".*.*")

(require 'nnir)
(setq-default gnus-select-method
      '(nnimap "gmail"
               (nnimap-address "imap.googlemail.com")
               (nnimap-server-port "imaps")
               (nnimap-stream ssl)
               (nnir-search-engine imap)))

(setq-default smtpmail-smtp-service 587
      gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")

(setq-default gnus-posting-styles
      '(((header "to" "REDACTED")
         (address "REDACTED"))
        ((header "to" "REDACTED")
         (address "REDACTED"))
        ((header "to" "REDACTED")
         (address "REDACTED"))))

(setq-default user-mail-address          "REDACTED")
(setq-default user-full-name             "REDACTED")
(setq-default smtpmail-smtp-server       "smtp.googlemail.com")
(setq-default send-mail-function         'smtpmail-send-it)
(setq-default message-send-mail-function 'smtpmail-send-it)

(gnus-demon-add-handler 'gnus-demon-scan-news 10 t)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
  2015-10-18  1:44 Problem trying to get new email every 10 minutes automatically cseberino
@ 2015-10-18 10:12 ` Peter Münster
  2015-10-18 12:44 ` Adam Sjøgren
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Peter Münster @ 2015-10-18 10:12 UTC (permalink / raw)
  To: info-gnus-english

On Sat, Oct 17 2015, cseberino@gmail.com wrote:

> (gnus-demon-add-handler 'gnus-demon-scan-news 10 t)

What is your Gnus version?

-- 
           Peter



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
       [not found] ` <84eggs61za.fsf@example.com>
@ 2015-10-18 12:08   ` Emanuel Berg
  2015-10-19  0:12     ` Brady Trainor
  2015-10-18 13:04   ` Random832
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Emanuel Berg @ 2015-10-18 12:08 UTC (permalink / raw)
  To: info-gnus-english

David Hume <David.Hume@example.com> writes:

> My guess is it is using run-with-idle-timer which
> behaves differently from what you would expect. If you
> do nothing in emacs for 10 minutes it might get mail.
> But if you press a key the timer is reset.
> Also I think after it has got mail it doesn't set the
> idle timer going again unless you do something.

I'm not getting it to work either:

(require 'cl)
(require 'gnus-demon)

(defvar *its*)
(setq *its* 0)

(gnus-demon-add-handler
 (lambda ()
   (incf *its*)
   (message "One second! %s" (make-string *its* ?.)) )
 1
 nil) ; IDLE; run every second regardless of user input

The function doesn't get called.

-- 
underground experts united
http://user.it.uu.se/~embe8573



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
  2015-10-18  1:44 Problem trying to get new email every 10 minutes automatically cseberino
  2015-10-18 10:12 ` Peter Münster
@ 2015-10-18 12:44 ` Adam Sjøgren
  2015-10-18 14:30   ` Emanuel Berg
       [not found] ` <84eggs61za.fsf@example.com>
       [not found] ` <mailman.546.1445163145.7904.info-gnus-english@gnu.org>
  3 siblings, 1 reply; 12+ messages in thread
From: Adam Sjøgren @ 2015-10-18 12:44 UTC (permalink / raw)
  To: info-gnus-english

cseberino@gmail.com writes:

> The last line below of my Gnus config I assumed was to grab new email
> every 10 minutes. I sent an email to my Gmail account and noticed it
> showed up in my other non-Emacs email client inbox but not in Gnus
> inbox. Why?

I'm using this, which works for me:

  ; Demon to fetch email every 5 minutes when Emacs has been idle for 5 minutes:
  (gnus-demon-add-handler 'gnus-demon-scan-news 5 5)
  ; Demon to send queued email every other minute:
  (gnus-demon-add-handler 'gnus-delay-send-queue 1 nil)
  (gnus-demon-init)

"idle" does mean "you haven't touched Emacs at all".


  Best regards,

    Adam

-- 
 "Och när jag blundar hörs din röst                           Adam Sjøgren
  Jag kan inte se ditt ansikte                           asjo@koldfront.dk
  Det var det jag glömde först"


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
       [not found] ` <84eggs61za.fsf@example.com>
  2015-10-18 12:08   ` Emanuel Berg
@ 2015-10-18 13:04   ` Random832
       [not found]   ` <mailman.555.1445173514.7904.info-gnus-english@gnu.org>
  2015-10-19  0:21   ` Brady Trainor
  3 siblings, 0 replies; 12+ messages in thread
From: Random832 @ 2015-10-18 13:04 UTC (permalink / raw)
  To: info-gnus-english

David Hume <David.Hume@example.com> writes:
> There might be a way of doing what you want in emacs, but I did it using
> the screen command from bash command line and running a script to send
> 'g'.

What about emacsclient -e '(gnus-group-get-new-news)'? That seems like
it would be more robust than sending an interactive keypress.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
  2015-10-18 12:44 ` Adam Sjøgren
@ 2015-10-18 14:30   ` Emanuel Berg
  0 siblings, 0 replies; 12+ messages in thread
From: Emanuel Berg @ 2015-10-18 14:30 UTC (permalink / raw)
  To: info-gnus-english

asjo@koldfront.dk (Adam Sjøgren) writes:

> "idle" does mean "you haven't touched Emacs at all".

What should you have as the IDLE argument if you want
something to happen every (say) five minutes
*regardless* of input?

With the conventional assumption there ain't
relentless input, of course.

-- 
underground experts united
http://user.it.uu.se/~embe8573


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
       [not found]     ` <84y4f03wvp.fsf@example.com>
@ 2015-10-18 21:30       ` Random832
  0 siblings, 0 replies; 12+ messages in thread
From: Random832 @ 2015-10-18 21:30 UTC (permalink / raw)
  To: info-gnus-english

David Hume <David.Hume@example.com> writes:
> Random832 <random832@fastmail.com> writes:
>> What about emacsclient -e '(gnus-group-get-new-news)'? That seems like
>> it would be more robust than sending an interactive keypress.
>
> I am not sure what that does.

Provided that your emacs has server mode enabled and gnus loaded, it
will cause it to execute the same function as "g".

It has the advantage that you don't have to do anything special
(i.e. whatever you're doing with screen) to make it send keypresses to
emacs, and to make sure that the group buffer is active when it does.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
       [not found] ` <mailman.546.1445163145.7904.info-gnus-english@gnu.org>
@ 2015-10-18 23:40   ` cseberino
  2015-10-18 23:57     ` Emanuel Berg
  0 siblings, 1 reply; 12+ messages in thread
From: cseberino @ 2015-10-18 23:40 UTC (permalink / raw)
  To: info-gnus-english


> What is your Gnus version?

What ever comes standard with Emacs24 (Ubuntu 14.04 distro package).

cs

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
  2015-10-18 23:40   ` cseberino
@ 2015-10-18 23:57     ` Emanuel Berg
  0 siblings, 0 replies; 12+ messages in thread
From: Emanuel Berg @ 2015-10-18 23:57 UTC (permalink / raw)
  To: info-gnus-english

cseberino@gmail.com writes:

> What ever comes standard with Emacs24 (Ubuntu 14.04
> distro package).

In a message buffer body, do

    C-u M-x gnus-version RET

-- 
underground experts united
http://user.it.uu.se/~embe8573



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
  2015-10-18 12:08   ` Emanuel Berg
@ 2015-10-19  0:12     ` Brady Trainor
  2015-10-19 23:24       ` Emanuel Berg
  0 siblings, 1 reply; 12+ messages in thread
From: Brady Trainor @ 2015-10-19  0:12 UTC (permalink / raw)
  To: info-gnus-english


Emanuel Berg <embe8573@student.uu.se> writes:

> I'm not getting it to work either:

[...]

> The function doesn't get called.

The following, 

#+BEGIN_SRC elisp
(setq gnus-demon-handlers nil)
(setq gnus-demon-timestep 5)
(gnus-demon-add-handler (lambda ()
                          (message "hello"))
                        1 nil)
#+END_SRC

works for me.

--
Brady



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
       [not found] ` <84eggs61za.fsf@example.com>
                     ` (2 preceding siblings ...)
       [not found]   ` <mailman.555.1445173514.7904.info-gnus-english@gnu.org>
@ 2015-10-19  0:21   ` Brady Trainor
  3 siblings, 0 replies; 12+ messages in thread
From: Brady Trainor @ 2015-10-19  0:21 UTC (permalink / raw)
  To: info-gnus-english


David Hume <David.Hume@example.com> writes:

> cseberino@gmail.com writes:
>
>>
>> (gnus-demon-add-handler 'gnus-demon-scan-news 10 t)
>
> My guess is it is using run-with-idle-timer which behaves differently
> from what you would expect. If you do nothing in emacs for 10 minutes it
> might get mail. But if you press a key the timer is reset. Also I think
> after it has got mail it doesn't set the idle timer going again unless
> you do something.
>
[...]

Right, "If IDLE is t, only call each time Emacs has been idle for TIME." from, 

,----[ C-h v gnus-demon-handlers RET ]
| gnus-demon-handlers is a variable defined in `gnus-demon.el'.
| Its value is nil
| 
| Documentation:
| Alist of daemonic handlers to be run at intervals.
| Each handler is a list on the form
| 
| (FUNCTION TIME IDLE)
| 
| FUNCTION is the function to be called.  TIME is the number of
| `gnus-demon-timestep's between each call.
| If nil, never call. If t, call each `gnus-demon-timestep'.
| 
| If IDLE is t, only call each time Emacs has been idle for TIME.
| If IDLE is a number, only call when Emacs has been idle more than
| this number of `gnus-demon-timestep's.
| If IDLE is nil, don't care about idleness.
| If IDLE is a number and TIME is nil, then call once each time
| Emacs has been idle for IDLE `gnus-demon-timestep's.
| 
| You can customize this variable.
| 
| [back]
`----

--
Brady



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem trying to get new email every 10 minutes automatically
  2015-10-19  0:12     ` Brady Trainor
@ 2015-10-19 23:24       ` Emanuel Berg
  0 siblings, 0 replies; 12+ messages in thread
From: Emanuel Berg @ 2015-10-19 23:24 UTC (permalink / raw)
  To: info-gnus-english

Brady Trainor <algebrat@uw.edu> writes:

> The following,
>
> #+BEGIN_SRC elisp
> (setq gnus-demon-handlers nil)
> (setq gnus-demon-timestep 5)
> (gnus-demon-add-handler (lambda ()
>                           (message "hello"))
>                         1 nil)
> #+END_SRC
>
> works for me.

Thank you. Indeed, this works for me.

(require 'gnus-demon)
(require 'cl-lib)
(defvar *its*)
(setq *its* 0)
(setq gnus-demon-timestep 1)
(gnus-demon-add-handler (lambda ()
                          (cl-incf *its*)
                          (message "hello: %s" *its*))
                        1 nil)

Perhaps it was the `gnus-demon-timestep' that did it.
(Note: if anyone can't get to the help of that
variable, do (require 'gnus-demon) first. FWR this
isn't necessary to get the help of
`gnus-demon-add-handler', even tho that is also
defined in gnus-demon.el).

-- 
underground experts united
http://user.it.uu.se/~embe8573



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-10-19 23:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-18  1:44 Problem trying to get new email every 10 minutes automatically cseberino
2015-10-18 10:12 ` Peter Münster
2015-10-18 12:44 ` Adam Sjøgren
2015-10-18 14:30   ` Emanuel Berg
     [not found] ` <84eggs61za.fsf@example.com>
2015-10-18 12:08   ` Emanuel Berg
2015-10-19  0:12     ` Brady Trainor
2015-10-19 23:24       ` Emanuel Berg
2015-10-18 13:04   ` Random832
     [not found]   ` <mailman.555.1445173514.7904.info-gnus-english@gnu.org>
     [not found]     ` <84y4f03wvp.fsf@example.com>
2015-10-18 21:30       ` Random832
2015-10-19  0:21   ` Brady Trainor
     [not found] ` <mailman.546.1445163145.7904.info-gnus-english@gnu.org>
2015-10-18 23:40   ` cseberino
2015-10-18 23:57     ` Emanuel Berg

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).