-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemlua-init.el
81 lines (58 loc) · 1.81 KB
/
emlua-init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
;; This file:
;; http://angg.twu.net/emlua/emlua-init.el.html
;; http://angg.twu.net/emlua/emlua-init.el
;; (find-angg "emlua/emlua-init.el")
;; https://raw.githubusercontent.com/edrx/emlua/main/emlua-init.el
;; https://github.com/edrx/emlua/blob/main/emlua-init.el
;; Author: Eduardo Ochs <[email protected]>
;; Version: 2022mar30
;; License: GPL2
;;
;; See: https://github.com/edrx/emlua
;; Based on: (find-eev "eev-beginner.el" "load-path-hack")
;; Test: emlua-dir
;;
(setq emlua-dir
(if load-in-progress
(file-name-directory load-file-name)
default-directory))
;; Tests: (emlua-init-so-0)
;; (emlua-init-so)
;;
(defun emlua-init-so-0 ()
(concat emlua-dir "emlua.so"))
(defun emlua-init-so (&optional use-load-instead-of-require)
(if (fboundp 'emlua-dostring)
"emlua.so already loaded"
(if use-load-instead-of-require
(load (emlua-init-so-0))
(require 'emlua (emlua-init-so-0)))))
;; Tests: (emlua-init-dofiles-0)
;; (emlua-init-dofiles)
;;
(defun emlua-init-dofiles-0 ()
(ee-template0 "\
dofile '{emlua-dir}edrxlib.lua'
dofile '{emlua-dir}Repl1.lua'
-- package.path = '{emlua-dir}?.lua;'..package.path
return 'EdrxEmacsRepl =', EdrxEmacsRepl"))
(defun emlua-init-dofiles ()
(emlua-dostring (emlua-init-dofiles-0)))
;; Tests: (emlua-init-newrepl-0)
;; (emlua-init-newrepl)
;;
(defun emlua-init-newrepl-0 ()
"REPL = EdrxEmacsRepl.new()
return 'REPL =', REPL")
(defun emlua-init-newrepl ()
(emlua-dostring (emlua-init-newrepl-0)))
;; Test: (emlua-init)
;;
(defun emlua-init (&optional use-load-instead-of-require)
(list (emlua-init-so use-load-instead-of-require)
(emlua-init-dofiles)
(emlua-init-newrepl)))
(provide 'emlua-init)
;; Local Variables:
;; coding: utf-8-unix
;; End: