branch: elpa/adoc-mode
commit de18a1750564cf0eb458c7e1b9aec115bc7353ea
Author: Florian Kaufmann <[email protected]>
Commit: Florian Kaufmann <[email protected]>
fl keyword for comments now in new-style
---
adoc-mode-test.el | 14 ++++++++++++++
adoc-mode.el | 10 ++++++----
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/adoc-mode-test.el b/adoc-mode-test.el
index 337c618350..f07b2524f1 100644
--- a/adoc-mode-test.el
+++ b/adoc-mode-test.el
@@ -121,6 +121,20 @@
"open block line 1\nopen block line 2" nil "\n" nil
"--" markup-meta-hide-face "\n" nil))
+(ert-deftest adoctest-test-comments ()
+ (adoctest-faces "comments"
+ ;; as block macro
+ "// lorem ipsum\n" markup-comment-face
+ "\n" nil
+ ;; as inline macro
+ "lorem ipsum\n" 'no-face
+ "// dolor sit\n" markup-comment-face
+ "amen\n" 'no-face
+ "\n" nil
+ ;; as delimited block
+ ;; tested in delimited-blocks-simple
+ ))
+
(ert-deftest adoctest-test-quotes-simple ()
(adoctest-faces "test-quotes-simple"
;; note that in unconstraned quotes cases " ipsum " has spaces around, in
diff --git a/adoc-mode.el b/adoc-mode.el
index 5a74af9182..fc301aef6b 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -1161,21 +1161,23 @@ When LITERAL-P is non-nil, the contained text is
literal text."
(list "^\\(<\\{3,\\}+\\)[ \t]*$"
'(1 '(face adoc-delimiter adoc-reserved block-del)))
;; comment
- ;; ^//(?P<passtext>[^/].*|)$=#comment[normal]
+ ;; (?mu)^[\\]?//(?P<passtext>[^/].*|)$
+ ;; I don't know what the [\\]? should mean
(list "^\\(//\\(?:[^/].*\\|\\)\n\\)"
- '(1 '(face adoc-comment adoc-reserved block-del)))
+ '(1 '(face markup-comment-face adoc-reserved block-del)))
;; image
+ ;; (?u)^(?P<name>image|unfloat)::(?P<target>\S*?)(\[(?P<attrlist>.*?)\])$
(list "^\\(\\(image::\\)\\([^ \t\n]*?\\)\\(\\[.*?\\]\\)\\)[ \t]*$"
'(1 '(face nil adoc-reserved block-del)) ; whole match
'(2 adoc-hide-delimiter) ; macro name
'(3 adoc-complex-replacement) ; file name
'(4 adoc-delimiter)) ; attribute list inlcl. []
- ;; passthrough:
(?u)^(?P<name>pass)::(?P<subslist>\S*?)(\[(?P<passtext>.*?)\])$=#
+ ;; passthrough:
(?u)^(?P<name>pass)::(?P<subslist>\S*?)(\[(?P<passtext>.*?)\])$
;; todo
;; -- general block macro
;; also highlight yet unknown block macros
- ;; general syntax:
(?u)^(?P<name>image|unfloat)::(?P<target>\S*?)(\[(?P<attrlist>.*?)\])$=#
+ ;; general syntax:
(?u)^(?P<name>image|unfloat)::(?P<target>\S*?)(\[(?P<attrlist>.*?)\])$
(list "^[a-zA-Z0-9_]+::\\([^ \t\n]*?\\)\\(\\[.*?\\]\\)[ \t]*$"
'adoc-delimiter)