https://github.com/honmaple/emacs-maple-run
Execute buffer code with comint mode.
https://github.com/honmaple/emacs-maple-run
Last synced: 5 months ago
JSON representation
Execute buffer code with comint mode.
- Host: GitHub
- URL: https://github.com/honmaple/emacs-maple-run
- Owner: honmaple
- License: gpl-3.0
- Created: 2019-09-15T13:37:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-01T16:05:31.000Z (almost 4 years ago)
- Last Synced: 2025-07-27T00:31:06.056Z (11 months ago)
- Language: Emacs Lisp
- Homepage:
- Size: 18.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* emacs-maple-run
Execute current buffer with comint mode that can read from stdin.
** How to use?
#+begin_src elisp
(use-package maple-run
:quelpa (:fetcher github :repo "honmaple/emacs-maple-run")
:commands (maple-run))
#+end_src
Or alternatively, you can download the repository and install manually by doing:
#+begin_src bash
git clone https://github.com/honmaple/emacs-maple-run ~/.emacs.d/site-lisp/maple-run
#+end_src
#+begin_src elisp
(use-package maple-run
:ensure nil
:commands (maple-run))
#+end_src
Then just use =maple-run= to execute current buffer, or use =maple-run:script= and execute code file manually.
** Customize
- custom execute commands
#+begin_src elisp
(add-to-list 'maple-run:alist '(c-mode :command "gcc %F -o %b && ./%b"))
(add-to-list 'maple-run:alist '(cc-mode :command "gcc %F -o /tmp/%b && /tmp/%b"))
(add-to-list 'maple-run:alist '(python-mode :command "python %F"))
(add-to-list 'maple-run:alist '((html-mode web-mode) :command browse-url-of-file))
#+end_src
*special char*
#+begin_example
%F - The absolute path of current file.
%f - The filename with no directory.
%d - The directory name of current file.
%B - The absolute path of current file without extension.
%b - The filename without extension.
#+end_example
- other customize
#+begin_src elisp
;; The time of process timeout, 0 means never timeout
(setq maple-run:timeout 20)
;; auto focus process buffer
(setq maple-run:focus t)
;; Whether clear process buffer when execute command every time
(setq maple-run:auto-clear nil)
#+end_src