branch: externals/hyperbole commit b8fd1e83cd46567e8d7661369df7f6b7c6f595ff Merge: 008182b 21b2b1c Author: Bob Weiner <r...@gnu.org> Commit: Bob Weiner <r...@gnu.org>
Merge branch 'master' of github.com:rswgnu/hyperbole --- 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)