Repository navigation
Fix the AsciiDoc menu and tempo templates - #94
Merged
Merged
Conversation
The Macros submenu bound `adoc-xref', `adoc-xref-default-syntax' and `adoc-image', none of which exist (the commands are the tempo-template-adoc-* ones), and `tempo-template-adoc-comment', which was never defined. The 0.9.0 cleanup of the menu missed them. The comment entry now runs adoc-insert-comment: with a region it puts `// ' at the start of each of its lines (an AsciiDoc comment has to start in the first column, which comment-region doesn't guarantee), and without one it inserts a comment line through a new adoc-comment template. Also add the comma the "Passthrough macros" :help was missing, so it shows the help text instead of a symbol name.
Each template passed (bound-and-true-p adoc-help-*) as its docstring, evaluated when the template was defined. adoc-mode required adoc-mode-tempo before defining those constants, and byte-compiling adoc-mode.el (which package.el does in the running Emacs on install) loads the templates without evaluating them either, so every template ended up with tempo's generic "Insert a adoc-..." docstring. Pass the variable instead and read it when the docstring is asked for, through the function-documentation property, so the load order no longer matters.
Their menu entries read "(TM) -> ™" and "-- -> —", but the templates inserted `(T)' and `---', neither of which Asciidoctor replaces.
adoc-tempo-on-region called (symbol-name this-command), which signals when the command is a lambda: a key bound to a lambda, a hydra head or a transient suffix. Every template using `bol', `tr' or `r-or-n' broke then, and so did loading adoc-mode, as building the menu runs the title templates.
bbatsov
force-pushed
the
fix-menu-and-templates
branch
from
October 7, 2026 17:16
8e69e3d to
9ab42a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four menu entries pointed at commands that don't exist, the templates' docstrings never picked up the AsciiDoc help text, the trademark and dash templates inserted text Asciidoctor doesn't replace, and a lambda
this-commandbroke the templates and even loading the mode.The comment menu entry is now backed by a small
adoc-insert-commentcommand rather than a plain template: a//comment has to start in the first column, which neither a tempo template wrapping the region norcomment-regiondoes for every line.