From 689c3bd5088c385fda6ce8054eb659737080d694 Mon Sep 17 00:00:00 2001 From: Rahul Martim Juliato Date: Tue, 12 May 2026 00:16:55 -0300 Subject: [PATCH] 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'. --- lisp/textmodes/markdown-ts-mode-x.el | 6 +++++- lisp/textmodes/markdown-ts-mode.el | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/textmodes/markdown-ts-mode-x.el b/lisp/textmodes/markdown-ts-mode-x.el index 1327191828e..1296e3567a3 100644 --- a/lisp/textmodes/markdown-ts-mode-x.el +++ b/lisp/textmodes/markdown-ts-mode-x.el @@ -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 "\n" diff --git a/lisp/textmodes/markdown-ts-mode.el b/lisp/textmodes/markdown-ts-mode.el index 12e2e7c37f9..d2f4fcd8fa7 100644 --- a/lisp/textmodes/markdown-ts-mode.el +++ b/lisp/textmodes/markdown-ts-mode.el @@ -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))