Skip to content

Commit

Permalink
Add: (org-ql-view-relative-deadline-prefix)
Browse files Browse the repository at this point in the history
  • Loading branch information
alphapapa committed Sep 11, 2024
1 parent a3c0205 commit 82f762e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 48 deletions.
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like:

*Additions*
+ Face ~org-ql-view-title~, applied to view titles in header line.
+ Option ~org-ql-view-relative-deadline-prefix~.

*Changes*
+ Command ~org-ql-find~ respects narrowing of the current buffer by default, allowing searching within the narrowed region. (Using one ~C-u~ argument widens the current buffer, and using two ~C-u~ arguments prompts for the buffers to search.)
Expand Down
10 changes: 9 additions & 1 deletion org-ql-view.el
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ See info node `(elisp)Cyclic Window Ordering'."
(sexp :tag "org-super-agenda grouping expression")
(variable :tag "Variable holding org-super-agenda grouping expression"))))))))

(defcustom org-ql-view-relative-deadline-prefix "due "
;; TODO(v0.9): Add one for scheduled, too.
"Prefix for relative deadlines.
Relative deadlines are, e.g. \"in 5d\", \"5d ago\"."
:type 'string)

;;;; Commands

;;;###autoload
Expand Down Expand Up @@ -1021,7 +1027,9 @@ property."
(deadline-day-number (org-time-string-to-absolute
(org-element-timestamp-interpreter deadline-date 'ignore)))
(difference-days (- today-day-number deadline-day-number))
(relative-due-date (org-add-props (org-ql-view--format-relative-date difference-days) nil
(relative-due-date (org-add-props
(concat org-ql-view-relative-deadline-prefix
(org-ql-view--format-relative-date difference-days)) nil
'help-echo (org-element-property :raw-value deadline-date)))
;; FIXME: Unused for now: (todo-keyword (org-element-property :todo-keyword element))
;; FIXME: Unused for now: (done-p (member todo-keyword org-done-keywords))
Expand Down
95 changes: 48 additions & 47 deletions org-ql.info
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ File: README.info, Node: 09-pre, Next: 089, Up: Changelog

*Additions*
• Face ‘org-ql-view-title’, applied to view titles in header line.
• Option ‘org-ql-view-relative-deadline-prefix’.

*Changes*
• Command ‘org-ql-find’ respects narrowing of the current buffer by
Expand Down Expand Up @@ -2153,53 +2154,53 @@ Node: Links39051
Node: Tips39738
Node: Changelog40062
Node: 09-pre41029
Node: helm-org-ql (1)41743
Node: 08941884
Node: 08843026
Node: 08744102
Node: 08645330
Node: 08545564
Node: 08446220
Node: 08346672
Node: 08247013
Node: 08147406
Node: 0847829
Node: 07450555
Node: 07350780
Node: 07251514
Node: 07152435
Node: 0753246
Node: 06356112
Node: 06256645
Node: 06156952
Node: 0657522
Node: 05260578
Node: 05160880
Node: 0561305
Node: 04962836
Node: 04863118
Node: 04763467
Node: 04663876
Node: 04564284
Node: 04464645
Node: 04365004
Node: 04265207
Node: 04165368
Node: 0465615
Node: 03269716
Node: 03170119
Node: 0370316
Node: 02373616
Node: 02273850
Node: 02174130
Node: 0274335
Node: 0178413
Node: Development78514
Node: Copyright assignment78747
Node: Notes79337
Node: Comparison with Org Agenda searches79501
Node: org-sidebar80390
Node: License80669
Node: helm-org-ql (1)41801
Node: 08941942
Node: 08843084
Node: 08744160
Node: 08645388
Node: 08545622
Node: 08446278
Node: 08346730
Node: 08247071
Node: 08147464
Node: 0847887
Node: 07450613
Node: 07350838
Node: 07251572
Node: 07152493
Node: 0753304
Node: 06356170
Node: 06256703
Node: 06157010
Node: 0657580
Node: 05260636
Node: 05160938
Node: 0561363
Node: 04962894
Node: 04863176
Node: 04763525
Node: 04663934
Node: 04564342
Node: 04464703
Node: 04365062
Node: 04265265
Node: 04165426
Node: 0465673
Node: 03269774
Node: 03170177
Node: 0370374
Node: 02373674
Node: 02273908
Node: 02174188
Node: 0274393
Node: 0178471
Node: Development78572
Node: Copyright assignment78805
Node: Notes79395
Node: Comparison with Org Agenda searches79559
Node: org-sidebar80448
Node: License80727

End Tag Table

Expand Down

0 comments on commit 82f762e

Please sign in to comment.