orgbox icon indicating copy to clipboard operation
orgbox copied to clipboard

Schedule deadline

Open yasuhito opened this issue 10 years ago • 1 comments

What options are needed for scheduling deadline with orgbox?

deadline options:

  • today
  • end of week
  • end of month
  • etc.

(See also #9)

yasuhito avatar May 29 '14 01:05 yasuhito

Thank you for this library, Yasuhito. I really enjoy using orgbox for scheduled tasks but miss having it for deadlines as well.

In case someone is interested in a deadline version it can be enough to temporarily replace org-schedule with org-deadline and call the originals. Works for me! :)

;; Add deadline versions of orgbox

(require 'cl-lib)

(defun my/orgbox-deadline (&rest args)
  "Like orgbox-schedule but for deadlines.  Passes through ARGS."
  (interactive (advice-eval-interactive-spec
                (cadr (interactive-form #'orgbox-schedule))))
  (cl-letf (((symbol-function #'org-schedule) #'org-deadline))
    (apply #'orgbox-schedule args)))

(defun my/orgbox-agenda-deadline (&rest args)
  "Like orgbox-agenda-schedule but for deadlines.  Passes through ARGS."
  (interactive (advice-eval-interactive-spec
                (cadr (interactive-form #'orgbox-agenda-schedule))))
  (cl-letf (((symbol-function #'org-schedule) #'org-deadline))
    (apply #'orgbox-agenda-schedule args)))

(define-key org-mode-map (kbd "C-c C-d") 'my/orgbox-deadline)
(define-key org-agenda-mode-map (kbd "C-c C-d") 'my/orgbox-agenda-deadline)

ZaneA avatar Aug 02 '19 01:08 ZaneA