[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode 99917e0bdd 069/199: adoc-re-inline-macro can now
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode 99917e0bdd 069/199: adoc-re-inline-macro can now be told to match only an empty attribute list |
Date: |
Sun, 3 Sep 2023 06:59:35 -0400 (EDT) |
branch: elpa/adoc-mode
commit 99917e0bddd9397d00209d455330e6a44d9e0ac1
Author: Florian Kaufmann <sensorflo@gmail.com>
Commit: Florian Kaufmann <sensorflo@gmail.com>
adoc-re-inline-macro can now be told to match only an empty attribute list
---
adoc-mode.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/adoc-mode.el b/adoc-mode.el
index 03c4cecb46..40f4139786 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -883,25 +883,29 @@ subgroups:
;;
(?<!\w)[\\]?(?P<name>http|https|ftp|file|irc|mailto|callto|image|link|anchor|xref|indexterm):(?P<target>\S*?)\[(?P<attrlist>.*?)\]
;; # Default (catchall) inline macro is not implemented
;; # [\\]?(?P<name>\w(\w|-)*?):(?P<target>\S*?)\[(?P<passtext>.*?)(?<!\\)\]
-(defun adoc-re-inline-macro (&optional cmd-name target)
+;; Asciidocbug: At least with http, an attriblist only with whites lets
AsciiDoc
+;; crash
+(defun adoc-re-inline-macro (&optional cmd-name target only-empty-attriblist)
"Returns regex matching an inline macro.
-Id CMD-NAME is nil, any command is matched. If TARGET is nil, any
-target is matched.
+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.
Subgroups of returned regexp:
1 cmd name
2 :
3 target
4 [
-5 attribute list, exclusive brackets []
+5 attribute list, exclusive brackets [], also when only-empty-attriblist is
non-nil
6 ]"
;; !!! \< is not exactly what AsciiDoc does, see regex above
(concat
- "\\(\\<" (if cmd-name (regexp-quote cmd-name) "\\w+") "\\)"
+ "\\(\\<" (if cmd-name (concat "\\(?:" cmd-name "\\)") "\\w+") "\\)"
"\\(:\\)"
"\\(" (if target (regexp-quote target) "[^ \t\n]*?") "\\)"
- "\\(\\[\\)\\(.*?\\(?:\n.*?\\)??\\)\\(\\]\\)" ))
+ "\\(\\[\\)\\(" (unless only-empty-attriblist ".*?\\(?:\n.*?\\)??")
"\\)\\(\\]\\)" ))
;; todo: use same regexps as for font lock
(defun adoc-re-paragraph-separate ()
- [nongnu] elpa/adoc-mode b992b3bfc8 147/199: Shorten the README's extension, (continued)
- [nongnu] elpa/adoc-mode b992b3bfc8 147/199: Shorten the README's extension, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode fb1e49d7e1 153/199: Use setq-local where appropriate, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 800c316c90 155/199: [Fix #16] Prevent forward references error in adoc-mode-map, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode d3517e596d 102/199: all special inline macros are now fontified before the general inline macro, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode e36c0105ab 104/199: improved fontifying for footnotes, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 21bb167f67 108/199: improved comments and whites, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 8f8a1ef307 111/199: bumped version to 0.6.5, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode c117d58b4b 119/199: Merge pull request #1 from lukesanantonio/master, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 7ec9c3569d 134/199: Make TODO notes stand out, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 296df94325 135/199: Fix a bunch of typos, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 99917e0bdd 069/199: adoc-re-inline-macro can now be told to match only an empty attribute list,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode a976f1ac84 085/199: edited commentary section, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 7aa44fea5b 089/199: in menu, unicode chars for (R) and (TM) were interchanged, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 0ea3de138a 091/199: refactored adoc-kwf-attriblist, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 9bea822e07 136/199: Add license badge, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 1cbd1297be 137/199: Restructure the README a bit, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b2d2bcb2cd 138/199: Really kill all the tabs, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 17fab9724a 143/199: Fix duplicated test names, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode e0d08ee6d2 144/199: Delete obsolete Cask file, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 43eda399d3 148/199: Tweak the package description, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 468fdc0fd9 149/199: Update some package metadata, ELPA Syncer, 2023/09/03