[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/lentic 0b8b94003d 214/333: Multiple buffer support for
From: |
ELPA Syncer |
Subject: |
[elpa] externals/lentic 0b8b94003d 214/333: Multiple buffer support for org/orgel. |
Date: |
Tue, 27 Feb 2024 13:00:36 -0500 (EST) |
branch: externals/lentic
commit 0b8b94003ddc708037d666eaa2a10e55e0ecdb8b
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>
Multiple buffer support for org/orgel.
The return values for the org/orgel lentic-clone implementations now
obey the new interfaces enabling multiple buffers.
---
.gitignore | 1 +
examples/multi-orgel-org.el | 22 +++++++++
lentic-block.el | 4 +-
lentic-org.el | 107 +++++++++++++++++++++++++-------------------
test/lentic-test.el | 2 +-
5 files changed, 88 insertions(+), 48 deletions(-)
diff --git a/.gitignore b/.gitignore
index 1ea7cb9a47..b70a755da7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,4 +24,5 @@ auto
/examples/clj-adoc.adoc
/examples/owl.tex
/examples/literate-haskell.tex
+/examples/multi-orgel-org.org
Makefile-local
\ No newline at end of file
diff --git a/examples/multi-orgel-org.el b/examples/multi-orgel-org.el
new file mode 100644
index 0000000000..58ee4b1481
--- /dev/null
+++ b/examples/multi-orgel-org.el
@@ -0,0 +1,22 @@
+;;; orgel-org.el --- A test file -*- lexical-binding: t -*-
+
+;; Author: Phillip Lord
+
+;;; Commentary:
+
+;; This is an "orgel" file. That is a valid emacs lisp file with comments in
+;; org-mode. The header comments are translated into header one in org mode.
+
+
+;; #+BEGIN_SRC emacs-lisp
+(defun orgel-function ())
+;; #+END_SRC
+
+;; ThisAnd we finish off with the local variables declaration. And here we
write
+;; some osome more stuff
+
+;; Well
+
+;; # Local Variables:
+;; # lentic-init: (lentic-orgel-org-init lentic-default-init)
+;; # End:
diff --git a/lentic-block.el b/lentic-block.el
index 06b4ca648a..c9cbaf5847 100644
--- a/lentic-block.el
+++ b/lentic-block.el
@@ -419,8 +419,8 @@ between the two buffers; we don't care which one has
comments."
(when start-at-bolp
"start")))
(let* ((clone-return
- (call-next-method conf start stop length-before
- start-converted stop-converted))
+ (call-next-method conf start stop length-before
+ start-converted stop-converted))
(clone-return
(unless start-at-bolp
clone-return)))
diff --git a/lentic-org.el b/lentic-org.el
index e666e1e269..5c8d572be2 100644
--- a/lentic-org.el
+++ b/lentic-org.el
@@ -219,9 +219,9 @@
(lentic-this conf)))
(header-one-line
(m-buffer-match
- (lentic-this conf)
- "^[*] \\(\\w*\\)$"
- :begin (cl-cadar first-line)))
+ (lentic-this conf)
+ "^[*] \\(\\w*\\)$"
+ :begin (cl-cadar first-line)))
(special-lines
(-concat first-line header-one-line)))
;; check whether we are in a special line -- if so widen the change extent
@@ -257,33 +257,41 @@
(m-buffer-at-line-end-position
(lentic-that conf)
stop-converted)
- stop-converted)))
- (call-next-method conf start stop length-before
- start-converted stop-converted)
- (let ((first-line-end-match
- (cl-cadar
- (m-buffer-match-first-line
- (lentic-that conf)))))
- (m-buffer-replace-match
- (m-buffer-match
- (lentic-that conf)
- ;; we can be in one of two states depending on whether we have made
a new
- ;; clone or an incremental change
- "^;; \\(;;;\\|# #\\)"
- :end first-line-end-match)
- ";;;")
- ;; replace big headers, in either of their two states
- (m-buffer-replace-match
- (m-buffer-match
- (lentic-that conf)
- "^;; [*] \\(\\w*\\)$"
- :begin first-line-end-match)
- ";;; \\1:")
- (m-buffer-replace-match
- (m-buffer-match (lentic-that conf)
- "^;; ;;; \\(\\w*:\\)$"
- :begin first-line-end-match)
- ";;; \\1")))))
+ stop-converted))
+ (clone-return
+ (call-next-method conf start stop length-before
+ start-converted stop-converted))
+ (first-line-end-match
+ (cl-cadar
+ (m-buffer-match-first-line
+ (lentic-that conf))))
+ ;; can't just use or here because we need non-short circuiting
+ (c1
+ (m-buffer-replace-match
+ (m-buffer-match
+ (lentic-that conf)
+ ;; we can be in one of two states depending on whether we have
made a new
+ ;; clone or an incremental change
+ "^;; \\(;;;\\|# #\\)"
+ :end first-line-end-match)
+ ";;;"))
+ ;; replace big headers, in either of their two states
+ (c2
+ (m-buffer-replace-match
+ (m-buffer-match
+ (lentic-that conf)
+ "^;; [*] \\(\\w*\\)$"
+ :begin first-line-end-match)
+ ";;; \\1:"))
+ (c3
+ (m-buffer-replace-match
+ (m-buffer-match (lentic-that conf)
+ "^;; ;;; \\(\\w*:\\)$"
+ :begin first-line-end-match)
+ ";;; \\1")))
+ (if (or start-in-special stop-in-special c1 c2 c3)
+ nil
+ clone-return))))
(defmethod lentic-convert
((conf lentic-org-to-orgel-configuration)
@@ -335,21 +343,30 @@
((conf lentic-orgel-to-org-configuration)
&optional start stop length-before start-converted stop-converted)
;; do everything else to the buffer
- (call-next-method conf start stop length-before
- start-converted stop-converted)
- (m-buffer-replace-match
- (m-buffer-match
- (lentic-that conf)
- ";;; "
- :end
- (cl-cadar
- (m-buffer-match-first-line
- (lentic-that conf))))
- "# # ")
- (m-buffer-replace-match
- (m-buffer-match (lentic-that conf)
- "^;;; \\(\\\w*\\):")
- "* \\1"))
+ (let* ((clone-return
+ (call-next-method conf start stop length-before
+ start-converted stop-converted))
+ (m1
+ (m-buffer-replace-match
+ (m-buffer-match
+ (lentic-that conf)
+ ";;; "
+ :end
+ (cl-cadar
+ (m-buffer-match-first-line
+ (lentic-that conf))))
+ "# # "))
+ (m2
+ (m-buffer-replace-match
+ (m-buffer-match (lentic-that conf)
+ "^;;; \\(\\\w*\\):")
+ "* \\1")))
+ (unless
+ ;; update some stuff
+ (or m1 m2)
+ ;; and return clone-return unless we have updated stuff in which case
+ ;; return nil
+ clone-return)))
(defmethod lentic-invert
((conf lentic-orgel-to-org-configuration))
diff --git a/test/lentic-test.el b/test/lentic-test.el
index 14e8cf2364..784983415e 100644
--- a/test/lentic-test.el
+++ b/test/lentic-test.el
@@ -66,7 +66,7 @@
(let ((this (get-file-buffer (lentic-test-file file))))
(when this
(with-current-buffer this
- (let ((this (lentic-that (car lentic-config))))
+ (let ((that (lentic-that (car lentic-config))))
(kill-buffer that)))
(kill-buffer this)))))
- [elpa] externals/lentic 4003ae1a41 194/333: Travis badge., (continued)
- [elpa] externals/lentic 4003ae1a41 194/333: Travis badge., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic d6ac74dc73 191/333: No error if m-buffer is not present., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 6587a9a0f7 198/333: Missing dev-resource added., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic a5a001f999 183/333: Lentic-mode menu corrected and extended., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 3431295354 195/333: License updates in some files., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 450de96809 187/333: Remove file on exit., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 9c60f116a8 200/333: Lentic top level documentation added., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 66a056211c 202/333: Copyright and Documentation updates., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 2e290c74e3 207/333: Multiple oset added, and factor constructors., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 71017538d7 211/333: Multiple lentic-buffers are now possible., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 0b8b94003d 214/333: Multiple buffer support for org/orgel.,
ELPA Syncer <=
- [elpa] externals/lentic 849dc0dc24 209/333: Default mode is now the same as main buffer., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 61d6ea4ac5 222/333: Save lentic buffers only when file-associated., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 28a1951c14 216/333: Use default-browser for external view., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 8a007a60c5 218/333: Default for init is now a list., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 35db8a038a 219/333: Major-mode functions reworked totally., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 243d2710d1 224/333: Advance m-buffer version to fix point bug., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic bc6e3db510 237/333: Merge branch 'Prathyvsh-patch-1', ELPA Syncer, 2024/02/27
- [elpa] externals/lentic d4d494bb20 232/333: Full documentation for lentic.el., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic e97bc286d7 241/333: Lentic-self doc moved to lentic-mode., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 65f94e69d7 242/333: Shorten names of entry points to lentic-doc., ELPA Syncer, 2024/02/27