branch: elpa/adoc-mode
commit 24523d5da6de9dc7641b5987129d3b34798cefa5
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Modernise menu and tempo templates
Replace the deprecated AsciiDoc.py curved-quote templates (`text' and
``text'') with the modern "`text`" / '`text`' forms, label `text`
plainly as Monospaced, and relabel the +text+ / ++text++ templates as
passthroughs (they are no longer monospace). Also fix three menu entries
that pointed at non-existent templates and so errored when invoked.
---
CHANGELOG.md | 1 +
adoc-mode-tempo.el | 6 ++++--
adoc-mode.el | 26 ++++++++++++++------------
doc/spec-compliance.adoc | 18 +++++++++++-------
test/adoc-mode-tempo-test.el | 5 ++++-
5 files changed, 34 insertions(+), 22 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f5a5d61c3..2e477c0419 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,7 @@
### Changes
+- Bring the AsciiDoc menu and tempo templates in line with modern AsciiDoc.
The deprecated AsciiDoc.py curved-quote templates `` `text' `` and `` ``text''
`` are replaced by the modern `` "`text`" `` and `` '`text`' `` ones
(`adoc-double-curved-quote` / `adoc-single-curved-quote`); `` `text` `` is
labelled simply "Monospaced"; and the `+text+` / `++text++` templates are
relabelled as passthroughs rather than monospace. This also fixes three menu
entries that referenced non-existent templ [...]
- Title promotion and demotion move to `M-left` and `M-right` (org-style),
freeing up `C-c C-p` and `C-c C-d` for the new heading-navigation commands.
Previously `adoc-promote` lived on `C-c C-p` and `adoc-demote` on `C-c C-d`.
- `adoc-gen-face`, `adoc-verbatim-face`, `adoc-secondary-text-face`, and
`adoc-replacement-face` now inherit from `font-lock-*` faces instead of
hardcoding literal colours. Themes that style the font-lock palette will now
style AsciiDoc buffers consistently. Users who relied on the old defaults can
restore them via `M-x customize-face`.
- Simplify `adoc-meta-face` to `(:inherit shadow :slant normal :weight
normal)` instead of overriding eleven attributes including `:family
"Monospace"`. AsciiDoc markup characters now respect the user's font choices
and theme `shadow` colour rather than being forced into a monospace family with
hardcoded grays.
diff --git a/adoc-mode-tempo.el b/adoc-mode-tempo.el
index 72ed21b99b..4dbc4a80bb 100644
--- a/adoc-mode-tempo.el
+++ b/adoc-mode-tempo.el
@@ -116,8 +116,10 @@ which can be truthy even without an active region."
(adoc-tempo-define "adoc-bold" '("*" (r "text" text) "*") nil
(bound-and-true-p adoc-help-bold))
(adoc-tempo-define "adoc-typewriter-face" '("+" (r "text" text) "+") nil
(bound-and-true-p adoc-help-monospace))
(adoc-tempo-define "adoc-monospace-literal" '("`" (r "text" text) "`"))
-(adoc-tempo-define "adoc-single-quote" '("`" (r "text" text) "'") nil
(bound-and-true-p adoc-help-single-quote))
-(adoc-tempo-define "adoc-double-quote" '("``" (r "text" text) "''") nil
(bound-and-true-p adoc-help-double-quote))
+;; Modern curved (smart) quotes: "`text`" and '`text`'. These replace the
+;; deprecated AsciiDoc.py `text' / ``text'' templates.
+(adoc-tempo-define "adoc-double-curved-quote" '("\"`" (r "text" text) "`\"")
nil (bound-and-true-p adoc-help-double-quote))
+(adoc-tempo-define "adoc-single-curved-quote" '("'`" (r "text" text) "`'") nil
(bound-and-true-p adoc-help-single-quote))
(adoc-tempo-define "adoc-attributed" '("[" p "]#" (r "text" text) "#") nil
(bound-and-true-p adoc-help-attributed))
(adoc-tempo-define "adoc-underline" '("[.underline]#" (r "text" text) "#") nil
(bound-and-true-p adoc-help-underline))
(adoc-tempo-define "adoc-overline" '("[.overline]#" (r "text" text) "#") nil
(bound-and-true-p adoc-help-overline))
diff --git a/adoc-mode.el b/adoc-mode.el
index c3c5d4f51d..bf4d4715a3 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -407,9 +407,11 @@ customizable.")
(defconst adoc-help-monospace
"Aka typewritter. This does _not_ mean verbatim / literal")
(defconst adoc-help-single-quote
- "Single quotation marks around enclosed text.")
+ "Curved (smart) single quotation marks around the enclosed text,
+written as '`text`'.")
(defconst adoc-help-double-quote
- "Quotation marks around enclosed text.")
+ "Curved (smart) double quotation marks around the enclosed text,
+written as \"`text`\".")
(defconst adoc-help-underline
"Applies an underline decoration to the span of text.")
(defconst adoc-help-overline
@@ -4021,14 +4023,14 @@ ITEMS is a list of (name pos . level)."
:help ,adoc-help-emphasis ]
["*Bold*" tempo-template-adoc-bold
:help ,adoc-help-bold ]
- ["+Monospaced+" tempo-template-adoc-monospace
+ ["`Monospaced`" tempo-template-adoc-monospace-literal
:help ,adoc-help-monospace]
- ["`Monospaced literal`" tempo-template-adoc-monospace-literal ;
redundant to the one in the passthrough section
- :help ,adoc-help-monospace-literal]
- ["`Single quote'" tempo-template-adoc-single-quote
- :help ,adoc-help-single-quote]
- ["``Double quote''" tempo-template-adoc-double-quote
+ ["Passthrough: +text+" tempo-template-adoc-typewriter-face
+ :help ,adoc-help-pass]
+ ["Curved double quote: \"`text`\""
tempo-template-adoc-double-curved-quote
:help ,adoc-help-double-quote]
+ ["Curved single quote: '`text`'"
tempo-template-adoc-single-curved-quote
+ :help ,adoc-help-single-quote]
["The text [.underline]#underline me# is underlined."
tempo-template-adoc-underline
:help ,adoc-help-underline]
["The text [.overline]#overline me# is overlined."
tempo-template-adoc-overline
@@ -4051,8 +4053,8 @@ ITEMS is a list of (name pos . level)."
:help ,adoc-help-emphasis ]
["**Bold**" tempo-template-adoc-bold-uc
:help ,adoc-help-bold ]
- ["++Monospaced++" tempo-template-adoc-monospace-uc
- :help ,adoc-help-monospace]
+ ["Passthrough: ++text++" tempo-template-adoc-monospace-uc
+ :help ,adoc-help-pass]
["[attributes]##text##" tempo-template-adoc-attributed-uc
:help ,adoc-help-attributed])
("Text formatting - misc"
@@ -4174,9 +4176,9 @@ ITEMS is a list of (name pos . level)."
:help ,adoc-help-latexmath]
["+++text+++" tempo-template-adoc-pass-+++
:help ,adoc-help-pass-+++]
- ["$$text$$" tempo-template-pass-$$
+ ["$$text$$" tempo-template-adoc-pass-$$
:help ,adoc-help-pass-$$]
- ["`text`" tempo-template-monospace-literal ; redundant to the one
in the quotes section
+ ["`text`" tempo-template-adoc-monospace-literal ; redundant to the
one in the quotes section
:help ,adoc-help-monospace-literal])))
"---"
["Toggle display of images" adoc-toggle-images t]))
diff --git a/doc/spec-compliance.adoc b/doc/spec-compliance.adoc
index 3539e096a9..5c4362566b 100644
--- a/doc/spec-compliance.adoc
+++ b/doc/spec-compliance.adoc
@@ -50,8 +50,10 @@ Findings are graded:
| Medium
| text
-| The deprecated AsciiDoc.py curved-quote templates `` `text' `` and
- ``\`\`text''`` are still offered in the menu / tempo templates.
+| [.line-through]#The deprecated AsciiDoc.py curved-quote templates
+ `` `text' `` and ``\`\`text''`` are still offered in the menu / tempo
+ templates.# *FIXED* - replaced with the modern `+"`text`"+` / ``'`text`'``
+ templates; the `+...+` templates are relabelled as passthroughs.
| Low
| lists
@@ -122,8 +124,9 @@ Findings are graded:
| Legacy curved quotes `` `x' `` / ``\`\`x''``
| Deprecated in Asciidoctor
-| Not fontified (good), but still offered as menu/tempo templates
-| Low
+| Not fontified (good); the menu/tempo templates have been replaced by the
+ modern curved-quote forms
+| -
| Literal monospace `` `+x+` ``
| Backtick + plus enclosure (a passthrough shorthand)
@@ -388,9 +391,10 @@ implements.
attribute lists is left as a smaller follow-up.
. [x] *Add modern curved-quote highlighting* `+"`text`"+` and ``'`text`'``.
Done.
-. [ ] *Drop or de-emphasise the deprecated `` `text' `` / ``\`\`text''``
- templates* in the menu (and the `+...+` / `++...++` "Monospaced"
- templates), or relabel them as legacy.
+. [x] *Drop the deprecated `` `text' `` / ``\`\`text''`` templates* and
+ relabel the `+...+` / `++...++` ones. Done - the curved-quote templates
+ are replaced with the modern forms and the plus templates are relabelled
+ as passthroughs.
. [x] *Add the `icon:name[]` inline macro* to the recognised macro set.
Done.
. [ ] *Verify* CSV/DSV table formats, counters, and the literal-monospace
diff --git a/test/adoc-mode-tempo-test.el b/test/adoc-mode-tempo-test.el
index 2c444d2391..de54d244e2 100644
--- a/test/adoc-mode-tempo-test.el
+++ b/test/adoc-mode-tempo-test.el
@@ -28,7 +28,10 @@
(adoctest-quotes "**" "**" '(tempo-template-adoc-bold-uc))
(adoctest-quotes "++" "++" '(tempo-template-adoc-monospace-uc))
(adoctest-quotes "^" "^" '(tempo-template-adoc-superscript))
- (adoctest-quotes "~" "~" '(tempo-template-adoc-subscript)))
+ (adoctest-quotes "~" "~" '(tempo-template-adoc-subscript))
+ ;; modern curved (smart) quotes
+ (adoctest-quotes "\"`" "`\"" '(tempo-template-adoc-double-curved-quote))
+ (adoctest-quotes "'`" "`'" '(tempo-template-adoc-single-curved-quote)))
(ert-deftest adoctest-test-tempo-formatting-misc ()