mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-05-30 17:22:17 -07:00
Use 'read-multiple-choice' in 'markdown-ts-mode' (bug#81027)
Replace the "c" character-prompt interactive spec with 'read-multiple-choice', which presents named options instead of requiring users to decode the prompt string and type a single character. * lisp/textmodes/markdown-ts-mode.el (markdown-ts-table-align-column): Use 'read-multiple-choice'. Adjust ALIGN docstring punctuation. * lisp/textmodes/markdown-ts-mode-x.el (markdown-ts-toc-insert-template): Use 'read-multiple-choice'.
This commit is contained in:
parent
71809ee5df
commit
689c3bd508
2 changed files with 12 additions and 3 deletions
|
|
@ -736,7 +736,11 @@ is nil and the command is run interactively, prompt for a template.
|
|||
The basic template uses all defaults and is likely the best choice for
|
||||
most uses. The complete template illustrates all parameters set to
|
||||
their defaults and is useful as a starting point to customize a table."
|
||||
(interactive "cTemplate [b]asic [c]omplete:")
|
||||
(interactive
|
||||
(list (car (read-multiple-choice
|
||||
"Table of contents template"
|
||||
'((?b "basic")
|
||||
(?c "complete"))))))
|
||||
(pcase char
|
||||
(?b
|
||||
(insert "<!-- markdown-ts-toc: -->\n"
|
||||
|
|
|
|||
|
|
@ -4392,13 +4392,18 @@ Note: To compute the column, point must be within the column and cannot
|
|||
be on the leading or trailing whitespace or on a column delimiter.
|
||||
|
||||
ALIGN can be one of the symbols `left', `center', `right' or nil for
|
||||
unspecified or the characters l, c, or r.
|
||||
unspecified, or the characters l, c, or r.
|
||||
|
||||
If ALIGN is nil, assume unspecified. Make the alignment string a
|
||||
minimum of 5 characters to accommodate Markdown conventions.
|
||||
|
||||
If point is not at a table, do nothing."
|
||||
(interactive "cAlign column [l]eft [c]enter [r]ight [u]nspecified:")
|
||||
(interactive
|
||||
(list (car (read-multiple-choice
|
||||
"Align column" '((?l "left")
|
||||
(?c "center")
|
||||
(?r "right")
|
||||
(?u "unspecified"))))))
|
||||
(markdown-ts--barf-if-not-mode 'markdown-ts-table-align-column)
|
||||
(setq align (if (characterp align)
|
||||
(pcase align (?l 'left) (?c 'center) (?r 'right))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue