emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Switching over from package org-radiobutton to native support
@ 2022-11-26 23:27 Terje Larsen
  2022-12-12 14:17 ` Ihor Radchenko
  2022-12-13  0:11 ` Samuel Wales
  0 siblings, 2 replies; 3+ messages in thread
From: Terje Larsen @ 2022-11-26 23:27 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

So I found out that there is now native support for radio-button style
selects and I have tested it and it seems to work well.

However I am missing a function similar to `org-radiobutton-value`:
https://github.com/Fuco1/org-radiobutton/blob/master/org-radiobutton.el#L111-L121

That will return the value of the currently selected checkbox by the
attached name.

So for example:

#+ATTR_ORG: :radio t
#+NAME: named_radio_value
- [ ] Value A
- [X] Value B
- [ ] Value C

Would return `Value B` for `named_radio_value`. This is useful when
creating interfaces in Org Mode and acting on those.

I know it is possible via a mouthful of lisp. But it would be nice if it
was natively supported. It would also be nice if this also worked for
normal lists, e.g. having the possibility to easily extract all selected
values.

What do you think? Is something like this already implemented, but I missed
it?

Best regards,
Terje Larsen

[-- Attachment #2: Type: text/html, Size: 1692 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Switching over from package org-radiobutton to native support
  2022-11-26 23:27 Switching over from package org-radiobutton to native support Terje Larsen
@ 2022-12-12 14:17 ` Ihor Radchenko
  2022-12-13  0:11 ` Samuel Wales
  1 sibling, 0 replies; 3+ messages in thread
From: Ihor Radchenko @ 2022-12-12 14:17 UTC (permalink / raw)
  To: Terje Larsen; +Cc: emacs-orgmode

Terje Larsen <terlar@gmail.com> writes:

> However I am missing a function similar to `org-radiobutton-value`:
> https://github.com/Fuco1/org-radiobutton/blob/master/org-radiobutton.el#L111-L121
> ...
> I know it is possible via a mouthful of lisp. But it would be nice if it
> was natively supported. It would also be nice if this also worked for
> normal lists, e.g. having the possibility to easily extract all selected
> values.
>
> What do you think? Is something like this already implemented, but I missed
> it?

Check out `org-list-struct'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Switching over from package org-radiobutton to native support
  2022-11-26 23:27 Switching over from package org-radiobutton to native support Terje Larsen
  2022-12-12 14:17 ` Ihor Radchenko
@ 2022-12-13  0:11 ` Samuel Wales
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Wales @ 2022-12-13  0:11 UTC (permalink / raw)
  To: Terje Larsen; +Cc: emacs-orgmode

not sure what you mean by return.

org core code for a while now has included a minor mode for radio
buttons.  i think, however, #+ syntax and no mode is better if it
means that you can do it per list or per sublist.

that can also be used for other list features, such as ensuring bullet
style cnsistency or so.

On 11/26/22, Terje Larsen <terlar@gmail.com> wrote:
> So I found out that there is now native support for radio-button style
> selects and I have tested it and it seems to work well.
>
> However I am missing a function similar to `org-radiobutton-value`:
> https://github.com/Fuco1/org-radiobutton/blob/master/org-radiobutton.el#L111-L121
>
> That will return the value of the currently selected checkbox by the
> attached name.
>
> So for example:
>
> #+ATTR_ORG: :radio t
> #+NAME: named_radio_value
> - [ ] Value A
> - [X] Value B
> - [ ] Value C
>
> Would return `Value B` for `named_radio_value`. This is useful when
> creating interfaces in Org Mode and acting on those.
>
> I know it is possible via a mouthful of lisp. But it would be nice if it
> was natively supported. It would also be nice if this also worked for
> normal lists, e.g. having the possibility to easily extract all selected
> values.
>
> What do you think? Is something like this already implemented, but I missed
> it?
>
> Best regards,
> Terje Larsen
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-13  0:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-26 23:27 Switching over from package org-radiobutton to native support Terje Larsen
2022-12-12 14:17 ` Ihor Radchenko
2022-12-13  0:11 ` Samuel Wales

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).