help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: update date in diary


From: bruce ingalls
Subject: Re: update date in diary
Date: Sat, 14 Sep 2002 16:18:12 GMT
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.0.0) Gecko/20020606

I liked this thread on calendars so much, that I am
making it the welcome screen on future versions of my
EMacro project <url: http://emacro.sf.net/ >

Here is the code I have combined, so far:
(more discussion, below)

;;__________________________________________________________________________
;;;;;; Calendar

(defgroup e-common nil "Settings from e-common.el file." :group 'emacs)

(defcustom mark-diary-entries-in-calendar t
  "This takes effect when you invoke 'M-x calendar'."
  :group 'e-common
  :type 'boolean)
(defcustom mark-holidays-in-calendar t "Display holidays."
 :group 'e-common
 :type 'boolean)

(defcustom calendar-startup t "Display diary when starting Emacs."
  :group 'e-common
  :type 'boolean)

(defconst diary-display-hook 'fancy-diary-display)
(setq today-visible-calendar-hook 'calendar-mark-today)
;;(setq calendar-setup 'one-frame)      ;ToDo: errors on Emacs v21.2.1
(autoload 'calendar "calendar" "Display 3-month calendar." t)

;;Is this actually useful?
;;(setq calendar-latitude 40.7)         ;New York City
;;(setq calendar-longitude -73.9)       ;New York City, EDT

;;Doesn't seem to do anything
(require 'appt)
(appt-check)

;;(add-hook 'diary-hook 'appt-make-list)
(when calendar-startup
  (let ((inhibit-redisplay t))
;;    (save-window-excursion
      (calendar)
      (if (file-exists-p diary-file)
          (progn
            (mark-diary-entries)
            (diary)))
;; (holidays)
        ))
;;__________________________________________________________________________

I am still wrestling with the defcustom() statements; you may wish to replace them with setq()s. I want to provide users with easy M-x customizability. While I should put most of the defcustom() statements as custom-set-value()s at the end of my .emacs (system), I need their values for this to execute. It seems that shadowing a copy of them is the best compromise.

I also liked it, when the calendar (when run in X or other Window) popped up in a separate frame. I'm happy for someone to save me time, puzzling how to get that back.

Ideally, I'd like the calendar & holidays to appear in one frame. If diary-file exists, I'd like diary, too. I tried
        (setq calendar-setup 'one-frame)
but this caused errors in Emacs v21.2.1, running on Linux. The default of nil works fine, except when I add holidays to the mix.

Finally, since this is the opening screen, I'd like a message to new users, explaining that they can use C-x 1 to unsplit the buffers.
This could appear in the scratch buffer.

This would only be necessary for console mode, if I get Calendar to pop up in a new frame in window mode.

Finally, I'd also like appt-check to pop up any outstanding appointments. I could not get that to work.

Thanks ahead to everyone for your help!
-Bruce



reply via email to

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