GNU bug report logs - #5176
appt improvement

Previous Next

Package: emacs;

Reported by: Ivan Kanis <expire-by-2009-12-15 <at> kanis.fr>

Date: Thu, 10 Dec 2009 18:15:04 UTC

Severity: wishlist

Tags: patch

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5176 in the body.
You can then email your comments to 5176 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report stored :
bug#5176; Package emacs,calendar. (Thu, 10 Dec 2009 18:15:05 GMT) Full text and rfc822 format available.

Message #3 received at quiet <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Ivan Kanis <expire-by-2009-12-15 <at> kanis.fr>
To: quiet <at> debbugs.gnu.org
Subject: appt improvement
Date: Thu, 10 Dec 2009 18:09:45 +0100
Severity: wishlist
Tags: patch
Package: emacs,calendar

[ resent from emacs-devel ]

Hello,

I use appt. I find that a global time delay for each appointments is
inconvenient. For example I need to be warned an hour before an appointment
downtown and only 5 minutes for a meeting at work. The following patch
keeps track of a delay for each appointment. It should be backward
compatible with the old appt.

Ivan Kanis


diff -r cc9589a0e76c lisp/misc/appt.el
--- a/lisp/misc/appt.el Thu Dec 10 17:56:17 2009 +0100
+++ b/lisp/misc/appt.el Thu Dec 10 17:58:21 2009 +0100
@@ -355,6 +355,8 @@
         ;; calculate the number of minutes until the appointment.
         (when (and appt-issue-message appt-time-msg-list)
           (setq appt-comp-time (caar (car appt-time-msg-list))
+                appt-warn-time (or (nth 3 (car appt-time-msg-list))
+                                   appt-message-warning-time)
                 min-to-app (- appt-comp-time cur-comp-time))
           (while (and appt-time-msg-list
                       (< appt-comp-time cur-comp-time))
@@ -362,21 +364,21 @@
             (if appt-time-msg-list
                 (setq appt-comp-time (caar (car appt-time-msg-list)))))
           ;; If we have an appointment between midnight and
-          ;; `appt-message-warning-time' minutes after midnight, we
+          ;; `appt-warn-time' minutes after midnight, we
           ;; must begin to issue a message before midnight.  Midnight
           ;; is considered 0 minutes and 11:59pm is 1439
           ;; minutes.  Therefore we must recalculate the minutes to
           ;; appointment variable.  It is equal to the number of
           ;; minutes before midnight plus the number of minutes after
           ;; midnight our appointment is.
-          (if (and (< appt-comp-time appt-message-warning-time)
-                   (> (+ cur-comp-time appt-message-warning-time)
+          (if (and (< appt-comp-time appt-warn-time)
+                   (> (+ cur-comp-time appt-warn-time)
                       appt-max-time))
               (setq min-to-app (+ (- (1+ appt-max-time) cur-comp-time)
                                   appt-comp-time)))
           ;; Issue warning if the appointment time is within
           ;; appt-message-warning time.
-          (when (and (<= min-to-app appt-message-warning-time)
+          (when (and (<= min-to-app appt-warn-time)
                      (>= min-to-app 0))
             (setq appt-now-displayed t
                   appt-display-count (1+ prev-appt-display-count))
@@ -472,14 +474,20 @@
   "[0-9]?[0-9]\\(h\\([0-9][0-9]\\)?\\|[:.][0-9][0-9]\\)\\(am\\|pm\\)?")
 
 ;;;###autoload
-(defun appt-add (new-appt-time new-appt-msg)
+(defun appt-add (new-appt-time new-appt-msg new-appt-warning-time)
   "Add an appointment for today at NEW-APPT-TIME with message NEW-APPT-MSG.
 The time should be in either 24 hour format or am/pm format."
-  (interactive "sTime (hh:mm[am/pm]): \nsMessage: ")
+  (interactive "sTime (hh:mm[am/pm]): \nsMessage: 
+sDelay in minutes (press return for default): ")
   (unless (string-match appt-time-regexp new-appt-time)
     (error "Unacceptable time-string"))
+  (setq new-appt-warning-time
+        (if (string= new-appt-warning-time "")
+            appt-message-warning-time
+          (string-to-number new-appt-warning-time)))
   (let ((time-msg (list (list (appt-convert-time new-appt-time))
-                        (concat new-appt-time " " new-appt-msg) t)))
+                        (concat new-appt-time " " new-appt-msg) t
+                        new-appt-warning-time)))
     (unless (member time-msg appt-time-msg-list)
       (setq appt-time-msg-list
             (appt-sort-list (nconc appt-time-msg-list (list
             time-msg)))))))







bug reassigned from package 'emacs,calendar' to 'emacs'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 30 Mar 2010 07:12:02 GMT) Full text and rfc822 format available.

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Tue, 15 Jun 2010 03:43:01 GMT) Full text and rfc822 format available.

Notification sent to Ivan Kanis <expire-by-2009-12-15 <at> kanis.fr>:
bug acknowledged by developer. (Tue, 15 Jun 2010 03:43:02 GMT) Full text and rfc822 format available.

Message #10 received at 5176-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 5176-done <at> debbugs.gnu.org
Subject: Re: bug#5176: appt improvement
Date: Mon, 14 Jun 2010 23:42:41 -0400
Thanks; added to emacs-23 branch.

(Perhaps you won't receive this, since you seem to be using
time-sensitive email addresses.)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 13 Jul 2010 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 295 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.