[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org cc3a13c1fe 2/2: lisp/org-colview.el: Add defcustom
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org cc3a13c1fe 2/2: lisp/org-colview.el: Add defcustom `org-columns-checkbox-allowed-values' |
Date: |
Sat, 6 Apr 2024 09:58:31 -0400 (EDT) |
branch: externals/org
commit cc3a13c1feca46b0ac47fa9351a9c543952d1cf9
Author: SÅ‚awomir Grochowski <slawomir.grochowski@gmail.com>
Commit: Ihor Radchenko <yantar92@posteo.net>
lisp/org-colview.el: Add defcustom `org-columns-checkbox-allowed-values'
* lisp/org-colview.el Add defcustom
`org-columns-checkbox-allowed-values'.
(org-columns-next-allowed-value): Introduce variable
`org-columns-checkbox-allowed-values'.
This would allow to use more than two states ("[ ]", "[X]") in columns
with SUMMARY-TYPE that use checkbox ("X", "X/", "X%"). For example
you can add an intermediate state ("[-]"). Or empty state ("") to
remove checkbox.
* etc/ORG-NEWS: New option ~org-columns-checkbox-states~.
---
etc/ORG-NEWS | 7 +++++++
lisp/org-colview.el | 15 ++++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 8c1f6a0267..aeb7ffd4b2 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -1828,6 +1828,13 @@ following properties: ~:hook~, ~:prepare-finalize~,
prior to their global counterparts for the selected template.
** New options
+*** New option ~org-columns-checkbox-allowed-values~
+
+This would allow to use more than two states ("[ ]", "[X]") in
+columns with SUMMARY-TYPE that use checkbox ("X", "X/", "X%").
+For example you can add an intermediate state ("[-]").
+Or empty state ("") to remove 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 8a5c33236e..2c232eb81c 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -59,6 +59,19 @@
;;; Configuration
+(defcustom org-columns-checkbox-allowed-values '("[ ]" "[X]")
+ "Allowed values for columns with SUMMARY-TYPE that uses checkbox.
+The affected summary types are \"X%\", \"X/\", and \"X\" (see info
+node `(org)Column attributes')."
+ :group 'org-properties
+ :package-version '(Org . "9.6")
+ :type '(repeat (choice
+ (const :tag "Unchecked [ ]" "[ ]")
+ (const :tag "Checked [X]" "[X]")
+ (const :tag "No checkbox" "")
+ (const :tag "Intermediate state [-]" "[-]")
+ (string :tag "Arbitrary 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 +750,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-allowed-values))
(org-colview-construct-allowed-dates value))))
(if previous (reverse all) all))))
(when (equal key "ITEM") (error "Cannot edit item headline from here"))