{"id":17760171,"url":"https://github.com/fuco1/org-radiobutton","last_synced_at":"2025-04-01T13:15:27.833Z","repository":{"id":150147641,"uuid":"124680291","full_name":"Fuco1/org-radiobutton","owner":"Fuco1","description":"[SEMI-DEPRECATED] Radiobutton for org-mode lists.","archived":false,"fork":false,"pushed_at":"2022-01-04T14:48:58.000Z","size":15,"stargazers_count":31,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-07T07:46:21.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fuco1.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-03-10T17:31:48.000Z","updated_at":"2022-09-16T11:36:44.000Z","dependencies_parsed_at":"2023-04-12T05:18:16.810Z","dependency_job_id":null,"html_url":"https://github.com/Fuco1/org-radiobutton","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Forg-radiobutton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Forg-radiobutton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Forg-radiobutton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Forg-radiobutton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fuco1","download_url":"https://codeload.github.com/Fuco1/org-radiobutton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246644095,"owners_count":20810687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T19:00:55.086Z","updated_at":"2025-04-01T13:15:27.813Z","avatar_url":"https://github.com/Fuco1.png","language":"Emacs Lisp","readme":"#+STARTUP: showall\n\n* org-radiobutton [[https://travis-ci.org/Fuco1/org-radiobutton.svg?branch=master]]\n\n*Note*: there is now a built-in way to do this in org mode without extra\npackages.  See [[https://list.orgmode.org/CAJcAo8tAtCRc7yKaMryJMaAEQQieAb+Bvb+Qo73icqxd=cnN1Q@mail.gmail.com/T/][discussion]] and [[https://orgmode.org/worg/org-release-notes.html][changelog]]\n(=org-list-checkbox-radio-mode=).  This effectively makes this package\nunnecessary.\n\nRadiobuttons are groups of options where exactly one option has to be\nselected at all times.\n\nOrg mode checkbox lists allow selecting from a list of candidates but\nthe user would have to manually ensure the radiobutton property.\n\nThis package provides a convenient minor mode that will make sure the\nproperty is satisfied for lists which are marked as radiobutton lists.\n\nRead the [[https://fuco1.github.io/2018-03-11-Use-org-radiobutton-to-select-an-option-from-a-list.html][blog post]] for more background.\n\n* Installation\n\nInstall from [[https://melpa.org/#/org-radiobutton][MELPA]].  If you install manually make sure [[https://github.com/magnars/dash.el][dash.el]] is on\nyour load path.\n\n* Usage\n\nTo enable the mode call =global-org-radiobutton-mode=.  It is a global minor\nmode and automatically becomes active in all existing =org-mode=\nbuffers.\n\nRadiobutton list are excellent as sources for other code blocks in org\nmode.  This package provides an advice for =org-babel-read-element= to\nonly return the checked value of radiobutton list instead of the\nentire list.  You can therefore simply reference the list as any other\norg element and babel will resolve the reference to the checked item:\n\n#+BEGIN_SRC org\n,#+attr_org: :radio\n,#+name: service-to-query\n- [ ] localhost\n- [X] staging\n- [ ] production\n\n,#+BEGIN_SRC elisp :var service=service-to-query\n(format \"Will query the %s database\" service)\n,#+END_SRC\n\n,#+RESULTS:\n: Will query the staging database\n#+END_SRC\n\nIf the item has a description (part after =::=) this is not included in\nthe resolved value .  This package provides a query function\n=org-radiobutton-value= which takes an element name (or the list under\npoint) and returns the value of the selected item.  With the second\noptional argument the description is also returned:\n\n#+BEGIN_SRC org\n,#+attr_org: :radio\n,#+name: number\n- [ ] one :: 1\n- [X] two :: 2\n- [ ] three :: 3\n\n,#+BEGIN_SRC elisp :var number=(org-radiobutton-value \"number\" t)\n(-let (((desc value) (split-string number \" :: \")))\n  (format \"An item with description `%s' and value `%s'\" desc value))\n,#+END_SRC\n\n,#+RESULTS:\n: An item with description `two' and value `2'\n#+END_SRC\n\nThis is quite useful when doing something like [[http://howardism.org/Technical/Emacs/literate-devops.html][Emacs literate devops]]\nwhere we can build one pipeline to operate on multiple environments\nand toggle between them with a single =C-c C-c=.\n\n* Development\n\nWe use cask.  To run tests:\n\n#+BEGIN_SRC sh\ncask install\nmake\n#+END_SRC\n\n* Acknowledgement\n\nI was looking for this functionality and found [[http://kitchingroup.cheme.cmu.edu/blog/2015/10/05/A-checkbox-list-in-org-mode-with-one-value/][John Kitchin]]'s\nimplementation (via [[http://irreal.org/blog/?p=4644][Irreal]]) from a couple years ago.  I fixed it to\nwork with \"modern\" =org-mode= and added a couple additional features.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuco1%2Forg-radiobutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuco1%2Forg-radiobutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuco1%2Forg-radiobutton/lists"}