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

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

[elpa] externals/hyperbole 21b2b1c 20/25: Use magit if available for git


From: Stefan Monnier
Subject: [elpa] externals/hyperbole 21b2b1c 20/25: Use magit if available for git social button (#32)
Date: Tue, 22 Sep 2020 10:29:29 -0400 (EDT)

branch: externals/hyperbole
commit 21b2b1c456bc40596a2cf8ec231d24ff6d5911d2
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: GitHub <noreply@github.com>

    Use magit if available for git social button (#32)
    
    * Use magit if available for git social button
    
    * Use featurep and hpath:display-buffer
    
    * Make git buttons magit behaviour configurable and default to off
---
 hib-social.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/hib-social.el b/hib-social.el
index 92e1b5f..6760b1e 100644
--- a/hib-social.el
+++ b/hib-social.el
@@ -4,7 +4,7 @@
 ;;
 ;; Orig-Date:    20-Jul-16 at 22:41:34
 ;;
-;; Copyright (C) 2016-2017  Free Software Foundation, Inc.
+;; Copyright (C) 2016-2020  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
 ;;
 ;; This file is part of GNU Hyperbole.
@@ -198,6 +198,11 @@
   :type 'string
   :group 'hyperbole-button)
 
+(defcustom hibtypes-git-use-magit-status nil
+  "If magit is available then use git social button to display magit status 
buffer."
+  :type 'boolean
+  :group 'hyperbole-button)
+
 (defcustom hibtypes-github-default-project nil
   "Default project name to associate with any Github commit link."
   :type 'string
@@ -803,8 +808,12 @@ PROJECT value is provided, it defaults to the value of
                                  (princ (format "Command: %s\n\n" cmd))
                                  (princ (shell-command-to-string cmd)))))
                          ;; Project-only reference, run dired on the project 
home directory
-                         (hpath:display-buffer (dired-noselect
-                                                (file-name-as-directory 
project-dir)))))
+                         (if (and hibtypes-git-use-magit-status (featurep 
'magit))
+                             (hpath:display-buffer (save-window-excursion
+                                                     (magit-status-setup-buffer
+                                                      (file-name-as-directory 
project-dir))))
+                           (hpath:display-buffer (dired-noselect
+                                                  (file-name-as-directory 
project-dir))))))
                       (t (if project-dir
                              (error "(git-reference): git project `%s' 
directory is unreadable or invalid: \"%s\""
                                     project project-dir)



reply via email to

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