From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Sainty Subject: Re: Feature request: Radio button option for lists of checkboxes Date: Wed, 12 Feb 2020 12:41:29 +1300 Message-ID: <2ef6c2f0-012e-be7c-81d4-df7434c151a2@orcon.net.nz> References: <58c2c0d3-f65c-45ba-dd45-5dcd29a17d42@orcon.net.nz> <87o8u4soto.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:46098) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1f9v-0007Ii-9W for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 18:41:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1f9t-00007y-VM for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 18:41:38 -0500 In-Reply-To: <87o8u4soto.fsf@gnu.org> Content-Language: en-GB List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Bastien Cc: matus.goljer@gmail.com, emacs-orgmode@gnu.org, John Kitchin On 12/02/20 12:10 pm, Bastien wrote: > From latest master, please try C-c C-x C-r on a checkbox or turn > on M-x org-list-checkbox-radio-mode RET so that C-c C-c consider > all checkboxes as radio buttons. Brilliant, thanks Bastien! A nice feature that may be missing from this implementation is the ability to mark individual lists as radio-button lists, and then have C-c C-c do the right thing contextually. The syntax John and Matúš used was: #+attr_org: :radio - [ ] localhost - [X] staging - [ ] production Then you can always just use C-c C-c to select a checkbox -- but if the list is intended to be radio buttons then that behaviour gets used automatically. If that's practical to add to the new implementation, I would think it would provide the best end-user experience for interacting with such lists. -Phil p.s. Their code for detecting this was along similar lines: (when (-contains? (org-element-property :attr_org (org-element-property :parent (org-element-context))) ":radio") vs (let ((list (org-radiobutton--get-list-at-point))) (when (-contains? (org-element-property :attr_org list) ":radio")