[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/lentic 7b75e8079c 276/333: Regularisation of start/stop
From: |
ELPA Syncer |
Subject: |
[elpa] externals/lentic 7b75e8079c 276/333: Regularisation of start/stop handling. |
Date: |
Tue, 27 Feb 2024 13:00:44 -0500 (EST) |
branch: externals/lentic
commit 7b75e8079c23abcf228144d81f66018ee5b87ada
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>
Regularisation of start/stop handling.
All configurations now use the same regexp to identify the start and
stop of comment sections, with optional comment block, and anchored to
the start of the line.
Previously, I had three different regexps with different variations of
anchors and groups. Nasty.
The anchoring should prevent spurious matches to source blocks (occuring
in strings, for example, in org-mode source buffers).
Closes issue #36.
---
dev-resources/string-src-block.el | 6 ++++++
dev-resources/string-src-block.org | 6 ++++++
examples/string-src-block.el | 12 ++++++++++++
lentic-chunk.el | 31 ++++---------------------------
test/lentic-test.el | 12 ++++++++++++
5 files changed, 40 insertions(+), 27 deletions(-)
diff --git a/dev-resources/string-src-block.el
b/dev-resources/string-src-block.el
new file mode 100644
index 0000000000..a844944cb1
--- /dev/null
+++ b/dev-resources/string-src-block.el
@@ -0,0 +1,6 @@
+;; #+begin_src emacs-lisp
+(setq org-structure-template-alist
+ (quote (("s" "#+begin_src ?\n\n#+end_src" "<src lang=\"?\">\n\n</src>")
+ ("e" "#+begin_example\n?\n#+end_example"
"<example>\n?\n</example>")
+ ("I" "#+include %file ?" "<include file=%file markup=\"?\">"))))
+;; #+end_src
diff --git a/dev-resources/string-src-block.org
b/dev-resources/string-src-block.org
new file mode 100644
index 0000000000..b93e7f5733
--- /dev/null
+++ b/dev-resources/string-src-block.org
@@ -0,0 +1,6 @@
+#+begin_src emacs-lisp
+(setq org-structure-template-alist
+ (quote (("s" "#+begin_src ?\n\n#+end_src" "<src lang=\"?\">\n\n</src>")
+ ("e" "#+begin_example\n?\n#+end_example"
"<example>\n?\n</example>")
+ ("I" "#+include %file ?" "<include file=%file markup=\"?\">"))))
+#+end_src
diff --git a/examples/string-src-block.el b/examples/string-src-block.el
new file mode 100644
index 0000000000..6804e0dc08
--- /dev/null
+++ b/examples/string-src-block.el
@@ -0,0 +1,12 @@
+;;; lentic_test --- testing it
+
+;; #+begin_src emacs-lisp
+(setq org-structure-template-alist
+ (quote (("s" "#+begin_src ?\n\n#+end_src" "<src lang=\"?\">\n\n</src>")
+ ("e" "#+begin_example\n?\n#+end_example"
"<example>\n?\n</example>")
+ ("I" "#+include %file ?" "<include file=%file markup=\"?\">"))))
+;; #+end_src
+
+;; # Local Variables:
+;; # lentic-init: lentic-org-orgel-init
+;; # End:
diff --git a/lentic-chunk.el b/lentic-chunk.el
index f34c2fcfb4..c5e8092617 100644
--- a/lentic-chunk.el
+++ b/lentic-chunk.el
@@ -92,17 +92,15 @@ start of line chunk comment in one buffer but not the
other."
(defmethod lentic-chunk-comment-start-regexp
((conf lentic-chunk-configuration))
;; todo -- what does this regexp do?
- (format "^\\(%s\\)*%s"
+ (format "^\\(%s\\)?%s"
(oref conf :comment)
- (regexp-quote
- (oref conf :comment-start))))
+ (oref conf :comment-start)))
(defmethod lentic-chunk-comment-stop-regexp
((conf lentic-chunk-configuration))
- (format "^\\(%s\\)*%s"
+ (format "^\\(%s\\)?%s"
(oref conf :comment)
- (regexp-quote
- (oref conf :comment-stop))))
+ (oref conf :comment-stop)))
(defmethod lentic-chunk-line-start-comment
((conf lentic-chunk-configuration))
@@ -410,18 +408,6 @@ between the two buffers; we don't care which one has
comments."
:comment-start (oref conf :comment-start)
:comment-stop (oref conf :comment-stop)))
-(defmethod lentic-chunk-comment-start-regexp
- ((conf lentic-commented-chunk-configuration))
- (concat
- "\\(" (regexp-quote (oref conf :comment)) "\\)?"
- (oref conf :comment-start)))
-
-(defmethod lentic-chunk-comment-stop-regexp
- ((conf lentic-commented-chunk-configuration))
- (concat
- "\\(" (regexp-quote (oref conf :comment)) "\\)?"
- (oref conf :comment-stop)))
-
(defmethod lentic-clone
((conf lentic-uncommented-chunk-configuration)
&optional start stop length-before start-converted stop-converted)
@@ -505,15 +491,6 @@ between the two buffers; we don't care which one has
comments."
:comment-start (oref conf :comment-start)
:comment-stop (oref conf :comment-stop)))
-(defmethod lentic-chunk-comment-start-regexp
- ((conf lentic-uncommented-chunk-configuration))
- (oref conf :comment-start))
-
-(defmethod lentic-chunk-comment-stop-regexp
- ((conf lentic-uncommented-chunk-configuration))
- (oref conf :comment-stop))
-
-
;; #+end_src
;; ** Unmatched Chunk Configuration
diff --git a/test/lentic-test.el b/test/lentic-test.el
index 5b281c84e3..0fe68dd5d0 100644
--- a/test/lentic-test.el
+++ b/test/lentic-test.el
@@ -180,6 +180,18 @@ Addresses issue #19."
'lentic-orgel-org-init
"orgel-org-with-tags.el" "orgel-org-with-tags.org")))
+(ert-deftest lentic-orgel-org-with-inline-delimitor()
+ "Test that stringed or otherwise not at the start of
+line delimitors are not detected.
+
+Addresses issue #36."
+ (should
+ (lentic-test-clone-equal
+ 'lentic-org-orgel-init
+ "string-src-block.org"
+ "string-src-block.el")))
+
+
(ert-deftest lentic-org-clojure ()
(should
(lentic-test-clone-equal
- [elpa] externals/lentic 65f94e69d7 242/333: Shorten names of entry points to lentic-doc., (continued)
- [elpa] externals/lentic 65f94e69d7 242/333: Shorten names of entry points to lentic-doc., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 54290fcc0c 248/333: Documentation Updates., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 3f20d2a5ec 261/333: Prepare for next iteration, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 884882d10d 245/333: Fixes error with path handling., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 4332b289fb 250/333: Graceful error handling is now optional., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic b8f399ea51 244/333: lentic-doc now uses correct directory., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 9d542c732b 255/333: README update for 0.8 release., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic c740b170ea 262/333: Enable use of tags in org-mode src blocks., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic ba0be3b36f 265/333: Merge branch 'feature/tags-on-org-sections', ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 678db93272 322/333: Merge pull request #50 from DamienCassou/patch-1, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 7b75e8079c 276/333: Regularisation of start/stop handling.,
ELPA Syncer <=
- [elpa] externals/lentic c744f3d3be 321/333: Shorten maximum line length in orgel, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic e27c3f3b2a 281/333: Merge pull request #41 from syohex/load-library, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 32a17b1829 323/333: Fix use of undefined variable, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic bbbfa78a0d 302/333: Add missing files, including tests., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 370ebf12a9 268/333: Widening was inconsistent in hooks., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 72542b681a 273/333: Correctly require s in cask and lentic-doc., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic a75637bb2f 280/333: Load 'f' for using f-equal?, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 15c336bfe7 288/333: Update to travis-container testing., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 97b939ee15 266/333: Reimplement insert-file-local using core function., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 36861bdf9c 331/333: Add lentic-markdown, ELPA Syncer, 2024/02/27