From c97fa1a0c3b573e5642fff0257adbc71d6dcdbc9 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 11 Feb 2009 04:07:44 -0400 Subject: [PATCH 1/3] If SPC and DEL are used within a normal text region, just scroll up/down. --- magit.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/magit.el b/magit.el index de385305..1ca8d1e9 100644 --- a/magit.el +++ b/magit.el @@ -799,10 +799,12 @@ Many Magit faces inherit from this one by default." (,type (magit-section-type ,section)) (,context (magit-section-context-type ,section))) (cond ,@(mapcar (lambda (clause) - (let ((prefix (reverse (car clause))) - (body (cdr clause))) - `((magit-prefix-p ',prefix ,context) - ,@body))) + (if (eq (car clause) t) + clause + (let ((prefix (reverse (car clause))) + (body (cdr clause))) + `((magit-prefix-p ',prefix ,context) + ,@body)))) clauses) ,@(if opname `(((not ,type) @@ -2684,7 +2686,9 @@ Prefix arg means justify as well." ((commit) (magit-show-commit info #'scroll-up)) ((stash) - (magit-show-stash info #'scroll-up)))) + (magit-show-stash info #'scroll-up)) + (t + (scroll-up)))) (defun magit-show-item-or-scroll-down () (interactive) @@ -2692,7 +2696,9 @@ Prefix arg means justify as well." ((commit) (magit-show-commit info #'scroll-down)) ((stash) - (magit-show-stash info #'scroll-down)))) + (magit-show-stash info #'scroll-down)) + (t + (scroll-down)))) (defun magit-mark-item (&optional unmark) (interactive "P") From c87154d7f6a10a930bd1a53fb9f5e75c561dcf3f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 15 Feb 2009 21:08:57 -0400 Subject: [PATCH 2/3] Use display-buffer, not pop-to-buffer, when showing magit-process after a delay --- magit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magit.el b/magit.el index 1ca8d1e9..5243c40c 100644 --- a/magit.el +++ b/magit.el @@ -889,7 +889,7 @@ Many Magit faces inherit from this one by default." (lambda (buf) (with-current-buffer buf (when magit-process - (pop-to-buffer (process-buffer magit-process)) + (display-buffer (process-buffer magit-process)) (goto-char (point-max)))))) (current-buffer)))) (setq successp t)) From bcb59cac51021946d960cd562959420539c097cf Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 15 Feb 2009 21:38:44 -0400 Subject: [PATCH 3/3] Made behavior of M-H and M-h consistent for diffs --- magit.el | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/magit.el b/magit.el index 5243c40c..d8b25586 100644 --- a/magit.el +++ b/magit.el @@ -724,6 +724,18 @@ Many Magit faces inherit from this one by default." (let ((path (reverse (magit-section-lineage (magit-current-section))))) (magit-section-show-level (car path) 0 level (cdr path))))) +(defun magit-show-only-files () + (interactive) + (if (eq magit-submode 'status) + (call-interactively 'magit-show-level-2) + (call-interactively 'magit-show-level-1))) + +(defun magit-show-only-files-all () + (interactive) + (if (eq magit-submode 'status) + (call-interactively 'magit-show-level-2-all) + (call-interactively 'magit-show-level-1-all))) + (defmacro magit-define-level-shower-1 (level all) (let ((fun (intern (format "magit-show-level-%s%s" level (if all "-all" "")))) @@ -998,8 +1010,8 @@ Many Magit faces inherit from this one by default." (define-key map (kbd "M-2") 'magit-show-level-2-all) (define-key map (kbd "M-3") 'magit-show-level-3-all) (define-key map (kbd "M-4") 'magit-show-level-4-all) - (define-key map (kbd "M-h") 'magit-show-level-2) - (define-key map (kbd "M-H") 'magit-show-level-2-all) + (define-key map (kbd "M-h") 'magit-show-only-files) + (define-key map (kbd "M-H") 'magit-show-only-files-all) (define-key map (kbd "M-s") 'magit-show-level-4) (define-key map (kbd "M-S") 'magit-show-level-4-all) (define-key map (kbd "g") 'magit-refresh)