From 94ca78a86fc90a180ba3f9abb89f0c5fc5fdda31 Mon Sep 17 00:00:00 2001 From: Hannu Koivisto Date: Sat, 24 Oct 2009 03:28:45 +0300 Subject: [PATCH] Add command magit-goto-parent-section. --- magit.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/magit.el b/magit.el index f47356e5..cc202e5d 100644 --- a/magit.el +++ b/magit.el @@ -799,6 +799,12 @@ Many Magit faces inherit from this one by default." (magit-show-commit (or prev section))) (goto-char (magit-section-beginning (or prev section)))))))) +(defun magit-goto-parent-section () + (interactive) + (let ((parent (magit-section-parent (magit-current-section)))) + (when parent + (goto-char (magit-section-beginning parent))))) + (defun magit-goto-section (path) (let ((sec (magit-find-section path magit-top-section))) (if sec @@ -1235,6 +1241,7 @@ Many Magit faces inherit from this one by default." (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 "") 'magit-goto-parent-section) (define-key map (kbd "g") 'magit-refresh) (define-key map (kbd "G") 'magit-refresh-all) (define-key map (kbd "s") 'magit-stage-item)