emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/agitate b6e5cdbdda 14/67: Add agitate-enable-outline-mi


From: ELPA Syncer
Subject: [elpa] externals/agitate b6e5cdbdda 14/67: Add agitate-enable-outline-minor-mode function
Date: Wed, 28 Sep 2022 16:57:26 -0400 (EDT)

branch: externals/agitate
commit b6e5cdbdda3df4bb452f47e2a3c7e68a45456bf6
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]