joestar

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 7e6584abdf18bca7583184efc630c1627dd1dd5a
parent 4f572be1c517238e8782ffb372c8050f24533eec
Author: Ryan Jeffrey <pwishie@gmail.com>
Date:   Thu, 30 May 2019 14:53:29 -0700

basic window funcs

Diffstat:
MREADME.org | 3+++
Mjoestar.el | 19+++++++------------
2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/README.org b/README.org @@ -1,5 +1,8 @@ * Joestar Joestar is a minor mode for emacs that seeks to emulate [[https://github.com/jhallen/joe-editor][Joe's Own Editor]], a wordstar-like terminal text editor. +* Known Issues +The keyboard shortcut to insert a shell command currently does not work properly. +In order to insert shell output call the joe-insertcmd function directly. * Joestar and undo-tree Joestar depends on undo-tree, which uses C-x for several of its keybindings, which conflicts with Joestar's usage of C-x. In order to fix this, Joestar remaps the three following functions: diff --git a/joestar.el b/joestar.el @@ -155,17 +155,6 @@ (save-buffer file-path) (message "File %s saved." file-path)) -(defun joe-tw0 () - "Eliminate this window." - (interactive) - (if (= 1 (length (window-list))) - (if (buffer-modified-p) - (if (y-or-n-p "Lose changes to this file? ") - (kill-emacs) - nil) - (kill-emacs)) - (delete-window))) - (defun joe-open () "Insert a newline character." (interactive) @@ -328,14 +317,20 @@ (push-mark) (goto-char joe-nextmark)))) +; TODO fix bug where this only works if called from mb (defun joe-insertcmd (com) "Append the output of shell command COM to current buffer." (interactive "sProgram to run: ") - (append-to-buffer (shell-command-to-string com))) ; TODO fix + (let* ((joe-cur-mark (point-marker))) + (call-interactively 'end-of-buffer) + (insert (shell-command-to-string com)) + (goto-char joe-cur-mark))) (defalias 'joe-nbuf 'next-buffer) (defalias 'joe-pbuf 'previous-buffer) (defalias 'joe-reload 'revert-buffer) +(defalias 'joe-tw0 'delete-window) +(defalias 'joe-tw1 'delete-other-windows) ;;; setting joestar's wordstar-like keybindings (defvar joestar-mode-map