[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode b508984663 106/199: id attribute of footnoteref
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode b508984663 106/199: id attribute of footnoteref now uses markup-internal-reference-face if it's used as reference opposed to anchor |
Date: |
Sun, 3 Sep 2023 06:59:38 -0400 (EDT) |
branch: elpa/adoc-mode
commit b508984663addb5e62de84ee5febaba2a582d32f
Author: sensorflo <sensorflo@gmail.com>
Commit: sensorflo <sensorflo@gmail.com>
id attribute of footnoteref now uses markup-internal-reference-face if it's
used as reference opposed to anchor
---
adoc-mode-test.el | 4 ++--
adoc-mode.el | 36 +++++++++++++++++++++++-------------
2 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/adoc-mode-test.el b/adoc-mode-test.el
index 2fd651fe85..836a5eeeae 100644
--- a/adoc-mode-test.el
+++ b/adoc-mode-test.el
@@ -314,7 +314,7 @@ removed before TRANSFORM is evaluated.
;; simple example
"footnoteref" markup-command-face ":" markup-meta-face
"[" markup-meta-face
- "myid" markup-anchor-face
+ "myid" markup-internal-reference-face
"]" markup-meta-face "\n" nil
"footnoteref" markup-command-face ":" markup-meta-face
@@ -328,7 +328,7 @@ removed before TRANSFORM is evaluated.
"lorem" 'no-face
"footnoteref" markup-command-face ":" markup-meta-face
"[" markup-meta-face
- "myid" markup-anchor-face
+ "myid" markup-internal-reference-face
"]" markup-meta-face "\n" nil
"lorem" 'no-face
diff --git a/adoc-mode.el b/adoc-mode.el
index 390ddc836a..36b140157b 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -1170,22 +1170,25 @@ subgroups:
;; asciidoc.conf itself says: Default (catchall) inline macro is not
;; implemented. It _would_ be
;; (?su)[\\]?(?P<name>\w(\w|-)*?):(?P<target>\S*?)\[(?P<passtext>.*?)(?<!\\)\]=
-(defun adoc-re-inline-macro (&optional cmd-name target unconstrained
only-empty-attriblist)
+(defun adoc-re-inline-macro (&optional cmd-name target unconstrained
attribute-list-constraints)
"Returns regex matching an inline macro.
Id CMD-NAME is nil, any command is matched. It maybe a regexp
itself in order to match multiple commands. If TARGET is nil, any
target is matched. When UNCONSTRAINED is nil, the returned regexp
begins with '\<', i.e. it will _not_ match when CMD-NAME is part
-of a previous word. When ONLY-EMPTY-ATTRIBLIST is non-nil, only
-an empty attribut list is matched.
+of a previous word. When ATTRIBUTE-LIST-CONSTRAINTS is 'empty,
+only an empty attribut list is matched, if it's
+'single-attribute, only an attribute list with exactly one
+attribute is matched.
Subgroups of returned regexp:
1 cmd name
2 :
3 target
4 [
-5 attribute list, exclusive brackets [], also when only-empty-attriblist is
non-nil
+5 attribute list, exclusive brackets [], also when
+ attribute-list-constraints is non-nil
6 ]"
;; !!! \< is not exactly what AsciiDoc does, see regex above
(concat
@@ -1193,7 +1196,12 @@ Subgroups of returned regexp:
"\\(" (if cmd-name (concat "\\(?:" cmd-name "\\)") "\\w+") "\\)"
"\\(:\\)"
"\\(" (if target (regexp-quote target) "[^ \t\n]*?") "\\)"
- "\\(\\[\\)\\(" (unless only-empty-attriblist ".*?\\(?:\n.*?\\)??")
"\\)\\(\\]\\)" ))
+ "\\(\\[\\)\\("
+ (cond
+ ((eq attribute-list-constraints 'empty) "")
+ ((eq attribute-list-constraints 'single-attribute)
"[^\n,]*?\\(?:\n[^\n,]*?\\)??")
+ (t ".*?\\(?:\n.*?\\)??"))
+ "\\)\\(\\]\\)" ))
;; todo: use same regexps as for font lock
(defun adoc-re-paragraph-separate ()
@@ -1504,7 +1512,7 @@ When LITERAL-P is non-nil, the contained text is literal
text."
'(3 nil)) ; grumbl, I dont know how to get rid of it
`(4 '(face ,(or del-face markup-meta-hide-face) adoc-reserved t) t)));
close del
-(defun adoc-kw-inline-macro (&optional cmd-name unconstrained cmd-face
target-faces target-meta-p attribute-list)
+(defun adoc-kw-inline-macro (&optional cmd-name unconstrained
attribute-list-constraints cmd-face target-faces target-meta-p attribute-list)
"Returns a kewyword which highlights an inline macro.
For CMD-NAME and UNCONSTRAINED see
@@ -1516,7 +1524,7 @@ empty string, the second is used if its not the empty
string. If
TARGET-META-P is non-nil, the target text is considered to be
meta characters."
(list
- `(lambda (end) (adoc-kwf-std end ,(adoc-re-inline-macro cmd-name nil
unconstrained) '(1 2 4 5) '(0)))
+ `(lambda (end) (adoc-kwf-std end ,(adoc-re-inline-macro cmd-name nil
unconstrained attribute-list-constraints) '(1 2 4 5) '(0)))
`(1 '(face ,(or cmd-face markup-command-face) adoc-reserved t) t) ; cmd-name
'(2 '(face markup-meta-face adoc-reserved t) t) ; :
`(3 ,(cond ((not target-faces) markup-meta-face) ; target
@@ -1547,7 +1555,7 @@ meta characters."
(defun adoc-kw-inline-macro-urls-no-attribute-list ()
(let ((cmd-name (regexp-opt '("http" "https" "ftp" "file" "irc" "mailto"
"callto" "link"))))
(list
- `(lambda (end) (adoc-kwf-std end ,(adoc-re-inline-macro cmd-name nil nil
t) '(0) '(0)))
+ `(lambda (end) (adoc-kwf-std end ,(adoc-re-inline-macro cmd-name nil nil
'empty) '(0) '(0)))
'(1 '(face markup-reference-face adoc-reserved t) append) ; cmd-name
'(2 '(face markup-reference-face adoc-reserved t) append) ; :
'(3 '(face markup-reference-face adoc-reserved t) append) ;
target
@@ -2019,13 +2027,15 @@ meta characters."
;; Macros using default syntax, but having special highlighting in adoc-mode
(adoc-kw-inline-macro-urls-no-attribute-list)
(adoc-kw-inline-macro-urls-attribute-list)
- (adoc-kw-inline-macro "anchor" nil nil markup-anchor-face t '("xreflabel"))
- (adoc-kw-inline-macro "image" nil markup-complex-replacement-face
markup-internal-reference-face t
+ (adoc-kw-inline-macro "anchor" nil nil nil markup-anchor-face t
'("xreflabel"))
+ (adoc-kw-inline-macro "image" nil nil markup-complex-replacement-face
markup-internal-reference-face t
'("alt"))
- (adoc-kw-inline-macro "xref" nil nil '(markup-reference-face
markup-internal-reference-face) t
+ (adoc-kw-inline-macro "xref" nil nil nil '(markup-reference-face
markup-internal-reference-face) t
'(("caption") (("caption" . markup-reference-face))))
- (adoc-kw-inline-macro "footnote" t nil nil nil 'entire-attribute-list)
- (adoc-kw-inline-macro "footnoteref" t nil nil nil '("id" "text"))
+ (adoc-kw-inline-macro "footnote" t nil nil nil nil 'entire-attribute-list)
+ (adoc-kw-inline-macro "footnoteref" t 'single-attribute nil nil nil
+ '(("id") (("id" . markup-internal-reference-face))))
+ (adoc-kw-inline-macro "footnoteref" t nil nil nil nil '("id" "text"))
(adoc-kw-standalone-urls)
;; Macros using default syntax and having default highlighting in adoc-mod
- [nongnu] elpa/adoc-mode 30176c0f3c 054/199: added skelleton for generig promote / denote, (continued)
- [nongnu] elpa/adoc-mode 30176c0f3c 054/199: added skelleton for generig promote / denote, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 303019657d 060/199: many things with xref and anchor, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 6cb42436d2 067/199: test: running the test is now more smoothly, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 838684c227 068/199: comment improvements, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 950223b614 070/199: reworked highlighting of urls, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode d80b29ebc9 072/199: test: bugfix: point was wronly positioned in adoctest-trans, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 63abada690 074/199: test: adoctest-trans learned setting mark using <>, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 0a35871ac3 083/199: edited (doc-)comments to make it fit package format guidelines, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2bbd6a36ac 088/199: bumped version to 0.6.2, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b6d54d9007 097/199: bumped version to 0.6.4, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b508984663 106/199: id attribute of footnoteref now uses markup-internal-reference-face if it's used as reference opposed to anchor,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode ab42f4909a 107/199: (un)constrained quotes can now spawn more than two lines, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 61974788b4 109/199: small reformatting, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2bcfcea743 112/199: improved comments, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 9916b51199 113/199: small refactoring in field of the adoc-attribute-list text property, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 9957855384 115/199: bumpded version to 0.6.6, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 414e920433 121/199: Avoid some compilation warnings., ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 141af8c56a 123/199: Associate with .adoc and .asciidoc, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 474b8f0878 126/199: Correct links, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 66cd5645a0 130/199: Clean up the front-matter, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 183e983a5d 161/199: [Fix #17] Don't add non-title entries to imenu (#18), ELPA Syncer, 2023/09/03