emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/lentic 26b68cd9da 152/333: init functions are now state


From: ELPA Syncer
Subject: [elpa] externals/lentic 26b68cd9da 152/333: init functions are now stateless.
Date: Tue, 27 Feb 2024 13:00:23 -0500 (EST)

branch: externals/lentic
commit 26b68cd9dad81036bb0a530ff69f32a0351ea825
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>

    init functions are now stateless.
    
    Previously, the init function had to set the config by side-effect,
    which didn't really make sense. So, now, it returns a value instead.
---
 lentic-asciidoc.el   |  6 ++----
 lentic-latex-code.el |  6 ++----
 lentic-org.el        | 18 ++++++------------
 lentic.el            | 12 ++++++------
 4 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/lentic-asciidoc.el b/lentic-asciidoc.el
index 7c7c63141d..0606d7331c 100644
--- a/lentic-asciidoc.el
+++ b/lentic-asciidoc.el
@@ -41,8 +41,7 @@
    :comment ";; "))
 
 (defun lentic-clojure-asciidoc-init ()
-  (setq lentic-config
-        (lentic-asciidoc-commented-new)))
+  (lentic-asciidoc-commented-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-clojure-asciidoc-init)
@@ -58,8 +57,7 @@
    :comment ";; "))
 
 (defun lentic-asciidoc-clojure-init ()
-  (setq lentic-config
-        (lentic-asciidoc-uncommented-new)))
+  (lentic-asciidoc-uncommented-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-asciidoc-clojure-init)
diff --git a/lentic-latex-code.el b/lentic-latex-code.el
index 597eddfa03..693f718e4e 100644
--- a/lentic-latex-code.el
+++ b/lentic-latex-code.el
@@ -50,8 +50,7 @@
 
 ;;;###autoload
 (defun lentic-clojure-latex-init ()
-  (setq lentic-config
-        (lentic-clojure-to-latex-new)))
+  (lentic-clojure-to-latex-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-clojure-latex-init)
@@ -71,8 +70,7 @@
 
 ;;;###autoload
 (defun lentic-latex-clojure-init ()
-  (setq lentic-config
-        (lentic-latex-to-clojure-new)))
+  (lentic-latex-to-clojure-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-clojure-latex-init)
diff --git a/lentic-org.el b/lentic-org.el
index 68c09efe1b..a709d6f819 100644
--- a/lentic-org.el
+++ b/lentic-org.el
@@ -85,8 +85,7 @@
 
 ;;;###autoload
 (defun lentic-org-el-init ()
-  (setq lentic-config
-        (lentic-org-to-el-new)))
+  (lentic-org-to-el-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-org-el-init)
@@ -106,8 +105,7 @@
 
 ;;;###autoload
 (defun lentic-el-org-init ()
-  (setq lentic-config
-        (lentic-el-to-org-new)))
+  (lentic-el-to-org-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-el-org-init)
@@ -324,8 +322,7 @@
    :comment-start "#\\\+END_SRC"))
 
 (defun lentic-org-orgel-init ()
-  (setq lentic-config
-        (lentic-org-to-orgel-new)))
+  (lentic-org-to-orgel-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-org-orgel-init)
@@ -387,8 +384,7 @@
    :comment-start "#\\\+END_SRC"))
 
 (defun lentic-orgel-org-init ()
-  (setq lentic-config
-        (lentic-orgel-to-org-new)))
+  (lentic-orgel-to-org-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-orgel-org-init)
@@ -418,8 +414,7 @@
    :case-fold-search nil))
 
 (defun lentic-org-clojure-init ()
-  (setq lentic-config
-        (lentic-org-to-clojure-new)))
+  (lentic-org-to-clojure-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-org-clojure-init)
@@ -438,8 +433,7 @@
    :comment-start "#\\\+END_SRC"))
 
 (defun lentic-clojure-org-init ()
-  (setq lentic-config
-        (lentic-clojure-to-org-new)))
+  (lentic-clojure-to-org-new))
 
 (add-to-list 'lentic-init-functions
              'lentic-clojure-org-init)
diff --git a/lentic.el b/lentic.el
index 0e2b9706f8..2a1f23b4d4 100644
--- a/lentic.el
+++ b/lentic.el
@@ -340,10 +340,9 @@ Currently, this is just a clone all method but may use 
regions in future."
 (defun lentic-default-init ()
   "Default init function.
 see `lentic-init' for details."
-  (setq lentic-config
-        (lentic-default-configuration
-         (lentic-config-name (current-buffer))
-         :this-buffer (current-buffer))))
+  (lentic-default-configuration
+   (lentic-config-name (current-buffer))
+   :this-buffer (current-buffer)))
 
 (add-to-list 'lentic-init-functions
              'lentic-default-init)
@@ -411,7 +410,7 @@ It is useful to toggle this state on during development. 
Once
 enabled, buffers will not update automaticaly but only when
 explicitly told to. This is much easier than try to debug errors
 happening on the after-change-hooks. The
-`lentic-emergency' and `lentic-unemergency' hooks
+`lentic-emergency' and `lentic-unemergency' functions
 enable this.")
 
 (defvar lentic-emergency-debug nil
@@ -527,7 +526,8 @@ A and B are the buffers."
                 lentic-config :that-buffer)
                (buffer-live-p (lentic-that
                                lentic-config)))
-    (funcall lentic-init)))
+    (setq lentic-config
+          (funcall lentic-init))))
 
 (defun lentic-init-create ()
   "Create the lentic for current-buffer."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]