emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request: Radio button option for lists of checkboxes


From: Phil Sainty
Subject: Re: Feature request: Radio button option for lists of checkboxes
Date: Wed, 12 Feb 2020 12:41:29 +1300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]