[Top][All Lists]

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

run-at-time/buffer switching

From: Knut Forkalsrud
Subject: run-at-time/buffer switching
Date: Wed, 18 Apr 2001 05:19:31 GMT
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.91

I may have found a minor bug.  For a year or so, I have had the
following couple of lines in my .emacs

(setq view-diary-entries-initially t)
(run-at-time "07:00am" (* 24 60 60) 'calendar-basic-setup)

The purpose is to remind me of special events that occur every now and
then, like birthdays (I am terrible with dates).  I usually leave
Emacs opened overnight, and every morning I observe the same strange
behaviour.  The first keypresspress (usually 'q') results in a beep
and a message like "Buffer is read-only: #<buffer *Calendar*>".  If I
left Emacs in the Gnus *Summary* buffer the day before, it seems like
the first keypress is handeled by a Gnus function. 'q' results in "Are
you sure you want to quit reading news?".  The second keypress is
always handeled correctly.  The behaviour is the same in all GNU Emacs
20.x versions I have tried (many) and also in a rather dated pretest I
got hold of (  The behaviour is easy reproducible by
invoking (run-at-time "<some time in the near future>" .......).

I believe the cause may be something along the lines of:

1. the call to calendar-basic-setup is not caused by a keypress
2. calendar-basic-setup causes emacs to switch buffer to *Calendar*
3. somehow, the next keypress is associated with the previous buffer.


--------------------------- My .emacs ------------------------

(setq default-frame-alist
      '((width . 80) (height . 40)
        (cursor-color . "orchid")
        (mouse-color . "orchid")
        (background-color . "tan")
        (foreground-color . "black")))


(global-set-key [f9] 'compile)

(setq view-diary-entries-initially t)
(run-at-time "07:00am" (* 24 60 60) 'calendar-basic-setup)

;; (frame-parameters)

 '(gnus-inhibit-startup-message t)
 '(global-font-lock-mode t nil (font-lock)))

---------------------------- eof ------------------------------

Hard work often pays off after time.  But laziness always pays off now.

reply via email to

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