(setq european-calendar-style t)
(setq calendar-time-display-form
'(24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")")))
(setq calendar-date-display-form
'((if dayname (concat dayname ", ")) day " " monthname " " year))
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
(setq calendar-latitude 53.1)
(setq calendar-longitude 8.8)
(setq calendar-location-name "Bremen, Germany")
(setq calendar-daylight-savings-starts '(calendar-nth-named-day -1 0 3 year))
(setq calendar-daylight-savings-ends '(calendar-nth-named-day -1 0 9 year))
(setq calendar-week-start-day 1)
(setq calendar-day-name-array ["Sonntag" "Montag" "Dienstag" "Mittwoch"
"Donnerstag" "Freitag" "Samstag"])
(setq calendar-month-name-array ["Januar" "Februar" "März" "April" "Mai"
"Juni" "Juli" "August" "September"
"Oktober" "November" "Dezember"])
(setq solar-n-hemi-seasons
'("Frühlingsanfang" "Sommeranfang" "Herbstanfang" "Winteranfang"))
(setq general-holidays
'((holiday-fixed 1 1 "Neujahr")
(holiday-fixed 5 1 "1. Mai")
(holiday-fixed 10 3 "Tag der Deutschen Einheit")))
(setq christian-holidays
'((holiday-float 12 0 -4 "1. Advent" 24)
(holiday-float 12 0 -3 "2. Advent" 24)
(holiday-float 12 0 -2 "3. Advent" 24)
(holiday-float 12 0 -1 "4. Advent" 24)
(holiday-fixed 12 25 "1. Weihnachtstag")
(holiday-fixed 12 26 "2. Weihnachtstag")
(holiday-fixed 1 6 "Heilige Drei Könige")
(let* ((century (1+ (/ displayed-year 100)))
(shifted-epact (% (+ 14 (* 11 (% displayed-year 19))
(- (/ (* 3 century) 4))
(/ (+ 5 (* 8 century)) 25)
(* 30 century))
30))
(adjusted-epact (if (or (= shifted-epact 0)
(and (= shifted-epact 1)
(< 10 (% displayed-year 19))))
(1+ shifted-epact)
shifted-epact))
(paschal-moon (- (calendar-absolute-from-gregorian
(list 4 19 displayed-year))
adjusted-epact))
(easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
(filter-visible-calendar-holidays
(mapcar
(lambda (l)
(list (calendar-gregorian-from-absolute (+ easter (car l)))
(nth 1 l)))
'(
(-48 "Rosenmontag")
( -2 "Karfreitag")
( 0 "Ostersonntag")
( +1 "Ostermontag")
(+39 "Christi Himmelfahrt")
(+49 "Pfingstsonntag")
(+50 "Pfingstmontag")
(+60 "Fronleichnam")))))
(holiday-fixed 8 15 "Mariä Himmelfahrt")
(holiday-fixed 11 1 "Allerheiligen")
(holiday-float 11 3 1 "Buß- und Bettag" 16)
(holiday-float 11 0 1 "Totensonntag" 20)))
(setq calendar-holidays
(append general-holidays local-holidays other-holidays
christian-holidays solar-holidays))
(setq local-holidays christian-holidays)
(require 'cal-tex)
(setq cal-tex-24 t)
(setq cal-tex-holidays nil)
(setq cal-tex-diary t)
(setq cal-tex-buffer (expand-file-name "~/xxx/tex/calender.tex"))
(setq diary-file "~/.diary")
(setq mark-diary-entries-in-calendar t)
(require 'diary-lib)
(add-hook 'diary-display-hook 'fancy-diary-display)
(add-hook 'list-diary-entries-hook 'sort-diary-entries)
(require 'appt)
(require 'time)
(setq display-time-24hr-format t)
(display-time)
(setq appt-display-mode-line nil)
(add-hook 'diary-hook 'appt-make-list)
(defun reminder ()
"Have a mail message sent to you at a specified time"
(interactive)
(let* ((date (read-from-minibuffer "Remind me on: "
(cons (format-time-string "%d.%m.%Y") 0)))
(time (read-from-minibuffer
"At: "
(if (equal date (format-time-string "%d.%m.%Y"))
(format-time-string "%H:%M")
(format-time-string "%H:%M" (cons 0 (* 5 60 60))))))
(msg (read-from-minibuffer "Message: " nil nil nil nil))
(msgbuffer (get-buffer-create "*Reminders*"))
(oldbuffer (current-buffer))
(msg-start))
(switch-to-buffer msgbuffer)
(insert date " " time ": ")
(setq msg-start (point))
(insert "cat << EOF | mail -s \"Reminder!\" " (user-login-name) "\n"
msg "\nEOF\n")
(call-process-region msg-start (point) "at" nil t nil time date)
(bury-buffer msgbuffer)
(switch-to-buffer oldbuffer)))