From 6f8e56cb3d20977e0f4c77c1be913dfb61480cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Grochowski?= Date: Sat, 16 Mar 2024 13:29:53 +0100 Subject: [PATCH] lisp/org-colview.el: Add defcustom `org-columns-checkbox-states' * lisp/org-colview.el Add defcustom `org-columns-checkbox-states'. (org-columns-next-allowed-value): Introduce variable `org-columns-checkbox-states'. This would allow to use more than two states ("[ ]", "[X]") in "org-columns-checkbox". In e.g to add an intermediate state ("[-]") which is also present in "org-checkbox". * etc/ORG-NEWS New option ~org-columns-checkbox-states~ --- etc/ORG-NEWS | 5 +++++ lisp/org-colview.el | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index ca73f06e7..1cb4b0c8e 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -1753,6 +1753,11 @@ following properties: ~:hook~, ~:prepare-finalize~, prior to their global counterparts for the selected template. ** New options +*** New option ~org-columns-checkbox-states~ + +This would allow to use more than two states ("[ ]", "[X]") in "org-columns-checkbox". +In e.g to add an intermediate state ("[-]") which is also present in "org-checkbox". + *** A new option for custom setting ~org-refile-use-outline-path~ to show document title in refile targets Setting ~org-refile-use-outline-path~ to ~'title~ will show title diff --git a/lisp/org-colview.el b/lisp/org-colview.el index d71c84a76..eac85d3d6 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -59,6 +59,11 @@ ;;; Configuration +(defcustom org-columns-checkbox-states '("[ ]" "[X]") + "Checkbox states to cycle between." + :group 'checkbox + :type '(repeat string)) + (defcustom org-columns-modify-value-for-display-function nil "Function that modifies values for display in column view. For example, it can be used to cut out a certain part from a time stamp. @@ -737,7 +742,7 @@ an integer, select that value." (let ((all (or (org-property-get-allowed-values pom key) (pcase (nth column org-columns-current-fmt-compiled) - (`(,_ ,_ ,_ ,(or "X" "X/" "X%") ,_) '("[ ]" "[X]"))) + (`(,_ ,_ ,_ ,(or "X" "X/" "X%") ,_) org-columns-checkbox-states)) (org-colview-construct-allowed-dates value)))) (if previous (reverse all) all)))) (when (equal key "ITEM") (error "Cannot edit item headline from here")) -- 2.30.2