Article View: gnu.emacs.vm.bug
Article #680A good optimization for 'timer'
From: Jon E. Strømme
Date: Tue, 11 Nov 2003 11:20
Date: Tue, 11 Nov 2003 11:20
44 lines
2534 bytes
2534 bytes
I use 'timer' rather that 'itimer', and have found that the following
changes to two functions are benign, and save (potentially a lot of)
resources. The rest of the functions are identical to the ones in
vm-7.17 and vm-7.18.
Rgds, Jon
(defun vm-check-mail-itimer-function (&optional timer)
;; FSF Emacs sets this non-nil, which means the user can't
;; interrupt the check. Bogus.
(setq inhibit-quit nil)
(if (integerp vm-mail-check-interval)
(if timer
;; This is definitely unnecessary.
;; Just sets extra timers. JS 2002-11-06
;; (progn
;; (timer-set-time timer (timer-relative-time (current-time)
;; vm-mail-check-interval)
;; vm-mail-check-interval))
nil
(set-itimer-restart current-itimer vm-mail-check-interval))
;; user has changed the variable value to something that
;; isn't a number, make the timer go away.
(defun vm-get-mail-itimer-function (&optional timer)
;; FSF Emacs sets this non-nil, which means the user can't
;; interrupt mail retrieval. Bogus.
(setq inhibit-quit nil)
(setq saved-timer timer)
(if (integerp vm-auto-get-new-mail)
(if timer
;; Nothing needed here, the repeat is already on.
;; This code just creates a lot of superfluous timers.
;; The original was worse...
;; (timer-set-time timer
;; (timer-relative-time (current-time)
;; vm-auto-get-new-mail)
;; vm-auto-get-new-mail)
nil
(set-itimer-restart current-itimer vm-auto-get-new-mail))
;; user has changed the variable value to something that
;; isn't a number, make the timer go away.
Technical Details
Message-ID:
<ti8ymn17a4.fsf@stromme2.uninett.no>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!uninett.no!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f6829,6e29eb4a15fbf072,start X-Google-Attributes: gidf6829,public X-Google-ArrivalTime: 2003-11-11 03:20:05 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!uninett.no!not-for-mail From: Jon.Stromme@uninett.no (Jon E. Strømme) Newsgroups: gnu.emacs.vm.bug Subject: A good optimization for 'timer' Date: 11 Nov 2003 12:20:03 +0100 Organization: UNINETT Lines: 44 Sender: jon@stromme2.uninett.no Message-ID: <ti8ymn17a4.fsf@stromme2.uninett.no> NNTP-Posting-Host: stromme2.uninett.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dolly.uninett.no 1068549605 12549 158.38.62.137 (11 Nov 2003 11:20:05 GMT) X-Complaints-To: news-abuse@uninett.no NNTP-Posting-Date: Tue, 11 Nov 2003 11:20:05 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2