Skip to content

Commit

Permalink
Add support for magit-status
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienCassou committed Jun 5, 2017
1 parent 2721bab commit 04ae11d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.org
Expand Up @@ -22,6 +22,7 @@ In particular, these modes are supported:
| *Mode* | ~M-<~ | ~M->~ |
|-----------------------+-------------------------+----------------------------|
| *dired-mode* | first file | last file |
| *magit-status-mode* | first section | last section |
| *message-mode* | first body line | last line before signature |
| *occur-mode* | first match | last match |
| *ibuffer-mode* | first buffer | last buffer |
Expand Down Expand Up @@ -62,8 +63,10 @@ or ~end-of-buffer~).

The following shows some screencasts.

*** Dired-mode
*** Dired mode
[[file:media/beginend-dired-mode.gif]]
*** Magit status mode
[[file:media/beginend-magit-mode.gif]]
*** Message mode
[[file:media/beginend-message-mode.gif]]
*** Occur mode
Expand Down
10 changes: 10 additions & 0 deletions beginend.el
Expand Up @@ -240,6 +240,16 @@ BEGIN-BODY and END-BODY are two `progn' expressions passed to respectively
(progn
(prodigy-last)))

(declare-function magit-section-backward "magit-section")

(beginend-define-mode magit-status-mode
(progn
(re-search-forward "^$")
(forward-line))
(progn
(magit-section-backward)
(magit-section-backward)))

;;;###autoload
(defun beginend-setup-all ()
"Use beginend on all compatible modes.
Expand Down
Binary file added media/beginend-magit-mode.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 04ae11d

Please sign in to comment.