;;; appt.el --- appointment notification functions
-;; Copyright (C) 1989-1990, 1994, 1998, 2001-2012
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1989-1990, 1994, 1998, 2001-2016 Free Software
+;; Foundation, Inc.
;; Author: Neil Mager <neilm@juliet.ll.mit.edu>
;; Maintainer: Glenn Morris <rgm@gnu.org>
string (car string)))
(cond ((eq appt-display-format 'window)
;; TODO use calendar-month-abbrev-array rather than %b?
- (let ((time (format-time-string "%a %b %e " (current-time)))
+ (let ((time (format-time-string "%a %b %e "))
err)
(condition-case err
(funcall appt-disp-window-function
(shrink-window-if-larger-than-buffer (get-buffer-window appt-disp-buf t))
(set-buffer-modified-p nil)
(setq buffer-read-only t)
- (raise-frame (selected-frame))
+ (raise-frame)
(select-window this-window)))
(defun appt-delete-window ()
(and window
(or (eq window (frame-root-window (window-frame window)))
(delete-window window))))
- (kill-buffer appt-buffer-name)
+ (let ((buffer (get-buffer appt-buffer-name)))
+ (when buffer
+ (kill-buffer buffer)))
(if appt-audible
(beep 1)))
(interactive "sTime (hh:mm[am/pm]): \nsMessage: \n\
sMinutes before the appointment to start warning: ")
(unless (string-match appt-time-regexp time)
- (error "Unacceptable time-string"))
+ (user-error "Unacceptable time-string"))
(and (stringp warntime)
(setq warntime (unless (string-equal warntime "")
(string-to-number warntime))))
(and warntime
(not (integerp warntime))
- (error "Argument WARNTIME must be an integer, or nil"))
+ (user-error "Argument WARNTIME must be an integer, or nil"))
(or appt-timer (appt-activate))
(let ((time-msg (list (list (appt-convert-time time))
(concat time " " msg) t)))