diff options
| author | Lukas Fürmetz <fuermetz@mailbox.org> | 2019-07-04 14:48:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-04 14:48:56 +0200 |
| commit | 18e203124f766dcc429aa52a7b0f7414cf601cc7 (patch) | |
| tree | fb2890aa401d79b3008e09731ee82582801ea750 | |
| parent | d00048670dbb36d8c0c68d37657b99c44adec4ff (diff) | |
| parent | 1863fc6e00e9b53fa68dcf56034cdc3b428a59a3 (diff) | |
Merge pull request #86 from jixiuf/auto-compile
trying auto compile emacs-libvterm if require vterm-module failed
| -rw-r--r-- | README.md | 13 | ||||
| -rw-r--r-- | vterm.el | 21 |
2 files changed, 13 insertions, 21 deletions
@@ -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 @@ -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) |
