emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug?: org-agenda-to-appt Munging Deadline Dates and Scheduled Times
@ 2013-05-15  0:53 Nick Daly
  2013-05-15 14:32 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Daly @ 2013-05-15  0:53 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

Hi all, please let me know if the attached minimal example doesn't
come through for whatever reason.

It looks like (org-agenda-to-appt) displays a todo item on its
deadline date at the scheduled time, if the scheduled and deadline
dates are different (and the deadline has no time).  The expected
behavior is to not consider the deadline an appointment at a
particular time at all (because it has none specified).

Thanks for your time,
Nick

[-- Attachment #2: schedule-deadline-munging.org --]
[-- Type: application/octet-stream, Size: 3068 bytes --]

* Overview

  =org-agenda-to-appt= appears to be munging scheduled and deadline dates: An
  appointment with a scheduled time of [2013-05-15 Wed 11:00] appears as an
  appointment on its deadline day, at [2013-05-17 Fri 11:00].  Because the
  deadline has no time, it should not show up as an appointment on 
  [2013-05-17 Fri].

** TODO Appointment that Shouldn't Display
   DEADLINE: <2013-05-17 Fri> SCHEDULED: <2013-05-15 Wed 11:00-12:00>

   This appointment does, but should not, show in the agenda notification
   because it was scheduled for last week, not this week.

   Unfortunately, it pops up at [2013-05-17 Fri 11:00], seemingly because it
   combined the deadline date and the scheduled time.

** TODO Appointment that Should Display
   SCHEDULED: <2013-05-17 Fri 11:00-11:30>

   This appointment does not, but should, display in the agenda notification,
   because it is scheduled for [2013-05-17 Fri 11:00].

* Supporting Source

  The =~/.emacs= source required to show messages for upcoming appointments.

  Execute each of these source blocks in order to create this issue on 
  [2013-05-17 Fri 11:00].

** Enable Appointment Notification

   Notify when appointments are about to begin.

   #+begin_src elisp
     (defun appointment-notify ()
       "Notify of appointments.
     
       Shamelessly lifted from http://emacs-fu.blogspot.com/2009/11/showing-pop-ups.html"
     
       (defun display-appointments (min-to-app new-time msg)
         (appointment-notify (concat "Appointment in " min-to-app " minute(s)") msg))
     
       ;; enable notification warnings.
       (setq
        appt-disp-window-function 'display-appointments
        appt-message-warning-time '15
        appt-display-format 'window   ;; use our func
        async-shell-command-buffer 'new-buffer
        appt-disp-window-function (function display-appointments))
       (appt-activate 1)              ;; active appt (appointment notification)
       (display-time))                ;; time display is required for this...
     (appointment-notify)
     
   #+end_src

** Enable Automatic Agenda Refreshes

   Refresh the agenda every 5 minutes.

   #+begin_src elisp
     (defun org-agenda-timed-refresh ()
       "Call org-agenda-redo function even in the non-agenda buffer.
     
       Pulled from http://orgmode.org/worg/org-hacks.html#sec-1-9-12"
       (interactive)
       (org-save-all-org-buffers)
       (org-agenda-to-appt)
       (let ((agenda-window (get-buffer-window org-agenda-buffer-name t)))
         (when agenda-window
           (with-selected-window agenda-window (org-agenda-redo)))))
     (run-at-time nil 300 'org-agenda-timed-refresh)
     
   #+end_src

** Notify Appointments are Starting

   #+begin_src elisp
     (defun appointment-notify (title msg &optional icon sound)
       (interactive)
       (message (concat title ": " msg)))
     
   #+end_src

** Add this File to the Agenda

   #+begin_src elisp
     (org-agenda-file-to-front)
   #+end_src

** Display the Agenda

   #+begin_src elisp
     (org-agenda-list)
   #+end_src

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-15 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15  0:53 Bug?: org-agenda-to-appt Munging Deadline Dates and Scheduled Times Nick Daly
2013-05-15 14:32 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).