Skip to content

Commit f6926df

Browse files
author
github-actions
committed
[docgen] Update doc/orgmode.txt
1 parent 1c46d8e commit f6926df

File tree

1 file changed

+78
-5
lines changed

1 file changed

+78
-5
lines changed

doc/orgmode.txt

Lines changed: 78 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ CONTENTS *orgmode-content
8686
1.3.3.2. org_capture_refile...............|orgmode-org_capture_refile|
8787
1.3.3.3. org_capture_kill...................|orgmode-org_capture_kill|
8888
1.3.3.4. org_capture_show_help.........|orgmode-org_capture_show_help|
89-
1.3.4. Closing note mappings...............|orgmode-closing_note_mappings|
89+
1.3.4. Note mappings...............................|orgmode-note_mappings|
9090
1.3.4.1. org_note_finalize.................|orgmode-org_note_finalize|
9191
1.3.4.2. org_note_kill.........................|orgmode-org_note_kill|
9292
1.3.4.3. org_note_show_help...............|orgmode-org_note_show_help|
@@ -157,8 +157,10 @@ CONTENTS *orgmode-content
157157
1.7. Autocompletion...................................|orgmode-autocompletion|
158158
1.8. Abbreviations.....................................|orgmode-abbreviations|
159159
1.9. Formatting...........................................|orgmode-formatting|
160-
1.10. Colors..................................................|orgmode-colors|
161-
1.10.1. Highlight Groups........................|orgmode-highlight_groups|
160+
1.10. User interface..................................|orgmode-user_interface|
161+
1.10.1. Colors............................................|orgmode-colors|
162+
1.10.1.1. Highlight Groups..................|orgmode-highlight_groups|
163+
1.10.2. Menu................................................|orgmode-menu|
162164
1.11. Advanced search................................|orgmode-advanced_search|
163165
1.12. Notifications (experimental)......|orgmode-notifications_(experimental)|
164166
1.12.1. Cron................................................|orgmode-cron|
@@ -199,7 +201,9 @@ TABLE OF CONTENT *orgmode-table_of_conten
199201
7. Autocompletion (#autocompletion)
200202
8. Abbreviations (#abbreviations)
201203
9. Formatting (#formatting)
202-
10. Colors (#colors)
204+
10. User interface (#user-interface)
205+
1. Colors (#colors)
206+
2. Menu (#menu)
203207
11. Advanced search (#advanced-search)
204208
12. Notifications (experimental) (#notifications-experimental)
205209
13. Clocking (#clocking)
@@ -1021,7 +1025,7 @@ These mappings live under `mappings.capture`, and can be changed like this:
10211025
})
10221026
<
10231027

1024-
CLOSING NOTE MAPPINGS *orgmode-closing_note_mappings*
1028+
NOTE MAPPINGS *orgmode-note_mappings*
10251029

10261030
Mappings used in closing note window.
10271031

@@ -1528,6 +1532,8 @@ Currently, these things are formatted:
15281532
* Clock entries total time is recalculated (see Recalculating totals (#recalculating-totals) in Clocking (#Clocking) section)
15291533

15301534
--------------------------------------------------------------------------------
1535+
USER INTERFACE *orgmode-user_interface*
1536+
15311537
COLORS *orgmode-colors*
15321538

15331539
Colors used for todo keywords and agenda states (deadline, schedule ok, schedule warning)
@@ -1585,6 +1591,73 @@ HIGHLIGHT GROUPS *orgmode-highlight_group
15851591
* `OrgAgendaScheduled`: A scheduled item in the agenda view
15861592
* `OrgAgendaScheduledPast`: A item past its scheduled date in the agenda view
15871593

1594+
MENU *orgmode-menu*
1595+
1596+
The menu is used when selecting further actions in `agenda`, `capture` and `export`. Here is an example of the menu you see when opening `agenda`:
1597+
>
1598+
Press key for an agenda command
1599+
-------------------------------
1600+
a Agenda for current week or day
1601+
t List of all TODO entries
1602+
m Match a TAGS/PROP/TODO query
1603+
M Like m, but only for TODO entries
1604+
s Search for keywords
1605+
q Quit
1606+
<
1607+
1608+
Users have the option to change the appearance of this menu. To do this, you need to add a handler in the UI configuration section:
1609+
>
1610+
require("orgmode").setup({
1611+
ui = {
1612+
menu = {
1613+
handler = function(data)
1614+
-- your handler here, for example:
1615+
local options = {}
1616+
local options_by_label = {}
1617+
for _, item in ipairs(data.items) do
1618+
-- Only MenuOption has `key`
1619+
-- Also we don't need `Quit` option because we can close the menu with ESC
1620+
if item.key and item.label:lower() ~= "quit" then
1621+
table.insert(options, item.label)
1622+
options_by_label[item.label] = item
1623+
end
1624+
end
1625+
local handler = function(choice)
1626+
if not choice then
1627+
return
1628+
end
1629+
local option = options_by_label[choice]
1630+
if option.action then
1631+
option.action()
1632+
end
1633+
end
1634+
vim.ui.select(options, {
1635+
propmt = data.propmt,
1636+
}, handler)
1637+
end,
1638+
},
1639+
},
1640+
})
1641+
<
1642+
1643+
When the menu is called, the handler receives a table `data` with the following fields as input:
1644+
* `title` (`string`) — menu title
1645+
* `items` (`table`) — array containing `MenuItem` (see below)
1646+
* `prompt` (`string`) — prompt text used to prompt a keystroke
1647+
1648+
Each menu item `MenuItem` is one of two types: `MenuOption` and `MenuSeparator`.
1649+
1650+
`MenuOption` is a table containing the following fields:
1651+
* `label` (`string`) — description of the action
1652+
* `key` (`string`) — key that will be processed when the keys are pressed in the menu
1653+
* `action` (`function` optional) — handler that will be called when the `key` is pressed in the menu.
1654+
1655+
`MenuSeparator` is a table containing the following fields:
1656+
* `icon` (`string` optional) — character used as separator. The default character is `-`
1657+
* `length` (`number` optional) — number of repetitions of the separator character. The default length is 80
1658+
1659+
In order for the menu to work as expected, the handler must call `action` from `MenuItem`.
1660+
15881661
--------------------------------------------------------------------------------
15891662
ADVANCED SEARCH *orgmode-advanced_search*
15901663

0 commit comments

Comments
 (0)