aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fürmetz <fuermetz@mailbox.org>2019-07-04 14:48:56 +0200
committerGitHub <noreply@github.com>2019-07-04 14:48:56 +0200
commit18e203124f766dcc429aa52a7b0f7414cf601cc7 (patch)
treefb2890aa401d79b3008e09731ee82582801ea750
parentd00048670dbb36d8c0c68d37657b99c44adec4ff (diff)
parent1863fc6e00e9b53fa68dcf56034cdc3b428a59a3 (diff)
Merge pull request #86 from jixiuf/auto-compile
trying auto compile emacs-libvterm if require vterm-module failed
-rw-r--r--README.md13
-rw-r--r--vterm.el21
2 files changed, 13 insertions, 21 deletions
diff --git a/README.md b/README.md
index d7fb825..1cd9900 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,11 @@ Clone the repository:
git clone https://github.com/akermu/emacs-libvterm.git
```
+Before install emacs-libvterm,you need make sure you have
+installed
+ 1. cmake (>=3.0.2)
+ 2. libtool-bin related issues: [#66](https://github.com/akermu/emacs-libvterm/issues/66) [#85](https://github.com/akermu/emacs-libvterm/issues/85#issuecomment-491845136)
+
Run the build:
```
@@ -32,14 +37,6 @@ And add this to your `init.el`:
(require 'vterm)
```
-If you want to have the module compiled, wrap the call to `require` as follows:
-
-```
-(add-to-list 'load-path "path/to/emacs-libvterm")
-(let (vterm-install)
- (require 'vterm))
-```
-
# Debugging and testing
If you have successfully build the module, you can test the module by executing
diff --git a/vterm.el b/vterm.el
index 5529180..91659a7 100644
--- a/vterm.el
+++ b/vterm.el
@@ -39,13 +39,6 @@
;; (require 'vterm)
;; ```
-;; If you want to have the module compiled, wrap the call to `require` as follows:
-
-;; ```
-;; (add-to-list 'load-path "path/to/emacs-libvterm")
-;; (let (vterm-install)
-;; (require 'vterm))
-;; ```
;;; Code:
@@ -61,20 +54,22 @@
(let ((default-directory (file-name-directory (locate-library "vterm"))))
(unless (file-executable-p (concat default-directory "vterm-module.so" ))
(let* ((buffer (get-buffer-create vterm-install-buffer-name))
- (status (call-process "sh" nil buffer t "-c"
+ status)
+ (pop-to-buffer vterm-install-buffer-name)
+ (setq status (call-process "sh" nil buffer t "-c"
"mkdir -p build; \
cd build; \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..; \
- make")))
+ make") )
(if (eq status 0)
(message "Compilation of emacs-libvterm module succeeded")
- (pop-to-buffer vterm-install-buffer-name)
(error "Compilation of emacs-libvterm module failed!"))))))
-(when (boundp 'vterm-install)
- (vterm-module-compile))
-(require 'vterm-module)
+(unless (require 'vterm-module nil t)
+ (vterm-module-compile)
+ (require 'vterm-module))
+
(require 'subr-x)
(require 'cl-lib)
(require 'color)