From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id CIijDZhTEGbxBQEAqHPOHw:P1 (envelope-from ) for ; Fri, 05 Apr 2024 21:40:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id CIijDZhTEGbxBQEAqHPOHw (envelope-from ) for ; Fri, 05 Apr 2024 21:40:08 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=JXh8vdh0; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712346008; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6HeCsT0Y82oZ37p65T5mGEhGfxM2FjuMLTz1dtZFxfY=; b=rSPgni1130KpPVsj5uuzNfuBam7vJIQ/TNMr8UOnkgvrvxKHYIh9DCuHMfzGggB77miLZJ 1OSGAK4Tr9dQ4PNFcZtsuhFayk3xzlah/Kcx5wMsKNDhaOBPKuNpW9OPxNR/mhYfCz+KBO qT7f89S109/u4+nI+Cc4meX+NhiRNmp3HMtTWy2uhKEcxaANFW+SJkhm6R7oiFO+vSMUnh YviBmg42qftGgRvmHqzwnF6h50drWMhReqyudti3SzirQ+1OPdVNJRvMd0smIBA3HsmVaw jM64RY1GdlSwolVLohu8Ru312snJ25jC9vNTz3to/P7f4HVMuu+gdrh5c+kciQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=JXh8vdh0; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712346008; a=rsa-sha256; cv=none; b=hO5GyMNJAugfwkhpP2JLfoRfaj3izgxYBOdOUIb/gFxzhq3kVlEQNwvZArKvGXC1EOvMWy UJSAZmU/3n/z0bSHBtzU116JQAO2pl/MzxswtM3QtnFECerJnthfq95G0yPabsVY4SSyVk i2eQGfnCM0CgFBU+YjH2wz2w7QY2ofNqpIhLay9szFE2vJmS4WByA7/Zu1jGDzI/A6YbGs xZs9RGjQijT98SxsMMOf8GpMAl0Hv1T6NZIYYw68jiLzkjudyJYxLg9Pzl2E1vURzWdlhr eiV+cmJPVxWWwitjzQOuMNlq51JzzUV2U7OEQyK8aIoQz/FnuFSnf+IQaNiP/g== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AEECD381E6 for ; Fri, 05 Apr 2024 21:40:07 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rspPD-0001BQ-0g; Fri, 05 Apr 2024 15:39:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rspPA-0001BF-VL for emacs-orgmode@gnu.org; Fri, 05 Apr 2024 15:39:16 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rspP7-00074T-Kv for emacs-orgmode@gnu.org; Fri, 05 Apr 2024 15:39:16 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B7C62240103 for ; Fri, 5 Apr 2024 21:39:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712345951; bh=KHIVuCvoQWRYos8t6Q3wqZmTQODxOKM6iaml3flN3Ek=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=JXh8vdh0CSTqvrL64883nDuOdCdrrevS1Scq6uaprc0dEm55UK2AFeMl/qtX4Y38C 5+RWnyPOYP6YuU35D1An9E+fHeKr4DKiWlfQ5zk4Y5TUxbIY2p/iMzrpEPtkP6B69U Y2d1LJf0EpON+a/KgR3M7CnTgUi0mGE/nqluw3YwKkkJ/gqleaye+Gb2RXO5zb4g01 +8IUh9f59VHt+gKtcucrApuR+WFk2DdJIGXMH5dDIGpmr7+Zr2wHkcqVJRh7B28g8r 9dkEC7nPEr6EuD5GVdGPQPIKMUMtUDuuAF/yGfrYrgk8RKhzNI04ZEIadRl+GhKnZl ER1+S6SDnq4Gg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VB81p1qhfz6tn4; Fri, 5 Apr 2024 21:39:10 +0200 (CEST) From: Ihor Radchenko To: =?utf-8?Q?S=C5=82awomir?= Grochowski Cc: emacs-orgmode@gnu.org Subject: Re: [FR] 'org-columns-next-allowed-value' for 'summary-checkbox'es functions should have 'intermediate state' '[-]' In-Reply-To: <87cyr5c7zg.fsf@gmail.com> References: <87frw2cmgo.fsf@gmail.com> <87wmpdt7w1.fsf@localhost> <87cyr5c7zg.fsf@gmail.com> Date: Fri, 05 Apr 2024 19:39:23 +0000 Message-ID: <877chboaz8.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.56 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -9.56 X-Migadu-Queue-Id: AEECD381E6 X-TUID: ymyiDKHKmYNI --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable S=C5=82awomir Grochowski writes: >> Do not forget to add :package-version.=20 > > Thank you for bringing it to my attention. > > Patch in attachment. Thanks! I improved the patch a bit, with minor changes to the commit message and adding more to the docstring and type spec of the defcustom. I also changed the custom group (:group 'checkbox does not exist). See the attached. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0001-lisp-org-colview.el-Add-defcustom-org-columns-che.patch >From b96aa5fdc710975f8cc1ac195783b1dce34b90b2 Mon Sep 17 00:00:00 2001 Message-ID: From: =?UTF-8?q?S=C5=82awomir=20Grochowski?= Date: Sat, 16 Mar 2024 13:29:53 +0100 Subject: [PATCH v2] 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 8c1f6a026..aeb7ffd4b 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 8a5c33236..b25cd0231 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -59,6 +59,19 @@ (defvar org-inlinetask-min-level) ;;; 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 "In progress [-]" "[-]") + (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 @@ (defun org-columns-next-allowed-value (&optional previous nth) (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")) -- 2.44.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--