[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode b65c7fcb92 026/199: block title now fits into th
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode b65c7fcb92 026/199: block title now fits into the new concept |
Date: |
Sun, 3 Sep 2023 06:59:21 -0400 (EDT) |
branch: elpa/adoc-mode
commit b65c7fcb92638575e33bbc5a516b949e1be577ab
Author: Florian Kaufmann <sensorflo@gmail.com>
Commit: Florian Kaufmann <sensorflo@gmail.com>
block title now fits into the new concept
---
adoc-mode-test.el | 18 +++++++++++++-----
adoc-mode.el | 38 ++++++++++++++++++++++++++++----------
2 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/adoc-mode-test.el b/adoc-mode-test.el
index fc7e62c3e8..fb6a7309be 100644
--- a/adoc-mode-test.el
+++ b/adoc-mode-test.el
@@ -1,3 +1,4 @@
+
(require 'ert)
(require 'adoc-mode)
@@ -77,7 +78,10 @@
"^^^^^^^^^" markup-meta-hide-face "\n" nil
"\n" nil
"chapter 4" markup-title-4-face "\n" nil
- "+++++++++" markup-meta-hide-face "\n" nil))
+ "+++++++++" markup-meta-hide-face "\n" nil
+ "\n" nil
+
+ "." markup-meta-face "Block title" markup-gen-face "\n" nil ))
(ert-deftest adoctest-test-delimited-blocks-simple ()
(adoctest-faces "delimited-blocks-simple"
@@ -210,10 +214,14 @@
"lorem ** ipsum\n" 'no-face
"\n" nil
- ;; "chapter ** 1" markup-title-1-face "\n" nil
- ;; "------------" markup-meta-hide-face "\n" nil
- ;; "lorem ** ipsum\n" 'no-face
- ;; "\n" nil
+ "chapter ** 1" markup-title-1-face "\n" nil
+ "------------" markup-meta-hide-face "\n" nil
+ "lorem ** ipsum\n" 'no-face
+ "\n" nil
+
+ "." markup-meta-face "block ** title" markup-gen-face "\n" nil
+ "lorem ** ipsum\n" 'no-face
+ "\n" nil
;; test also
diff --git a/adoc-mode.el b/adoc-mode.el
index 4a15635143..6c54bee868 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -585,6 +585,26 @@ Subgroups:
"\\)" ))
+;; ^\.(?P<title>([^.\s].*)|(\.[^.\s].*))$
+;; Isn't that asciidoc.conf regexp the same as: ^\.(?P<title>(.?[^.\s].*))$
+;; insertion: so that this whole regex doesn't mistake a line starting with a
cell specifier like .2+| as a block title
+(defun adoc-re-block-title ()
+ "Returns a regexp matching an block title
+
+Subgroups:
+1 delimiter
+2 title's text incl trailing whites
+3 newline
+
+.foo n
+12--23"
+ (concat
+ "^\\(\\.\\)"
+ "\\(\\.?\\(?:"
+ "[0-9]+[^+*]" ; inserted part, see above
+ "\\|[^. \t\n]\\).*\\)"
+ "\\(\n\\)"))
+
(defun adoc-re-precond (&optional unwanted-chars backslash-allowed
disallowed-at-bol)
(concat
(when disallowed-at-bol ".")
@@ -937,6 +957,13 @@ Concerning TYPE, LEVEL and SUB-TYPE see `adoc-re-llisti'."
;; highlighers
'(1 '(face adoc-monospace adoc-reserved t font-lock-multiline t))))
+(defun adoc-kw-block-title ()
+ (list
+ `(lambda (end) (adoc-kwf-std end ,(adoc-re-block-title) '(1)))
+ '(1 '(face markup-meta-face adoc-reserved block-del))
+ '(2 markup-gen-face)
+ '(3 '(face nil adoc-reserved block-del))))
+
(defun adoc-kw-quote (type ldel text-face-spec &optional del-face rdel
literal-p)
"Return a keyword which highlights (un)constrained quotes.
When LITERAL-P is non-nil, the contained text is literal text."
@@ -1260,18 +1287,9 @@ When LITERAL-P is non-nil, the contained text is literal
text."
'(1 '(face adoc-delimiter adoc-reserved block-del)))
-
;; block title
;; -----------------------------------
- ;; ^\.(?P<title>([^.\s].*)|(\.[^.\s].*))$
- ;; Isn't that asciidoc.conf regexp the same as: ^\.(?P<title>(.?[^.\s].*))$
- (list (concat
- "^\\(\\.\\)\\(\\.?\\("
- ; insertion: so that this whole regex doesn't mistake a line starting
with a cell specifier like .2+| as a block title
- "[0-9]+[^+*]"
- "\\|[^. \t\n]\\).*\\)$")
- '(1 '(face adoc-delimiter adoc-reserved block-del))
- '(2 adoc-generic))
+ (adoc-kw-block-title)
;; paragraphs
- [nongnu] elpa/adoc-mode 569eff13b1 078/199: added lots of templates & easy-menu-entries, (continued)
- [nongnu] elpa/adoc-mode 569eff13b1 078/199: added lots of templates & easy-menu-entries, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 16fe6044b7 081/199: bumped version to 0.6.0, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 091f46e866 061/199: test: added test for goto-ref-label, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2322c32185 076/199: extracted make-two-line-title-underline from make-two-line-title, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode efa9ef97a0 080/199: list item tempos respect tab-width and indent-tabs-mode, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 9c395f4bf9 093/199: it's now less likely that text between two adjacent delimited blocks is misinterpreted as delimited block, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 06f9792fcd 011/199: added further simple tests for constrained/uncronstrained quotes, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode ead05da007 014/199: split up the current big test into smaller ones, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode f519baf304 022/199: addef *.elc files to .gitignore, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 886497d6a6 023/199: added a few medium complex tests for (un)constrained quotes, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b65c7fcb92 026/199: block title now fits into the new concept,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode 0f7619cfce 027/199: enheanced inline-subst-boundaries test, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b8e8574afa 038/199: introduced adoc-attribute-face-alist, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode e03d63e0b3 039/199: extened anchors unittest and fixed revealed bug, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 6ccb9d6de5 009/199: intermediate checkin - to be removed, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode ce247928ec 021/199: added test for byte-compile-file without errors, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 105519ce37 033/199: changed image fontification without tests, added tests for attribute lists, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 3d2ab81750 041/199: new style font lock for xref inline macro, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 9c404a4e2d 042/199: test2, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2756c62d86 043/199: revert test2, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode d4a57c5c03 045/199: cleaned up file comments a bit, ELPA Syncer, 2023/09/03