[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/raku-mode acc516e76d 225/253: Uncomment code blocks in POD
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/raku-mode acc516e76d 225/253: Uncomment code blocks in POD. |
Date: |
Sat, 29 Jan 2022 08:29:01 -0500 (EST) |
branch: elpa/raku-mode
commit acc516e76d7bf3e30ac0e72c6d29545dedbe09b0
Author: Tim Van den Langenbergh <tmt_vdl@gmx.com>
Commit: Tim Van den Langenbergh <tmt_vdl@gmx.com>
Uncomment code blocks in POD.
Per @Altai-man's suggestion.
Note: basic string matching ergo ends code blocks on `=end code`, even when
in
a string.
---
raku-font-lock.el | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/raku-font-lock.el b/raku-font-lock.el
index b39ff7bb4d..880fb30701 100644
--- a/raku-font-lock.el
+++ b/raku-font-lock.el
@@ -372,16 +372,31 @@ opening delimiter."
(put-text-property (1- (point)) (point)
'syntax-table (string-to-syntax ">")))))
+(defun raku-syntax-propertize-pod-code-blocks (limit)
+ "Add syntax properties to code blocks in POD."
+ (while (search-forward "=begin code" limit t)
+ (let ((code-beg (point))
+ (code-end (- (search-forward "=end code" limit t)
+ (length "=end code"))))
+ (put-text-property code-beg (1+ code-beg)
+ 'syntax-table (string-to-syntax ">"))
+ (put-text-property (1- code-end) code-end
+ 'syntax-table (string-to-syntax "<"))
+ (remove-text-properties code-beg code-end '(syntax-multiline nil)))))
+
(defun raku-syntax-propertize-pod (limit)
"Add syntax properties to POD."
- (let ((pod-beg (- (point) (length "=begin pod"))))
- (put-text-property pod-beg (1+ pod-beg)
- 'syntax-table (string-to-syntax "<"))
- (if (re-search-forward "=end pod" limit 'noerror)
- (let ((pod-end (point)))
- (put-text-property pod-beg pod-end 'syntax-multiline t)
- (put-text-property (1- pod-end) pod-end
- 'syntax-table (string-to-syntax ">"))))))
+ (let ((pod-beg (- (point) (length "=begin pod")))
+ (pod-end (search-forward "=end pod" limit t)))
+ (save-excursion
+ (put-text-property (1- pod-beg) pod-beg
+ 'syntax-table (string-to-syntax "<"))
+ (put-text-property pod-end (1+ pod-end)
+ 'syntax-table (string-to-syntax ">"))
+ (put-text-property pod-beg pod-end
+ 'syntax-multiline t)
+ (goto-char pod-beg)
+ (raku-syntax-propertize-pod-code-blocks pod-end))))
(defun raku-syntax-propertize-angles (open-angles)
"Add syntax properties to angle-bracketed quotes (e.g. <foo> and «bar»).
- [nongnu] elpa/raku-mode 4b01244490 157/253: make this work for nqp also, (continued)
- [nongnu] elpa/raku-mode 4b01244490 157/253: make this work for nqp also, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode edccdba86f 191/253: Don't hang emacs if cannot find the Raku executable, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 88de065795 186/253: add test file for HEREDOC indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 7d006af233 187/253: Simple perl6/raku repl, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 9cbd9b26f9 168/253: Merge branch 'patch-1' of https://github.com/Altai-man/perl6-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 4ad9987e25 185/253: add TODO note for HEREDOC indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 8f6804ad17 207/253: Merge pull request #26 from matiaslina/raku-rename, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 0dd62e4d1f 217/253: Add missing 's' to parent customization group name., ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 13ebcd87ce 220/253: trivial change Perl 6 to Raku, plus temp change of URL meanwhile, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 98db56c6ec 212/253: Add some clarifying comments., ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode acc516e76d 225/253: Uncomment code blocks in POD.,
ELPA Syncer <=
- [nongnu] elpa/raku-mode 341c898848 029/253: Add note about electricity, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode e7a3770427 008/253: Recommend `:defer t` with use-package, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 032fa40e1b 068/253: Highlight [RSXZ] metaoperators, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode e8111ebbdf 106/253: Factor metaoperator regex into a reusable part, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode bfccfac15a 090/253: Alter priority of metaoperator highlighting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode d9682fb331 098/253: Highlight regex/rule/token even when not followed by an identifier, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 0f053e21f2 146/253: now have a working solution for an Index imenu for subs and vars, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 14073feeb0 161/253: Don't highlight hyperops starting with << and «« as strings, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 0bd2a09663 153/253: add vars moved from perl6-imenu.el per comments from syohex, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 4f1e2928d2 158/253: add more generalization with more defined regexes, remove commented out old code, ELPA Syncer, 2022/01/29