X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/2870f8b8d5544580dbab32b91c2de488dcc5e522..9a3bb1f1dd54a022bfff393e5959fd116f4423f4:/contrib/stgit.el diff --git a/contrib/stgit.el b/contrib/stgit.el index ed2fc37..2d18061 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -41,13 +41,20 @@ Argument DIR is the repository path." (defmacro stgit-capture-output (name &rest body) "Capture StGit output and show it in a window at the end" - `(let ((output-buf (get-buffer-create ,(or name "*StGit output*")))) + `(let ((output-buf (get-buffer-create ,(or name "*StGit output*"))) + (stgit-dir default-directory) + (inhibit-read-only t)) (with-current-buffer output-buf - (erase-buffer)) + (erase-buffer) + (setq default-directory stgit-dir) + (setq buffer-read-only t)) (let ((standard-output output-buf)) ,@body) - (if (with-current-buffer output-buf (< (point-min) (point-max))) - (display-buffer output-buf t)))) + (with-current-buffer output-buf + (set-buffer-modified-p nil) + (setq buffer-read-only t) + (if (< (point-min) (point-max)) + (display-buffer output-buf t))))) (put 'stgit-capture-output 'lisp-indent-function 1) (defun stgit-run (&rest args) @@ -78,6 +85,8 @@ Argument DIR is the repository path." (suppress-keymap stgit-mode-map) (define-key stgit-mode-map "?" 'stgit-help) (define-key stgit-mode-map "h" 'stgit-help) + (define-key stgit-mode-map "p" 'previous-line) + (define-key stgit-mode-map "n" 'next-line) (define-key stgit-mode-map "g" 'stgit-refresh) (define-key stgit-mode-map "r" 'stgit-rename) (define-key stgit-mode-map ">" 'stgit-push-next)