Gnus development mailing list
 help / color / mirror / Atom feed
From: Brad Howes <bhowes@cssun3.corp.mot.com>
Subject: Another gnu-demon Problem
Date: 15 Apr 1997 11:10:09 -0700	[thread overview]
Message-ID: <wjyk9m45f9a.fsf@cssun3.corp.mot.com> (raw)

I've got a "stuck" handler. Its entry in gnus-demon-handler-state never
gets its time entry reset from zero, so it gets called every minute.
Watching gnus-demon with edebug, when `(funcall (car handler))' gets
executed, something is going on so that the following `(setcar...)'
stuff never does! My handler `my-reset-logs' is defined as:

  (defun my-reset-nndoc (group)
    (gnus-info-clear-data (gnus-get-info group)))

  (defun my-reset-logs ()
    (my-reset-nndoc "nndoc+/home/bhowes/Mail/news.log:news.log")
    (my-reset-nndoc "nndoc+/home/bhowes/Mail/root.log:root.log")
    (my-reset-nndoc "nndoc+/home/bhowes/Mail/listproc.log:listproc.log")
    (my-reset-nndoc "nndoc+/home/bhowes/Mail/CSPS2.log:CSPS2.log")
    (my-reset-nndoc "nndoc+/home/bhowes/Mail/smtp.log:smtp.log"))

Why the weird behavior with `funcall'?

The following patch to gnus-demon (5.4.45) corrects the problem:

*** gnus-demon.el.ori   Tue Apr 15 11:00:55 1997
--- gnus-demon.el       Tue Apr 15 11:01:28 1997
***************
*** 200,210 ****
                  (t (< 0 gnus-demon-idle-time)))) ; Or just need to be idle.
               ;; So we call the handler.
               (progn
!                (funcall (car handler))
!                ;; And reset the timer.
                 (setcar (nthcdr 1 handler)
                         (gnus-demon-time-to-step
!                         (nth 1 (assq (car handler) gnus-demon-handlers)))))))
         ;; These are only supposed to be called when Emacs is idle.
         ((null (setq idle (nth 2 handler)))
          ;; We do nothing.
--- 200,211 ----
                  (t (< 0 gnus-demon-idle-time)))) ; Or just need to be idle.
               ;; So we call the handler.
               (progn
!                ;; Reset the timer.
                 (setcar (nthcdr 1 handler)
                         (gnus-demon-time-to-step
!                         (nth 1 (assq (car handler) gnus-demon-handlers))))
!                ;; Call the handler
!                (funcall (car handler)))))
         ;; These are only supposed to be called when Emacs is idle.
         ((null (setq idle (nth 2 handler)))
          ;; We do nothing.
***************
*** 219,228 ****
          (and (not (memq (car handler) gnus-demon-idle-has-been-called))
               (< idle gnus-demon-idle-time)
               (progn
-                (funcall (car handler))
                 ;; Make sure the handler won't be called once more in
                 ;; this idle-cycle.
!                (push (car handler) gnus-demon-idle-has-been-called)))))))))
  
  (defun gnus-demon-add-nocem ()
    "Add daemonic NoCeM handling to Gnus."
--- 220,229 ----
          (and (not (memq (car handler) gnus-demon-idle-has-been-called))
               (< idle gnus-demon-idle-time)
               (progn
                 ;; Make sure the handler won't be called once more in
                 ;; this idle-cycle.
!                (push (car handler) gnus-demon-idle-has-been-called)
!                (funcall (car handler))))))))))
  
  (defun gnus-demon-add-nocem ()
    "Add daemonic NoCeM handling to Gnus."

-- 
Brad Howes                          Motorola E-Mail ID: XBH001
EMT Development                     SMTP E-Mail: bhowes@cssun3.corp.mot.com
Motorola Corporate - MD H1780       Voice: 602 441 1522  Fax: 602 441 5455


             reply	other threads:[~1997-04-15 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-15 18:10 Brad Howes [this message]
1997-04-15 22:03 ` Lars Magne Ingebrigtsen
1997-04-15 23:53   ` Brad Howes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wjyk9m45f9a.fsf@cssun3.corp.mot.com \
    --to=bhowes@cssun3.corp.mot.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).