[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode 1206fe7409 103/199: adoc-re-inline-macro can now
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode 1206fe7409 103/199: adoc-re-inline-macro can now also match in the middle of a word |
Date: |
Sun, 3 Sep 2023 06:59:38 -0400 (EDT) |
branch: elpa/adoc-mode
commit 1206fe74090a5712bc6f19077e91b1f463c19276
Author: sensorflo <sensorflo@gmail.com>
Commit: sensorflo <sensorflo@gmail.com>
adoc-re-inline-macro can now also match in the middle of a word
---
adoc-mode.el | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/adoc-mode.el b/adoc-mode.el
index 0faa49e3b1..c5a01e0e4d 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -1169,13 +1169,15 @@ 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 only-empty-attriblist)
+(defun adoc-re-inline-macro (&optional cmd-name target unconstrained
only-empty-attriblist)
"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 ONLY-EMPTY-ATTRIBLIST is non-nil, only an
-empty attribut list is matched.
+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.
Subgroups of returned regexp:
1 cmd name
@@ -1186,7 +1188,8 @@ Subgroups of returned regexp:
6 ]"
;; !!! \< is not exactly what AsciiDoc does, see regex above
(concat
- "\\(\\<" (if cmd-name (concat "\\(?:" cmd-name "\\)") "\\w+") "\\)"
+ (unless unconstrained "\\<")
+ "\\(" (if cmd-name (concat "\\(?:" cmd-name "\\)") "\\w+") "\\)"
"\\(:\\)"
"\\(" (if target (regexp-quote target) "[^ \t\n]*?") "\\)"
"\\(\\[\\)\\(" (unless only-empty-attriblist ".*?\\(?:\n.*?\\)??")
"\\)\\(\\]\\)" ))
@@ -1534,7 +1537,7 @@ considered to be 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 t)
'(0) '(0)))
+ `(lambda (end) (adoc-kwf-std end ,(adoc-re-inline-macro cmd-name nil nil
t) '(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
- [nongnu] elpa/adoc-mode 526e058665 029/199: added another list item test, (continued)
- [nongnu] elpa/adoc-mode 526e058665 029/199: added another list item test, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a0ddf0f02d 034/199: added tests for images, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 1a4e93ec7c 035/199: enhanded general block macro incl. tests, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode fcabdc3a7e 037/199: added general inline macro, began reworking anchors, touched image, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 656e7670c5 099/199: fixed type: denote -> demote, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2cfd433622 030/199: extended quotes tests, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a61e7cd749 063/199: added AsciiDoc menu & key map, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 22bd99a194 075/199: test: Use with-temp-buffer instead home-brewed solution, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a3d77b0c15 082/199: bumped copyright year, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a8142043e5 094/199: adoc customization group comment puts more emphasis on that most faces belong to markup-faces, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 1206fe7409 103/199: adoc-re-inline-macro can now also match in the middle of a word,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode 0ac95247d4 116/199: refactoring so regexp's for one- and two line titles have group 2 for title's text, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 411eb48ce9 120/199: Sensorflo/pr35 (#3), ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 69569ee920 105/199: improved fontifying for footnoteref, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 6dc82593f0 162/199: Document the mode's history, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 4415af4a53 036/199: fixed typo in identifier, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode fdc42c818a 044/199: removed TAGS file, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 47fc7143a3 048/199: test, ELPA Syncer, 2023/09/03
- [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