[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/lentic b2e4d953f1 053/333: Support for Org to Elisp tra
From: |
ELPA Syncer |
Subject: |
[elpa] externals/lentic b2e4d953f1 053/333: Support for Org to Elisp transformation. |
Date: |
Tue, 27 Feb 2024 13:00:01 -0500 (EST) |
branch: externals/lentic
commit b2e4d953f1a699a00a8832c9f549cd3986b7e354
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>
Support for Org to Elisp transformation.
This is a new feature, currently functional but not slick.
---
.ert-runner | 2 +-
linked-buffer-org.el | 59 ++++++++++++++++++++++++++++++++++++++++++++++
test/linked-buffer-test.el | 39 ++++++++++++++++++++----------
3 files changed, 86 insertions(+), 14 deletions(-)
diff --git a/.ert-runner b/.ert-runner
index e6bbe06237..14ced4d6e3 100644
--- a/.ert-runner
+++ b/.ert-runner
@@ -1 +1 @@
---load linked-buffer.el linked-buffer-block.el linked-buffer-latex-code
linked-buffer-asciidoc test/linked-buffer-test.el
\ No newline at end of file
+--load linked-buffer.el linked-buffer-block.el linked-buffer-latex-code
linked-buffer-asciidoc linked-buffer-org test/linked-buffer-test.el
\ No newline at end of file
diff --git a/linked-buffer-org.el b/linked-buffer-org.el
new file mode 100644
index 0000000000..fb2eba1d5f
--- /dev/null
+++ b/linked-buffer-org.el
@@ -0,0 +1,59 @@
+;;; linked-buffer-org.el --- org support for linked-buffer -*-
lexical-binding: t -*-
+
+;; This file is not part of Emacs
+
+;; Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
+;; Maintainer: Phillip Lord <phillip.lord@newcastle.ac.uk>
+
+;; The contents of this file are subject to the LGPL License, Version 3.0.
+;;
+;; Copyright (C) 2014, Phillip Lord, Newcastle University
+;;
+;; This program is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU Lesser General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or (at your
+;; option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+;; for more details.
+;;
+;; You should have received a copy of the GNU Lesser General Public License
+;; along with this program. If not, see http://www.gnu.org/licenses/.
+
+;;; Commentary:
+;;
+;; Linked buffers with org BEGIN_SRC blocks
+
+;; Again, the problem is switching into emacs-lisp modes, because of the
+;; meaningful first line -- for example for lexical-binding which pretty much
+;; MUST be at the start of the file.
+
+;; Worse, it's not just the first line. The header of the Lisp file is very
+;; structured. Really we would want to translate this into org code also (from
+;; Commentary onward.
+
+(require 'linked-buffer-block)
+
+;;; Code:
+
+(defun linked-buffer-org-to-el-new ()
+ (linked-buffer-uncommented-block-configuration
+ "lb-org-to-el"
+ :this-buffer (current-buffer)
+ :linked-file
+ (concat
+ (file-name-sans-extension
+ (buffer-file-name))
+ ".el")
+ :comment ";; "
+ :comment-stop "#\\\+BEGIN_SRC emacs-lisp"
+ :comment-start "#\\\+END_SRC"))
+
+(defun linked-buffer-org-el-init ()
+ (setq linked-buffer-config
+ (linked-buffer-org-to-el-new)))
+
+(provide 'linked-buffer-org)
+;;; linked-buffer-org.el ends here
diff --git a/test/linked-buffer-test.el b/test/linked-buffer-test.el
index 11c35ceae3..a05c653acb 100644
--- a/test/linked-buffer-test.el
+++ b/test/linked-buffer-test.el
@@ -1,6 +1,8 @@
+
(require 'linked-buffer)
(require 'linked-buffer-latex-code)
(require 'linked-buffer-asciidoc)
+(require 'linked-buffer-org)
(require 'f)
@@ -17,6 +19,14 @@
(error "Test File does not exist: %s" file))
file))
+(defun linked-buffer-test-clone-equal (init file cloned-file)
+ (equal
+ (f-read
+ (linked-buffer-test-file cloned-file))
+ (linked-buffer-batch-clone-with-config
+ (linked-buffer-test-file file) init)))
+
+
(defvar conf-default
(linked-buffer-default-configuration "bob"))
@@ -34,19 +44,22 @@
(ert-deftest linked-buffer-clojure-latex ()
(should
- (equal
- (f-read
- (linked-buffer-test-file
- "block-comment-out.tex"))
- (linked-buffer-batch-clone-with-config
- (linked-buffer-test-file "block-comment.clj")
- 'linked-buffer-clojure-latex-init))))
+ (linked-buffer-test-clone-equal
+ 'linked-buffer-clojure-latex-init
+ "block-comment.clj" "block-comment-out.tex")))
+
(ert-deftest linked-buffer-asciidoc-clojure ()
(should
- (equal
- (f-read
- (linked-buffer-test-file "asciidoc-clj-out.clj"))
- (linked-buffer-batch-clone-with-config
- (linked-buffer-test-file "asciidoc-clj.txt")
- 'linked-buffer-asciidoc-clojure-init))))
+ (linked-buffer-test-clone-equal
+ 'linked-buffer-asciidoc-clojure-init
+ "asciidoc-clj.txt" "asciidoc-clj-out.clj")))
+
+
+;; org mode start up prints out "OVERVIEW" from the cycle. Can't see any way
+;; to stop this
+(ert-deftest linked-buffer-org-el ()
+ (should
+ (linked-buffer-test-clone-equal
+ 'linked-buffer-org-el-init
+ "org-el.org" "org-el.el")))
- [elpa] externals/lentic 7bc58a4813 014/333: Delayed linkage added. Typo in v0.2 fixed., (continued)
- [elpa] externals/lentic 7bc58a4813 014/333: Delayed linkage added. Typo in v0.2 fixed., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 9ff8e5a75a 024/333: Bug added., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 9f337f08f2 027/333: Initial commit: sort dependencies during test., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic ed64dff0c7 031/333: Support for asciidoc->latex transformation, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 73fe35fa77 023/333: Refactoring to remove code duplication., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic d72b413ac8 037/333: Moved file name, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic ec206bf673 060/333: Update in preparation for 0.5 release., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 29688f7ec6 089/333: Logging alterations., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic b0c705c488 093/333: Removed :numeric option., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 8ee4c01fe5 086/333: Fixed some errant blocks., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic b2e4d953f1 053/333: Support for Org to Elisp transformation.,
ELPA Syncer <=
- [elpa] externals/lentic e9369029fe 055/333: Having this in git is a pain!, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic c88b7ccbe2 057/333: Update to add emacs temp files., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 8b7966fd4e 066/333: Test files added for org-orgel, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 95feec5f21 075/333: Move to MELPA, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 4f5f1bb96a 092/333: Add support for logging non-matching buffers., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic bba710c2f0 100/333: Further tests for incremental updates., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic a85fe6d8d5 101/333: Merge branch 'feature/incremental-update' into feature/incremental-blocks-update, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic dea9f03ab8 103/333: Only update regions which overlap the change., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 4c277411c6 107/333: Edebug Spec for Macro., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 9529b25c69 109/333: Moved with-markers functionality to m-buffer., ELPA Syncer, 2024/02/27