[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode 2578d9a6c3 191/199: Addresses #33. Re-structure
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode 2578d9a6c3 191/199: Addresses #33. Re-structure also `adoc-kw-replacement`. |
Date: |
Sun, 3 Sep 2023 06:59:45 -0400 (EDT) |
branch: elpa/adoc-mode
commit 2578d9a6c360b5cb31a22703412e0d25e14f9d17
Author: Tobias Zawada <TOZ@esi-group.com>
Commit: TobiasZawada <i@tn-home.de>
Addresses #33. Re-structure also `adoc-kw-replacement`.
Also add ert test for keyword-replacement
---
adoc-mode.el | 21 ++++++++-------------
test/adoc-mode-test.el | 17 +++++++++++++++++
2 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/adoc-mode.el b/adoc-mode.el
index d2a5d9697e..aba1a8d4e6 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -1901,18 +1901,13 @@ meta characters."
`(list
;; matcher function
(lambda (end)
- (let ((found t) (prevented t) saved-point)
- (while (and found prevented)
- (setq saved-point (point))
- (setq found
- (adoc-kwf-search ,regexp end t))
- (setq prevented ; prevented is only meaningful wenn found is non-nil
- (or
- (not found) ; the following is only needed when found
- (text-property-not-all (match-beginning 1) (match-end 1)
'adoc-reserved nil)))
- (when (and found prevented)
- (goto-char (+ saved-point 1))))
- (when (and found (not prevented) adoc-insert-replacement ,replacement)
+ (let (found)
+ (while (and (setq found
+ (adoc-kwf-search ,regexp end t))
+ (text-property-not-all (match-beginning 1) (match-end 1)
'adoc-reserved nil))
+ (setq found nil)
+ (goto-char (+ (match-beginning 0) 1)))
+ (when (and found adoc-insert-replacement ,replacement)
(let* ((s (cond
((stringp ,replacement)
,replacement)
@@ -1924,7 +1919,7 @@ meta characters."
(setq adoc-replacement-failed (not o))
(unless adoc-replacement-failed
(overlay-put o 'after-string s))))
- (and found (not prevented))))
+ found))
;; highlighers
;; TODO: replacement instead warining face if resolver is not given
diff --git a/test/adoc-mode-test.el b/test/adoc-mode-test.el
index c6b1d3e272..d20ced6390 100644
--- a/test/adoc-mode-test.el
+++ b/test/adoc-mode-test.el
@@ -1026,6 +1026,23 @@ Don't use it for anything real.")
(cons "sub chapter 2.1" 262)))))
(kill-buffer "adoc-test")))
+(ert-deftest adoctest-adoc-kw-replacement ()
+ (unwind-protect
+ (progn
+ (set-buffer (get-buffer-create "adoc-test"))
+ (erase-buffer)
+ (adoc-mode)
+ (let ((adoc-insert-replacement t))
+ (adoc-calc)
+ (insert "(C)")
+ (font-lock-flush)
+ (font-lock-ensure)
+ (should (string-equal (overlay-get (car (overlays-in (point)
(point-max))) 'after-string) "©"))
+ )
+ )
+ (adoc-calc)
+ (kill-buffer "adoc-test")))
+
;; purpose
;; - ensure that the latest version, i.e. the one currently in buffer(s), of
;; adoc-mode and adoc-mode-test is used for the test
- [nongnu] elpa/adoc-mode c9a4715d2f 175/199: Add section about face customization to README.adoc, (continued)
- [nongnu] elpa/adoc-mode c9a4715d2f 175/199: Add section about face customization to README.adoc, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode ff382b94de 181/199: Improve the configuration docs, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b2b9fd5a6f 189/199: Addresses #33. Restart search in `adoc-kwf-std` at last prevented match + 1, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode d4abb0b562 190/199: Addresses #33. Re-introduce adoc-kw-delimited-block 2 because of failing ERT., ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 49bbd9a202 193/199: [#33] Describe purpose of adoc-kwf-search, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode de725c7910 156/199: [Fix #12] Replace the broken screenshot, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 8cf18289d5 167/199: Enable lexical binding, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 66b9adc97d 173/199: Release adoc-mode 0.7, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 6d458477c9 182/199: Add a changelog entry, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a7691c8b9a 186/199: Fix a couple of docstrings, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2578d9a6c3 191/199: Addresses #33. Re-structure also `adoc-kw-replacement`.,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode d98541046a 087/199: bugfix: fixed regex in adoc-re-anchor, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode be65a78a00 092/199: bumped version to 0.6.3, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 176db8ce53 163/199: Fix a typo, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 7012401a36 164/199: [Fix #25] Remove markup-faces from code (#27), ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 4ffbe8a7b5 165/199: [Fix #14] Added CONTRIBUTING.md, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 319ebf80af 166/199: Bump the copyright years, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2fdc443435 168/199: Fix a compilation warning, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode d0e5bb31f2 184/199: Remove the aggressive default background of native code blocks, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2cc5aabe01 194/199: Fixes #39. Spaces and source-language name for language attribute, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b1d7644fce 197/199: Addresses #39. Fix whitespace match at end of attr line for code blocks., ELPA Syncer, 2023/09/03