added TIME_SHIFT property
This commit is contained in:
parent
3f55f7bac0
commit
ab801038ad
30
conf.el
30
conf.el
|
@ -189,6 +189,14 @@ event of an error or nonlocal exit."
|
|||
`(advice-remove ,(car adform) ,(nth 2 adform)))
|
||||
adlist))))
|
||||
|
||||
(defun nd/filter-list-prefix (prefix str-list)
|
||||
"Return a subset of tags-list whose first character matches prefix.'
|
||||
tags-list defaults to org-tag-alist if not given"
|
||||
(seq-filter (lambda (i)
|
||||
(and (stringp i)
|
||||
(string-prefix-p prefix i)))
|
||||
str-list))
|
||||
|
||||
(defun split-and-follow-horizontally ()
|
||||
(interactive)
|
||||
(split-window-below)
|
||||
|
@ -326,7 +334,7 @@ event of an error or nonlocal exit."
|
|||
(add-hook 'org-mode-hook
|
||||
(lambda ()
|
||||
(local-set-key (kbd "C-c C-x x") 'nd/mark-subtree-done)
|
||||
(local-set-key (kbd "C-c C-x c") 'nd/org-clone-subtree-with-time-shift-reset)))
|
||||
(local-set-key (kbd "C-c C-x c") 'nd/org-clone-subtree-with-time-shift)))
|
||||
|
||||
(evil-define-key 'motion org-agenda-mode-map
|
||||
"t" 'nd/toggle-project-toplevel-display
|
||||
|
@ -355,14 +363,6 @@ event of an error or nonlocal exit."
|
|||
("HOLD" :foreground "violet" :weight bold)
|
||||
("CANC" :foreground "deep sky blue" :weight bold)))
|
||||
|
||||
(defun nd/filter-list-prefix (prefix str-list)
|
||||
"Return a subset of tags-list whose first character matches prefix.'
|
||||
tags-list defaults to org-tag-alist if not given"
|
||||
(seq-filter (lambda (i)
|
||||
(and (stringp i)
|
||||
(string-prefix-p prefix i)))
|
||||
str-list))
|
||||
|
||||
(defun nd/add-tag-face (fg-name prefix)
|
||||
"Adds list of cons cells to org-tag-faces with foreground set to fg-name.
|
||||
Start and end specify the positions in org-tag-alist which define the tags
|
||||
|
@ -409,12 +409,14 @@ event of an error or nonlocal exit."
|
|||
(add-to-list 'org-default-properties "PARENT_TYPE")
|
||||
(add-to-list 'org-default-properties "OWNER")
|
||||
(add-to-list 'org-default-properties "GOAL")
|
||||
(add-to-list 'org-default-properties "TIME_SHIFT")
|
||||
|
||||
(setq org-global-properties
|
||||
'(("PARENT_TYPE_ALL" . "periodical iterator")
|
||||
("Effort_ALL" . "0:05 0:15 0:30 1:00 1:30 2:00 3:00 4:00 5:00 6:00")))
|
||||
|
||||
;; TODO this may not be needed
|
||||
(setq org-use-property-inheritance '("PARENT_TYPE"))
|
||||
(setq org-use-property-inheritance '("PARENT_TYPE" "TIME_SHIFT"))
|
||||
|
||||
(let ((capfile "~/Org/capture.org"))
|
||||
(setq org-capture-templates
|
||||
|
@ -1063,12 +1065,14 @@ is in the optional argument exclude"
|
|||
(interactive)
|
||||
(nd/mark-subtree-keyword "DONE" '("CANC")))
|
||||
|
||||
(defun nd/org-clone-subtree-with-time-shift-reset (n &optional shift)
|
||||
(defun nd/org-clone-subtree-with-time-shift (n &optional shift)
|
||||
"Like `org-clone-subtree-with-time-shift' except it resets checkboxes
|
||||
and reverts all todo keywords to TODO"
|
||||
(interactive "nNumber of clones to produce: ")
|
||||
(let ((shift (read-from-minibuffer
|
||||
"Date shift per clone (e.g. +1w, empty to copy unchanged): ")))
|
||||
|
||||
(let ((shift (or (org-entry-get nil "TIME_SHIFT" 'selective)
|
||||
(read-from-minibuffer
|
||||
"Date shift per clone (e.g. +1w, empty to copy unchanged): "))))
|
||||
(condition-case err
|
||||
(progn
|
||||
(org-clone-subtree-with-time-shift n shift)
|
||||
|
|
32
conf.org
32
conf.org
|
@ -495,7 +495,7 @@ By default, the tag selection window obliterates all but the current window...ho
|
|||
(add-hook 'org-mode-hook
|
||||
(lambda ()
|
||||
(local-set-key (kbd "C-c C-x x") 'nd/mark-subtree-done)
|
||||
(local-set-key (kbd "C-c C-x c") 'nd/org-clone-subtree-with-time-shift-reset)))
|
||||
(local-set-key (kbd "C-c C-x c") 'nd/org-clone-subtree-with-time-shift)))
|
||||
#+END_SRC
|
||||
*** agenda
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
|
@ -588,15 +588,17 @@ There are several types of tags I use:
|
|||
#+END_SRC
|
||||
** properties
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-to-list 'org-default-properties "PARENT_TYPE")
|
||||
(add-to-list 'org-default-properties "OWNER")
|
||||
(add-to-list 'org-default-properties "GOAL")
|
||||
(setq org-global-properties
|
||||
(add-to-list 'org-default-properties "PARENT_TYPE")
|
||||
(add-to-list 'org-default-properties "OWNER")
|
||||
(add-to-list 'org-default-properties "GOAL")
|
||||
(add-to-list 'org-default-properties "TIME_SHIFT")
|
||||
|
||||
(setq org-global-properties
|
||||
'(("PARENT_TYPE_ALL" . "periodical iterator")
|
||||
("Effort_ALL" . "0:05 0:15 0:30 1:00 1:30 2:00 3:00 4:00 5:00 6:00")))
|
||||
|
||||
;; TODO this may not be needed
|
||||
(setq org-use-property-inheritance '("PARENT_TYPE"))
|
||||
;; TODO this may not be needed
|
||||
(setq org-use-property-inheritance '("PARENT_TYPE" "TIME_SHIFT"))
|
||||
#+END_SRC
|
||||
** capture
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
|
@ -1335,9 +1337,9 @@ the agenda does not do this by default...it's annoying
|
|||
#+END_SRC
|
||||
** interactive functions
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun nd/mark-subtree-keyword (new-keyword &optional exclude)
|
||||
(defun nd/mark-subtree-keyword (new-keyword &optional exclude)
|
||||
"marks all tasks in a subtree with keyword unless original keyword
|
||||
is in the optional argument exclude"
|
||||
is in the optional argument exclude"
|
||||
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
|
||||
(if (not (listp exclude))
|
||||
(error "exlude must be a list if provided"))
|
||||
|
@ -1348,17 +1350,19 @@ the agenda does not do this by default...it's annoying
|
|||
(org-todo new-keyword)))
|
||||
(outline-next-heading)))))
|
||||
|
||||
(defun nd/mark-subtree-done ()
|
||||
(defun nd/mark-subtree-done ()
|
||||
"marks all tasks in subtree as DONE unless they are already canc"
|
||||
(interactive)
|
||||
(nd/mark-subtree-keyword "DONE" '("CANC")))
|
||||
|
||||
(defun nd/org-clone-subtree-with-time-shift-reset (n &optional shift)
|
||||
(defun nd/org-clone-subtree-with-time-shift (n &optional shift)
|
||||
"Like `org-clone-subtree-with-time-shift' except it resets checkboxes
|
||||
and reverts all todo keywords to TODO"
|
||||
and reverts all todo keywords to TODO"
|
||||
(interactive "nNumber of clones to produce: ")
|
||||
(let ((shift (read-from-minibuffer
|
||||
"Date shift per clone (e.g. +1w, empty to copy unchanged): ")))
|
||||
|
||||
(let ((shift (or (org-entry-get nil "TIME_SHIFT" 'selective)
|
||||
(read-from-minibuffer
|
||||
"Date shift per clone (e.g. +1w, empty to copy unchanged): "))))
|
||||
(condition-case err
|
||||
(progn
|
||||
(org-clone-subtree-with-time-shift n shift)
|
||||
|
|
Loading…
Reference in New Issue