summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-23 22:36:43 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-23 22:42:13 -0700
commit0154575979a184f11b901fd0b4b33b455516f2ec (patch)
treeb2395b5f0cdf2debf73a839fc5bd1de580e4d1bb
parente6fdf785ad342c0268b5360a3817454998452f10 (diff)
downloaddotfiles-0154575979a184f11b901fd0b4b33b455516f2ec.tar.gz
add and bind spw/mrs
-rw-r--r--.emacs.d/init-spw.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el
index 8d7d3b64..afd2b2d9 100644
--- a/.emacs.d/init-spw.el
+++ b/.emacs.d/init-spw.el
@@ -1633,6 +1633,23 @@ Useful after resizing the frame."
(async-shell-command "git-dotfiles-rebase" "*dotfiles rebase*")))
(global-set-key "\C-cgd" #'spw/dotfiles-rebase)
+(defun spw/mrs (&rest ignore)
+ (interactive)
+ (let ((buffer (get-buffer-create "*mrs*")))
+ (with-current-buffer buffer
+ (erase-buffer)
+ (term-mode)
+ (setq-local revert-buffer-function #'spw/mrs
+ default-directory (expand-file-name "~"))
+ (term-exec buffer "*mrs*" "sh" nil
+ '("-c" "src-register-all && mr -s status")))
+ (when-let ((proc (get-buffer-process buffer))
+ (window (display-buffer buffer)))
+ (set-process-sentinel proc (lambda (&rest ignore)
+ (with-selected-window window
+ (goto-char (point-min))))))))
+(global-set-key "\C-cgr" #'spw/mrs)
+
(defun spw/window-to-frame ()
"Like `tear-off-window' but to be invoked from the keyboard."
(interactive)