]> code.delx.au - gnu-emacs/blobdiff - lisp/calendar/appt.el
; Merge from origin/emacs-25
[gnu-emacs] / lisp / calendar / appt.el
index 28e8948af9b908caece703997049d733b669396e..36ebd2d88129f08ebd6d03bf66fa0c82d07fe7f4 100644 (file)
@@ -1,7 +1,7 @@
 ;;; 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>
@@ -228,7 +228,7 @@ also calls `beep' for an audible reminder."
              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
@@ -472,7 +472,7 @@ separate appointment."
     (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 ()
@@ -482,7 +482,9 @@ Usually just deletes the appointment buffer."
     (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)))
 
@@ -511,13 +513,13 @@ The default is `appt-message-warning-time'."
   (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)))