branch: externals/agitate commit b6e5cdbdda3df4bb452f47e2a3c7e68a45456bf6 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Add agitate-enable-outline-minor-mode function --- agitate.el | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/agitate.el b/agitate.el index 61350f03ab..2b28c8d377 100644 --- a/agitate.el +++ b/agitate.el @@ -7,7 +7,7 @@ ;; URL: https://git.sr.ht/~protesilaos/NOT-YET-AVAILABLE ;; Mailing-List: https://lists.sr.ht/~protesilaos/NOT-YET-AVAILABLE ;; Version: 0.0.0 -;; Package-Requires: ((emacs "27.1")) +;; Package-Requires: ((emacs "28.1")) ;; Keywords: convenience, version control, git ;; This file is NOT part of GNU Emacs. @@ -90,6 +90,21 @@ relative to its latest revision." (diff-buffer-with-file (current-buffer)) (vc-diff))) +(defvar outline-minor-mode-highlight) + +;;;###autoload +(defun agitate-enable-outline-minor-mode () + "Enable `outline-minor-mode' with appropriate tweaks for diffs. + +This basically gives you folding of diff hunks by means of the +`outline-cycle' command. + +Add this function to the `diff-mode-hook'." + (require 'outline) + (let ((outline-minor-mode-highlight nil)) + (when (derived-mode-p 'diff-mode) + (outline-minor-mode 1)))) + ;;;; Commands for log-view (listings of commits) ;;;###autoload