Skip to content

Commit

Permalink
hib-social.el - Rename to hibtypes-git-use-magit-flag; make first ebu…
Browse files Browse the repository at this point in the history
…t in file work without saving
  • Loading branch information
rswgnu committed Aug 2, 2020
1 parent b8fd1e8 commit 845119a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 16 deletions.
14 changes: 9 additions & 5 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2020-08-02 Bob Weiner <[email protected]>

* hbut.el (hbut:key-src-set-buffer): Fixed explicit button creation in a new
file that has not yet been saved.

* hib-social.el (git-reference, hibtypes-git-use-magit-flag): Added this flag.
If Magit is available, when activating a git directory button, use Magit
rather than Dired.

2020-08-01 Bob Weiner <[email protected]>

* hui-mini.el (hui:menu-get-keys): Cleared hui:menu-keys to prevent multiple
Expand Down Expand Up @@ -75,11 +84,6 @@

* hyperbole.el (hkey-global-set-key): Documented.

2020-07-20 Bob Weiner <[email protected]>

* hbdata.el (hbdata:write): Fixed so first explicit button created in a directory
works before saving its source buffer (by saving the directory .hypb file).

2020-07-19 Bob Weiner <[email protected]>

* hyperbole.el (hyperb:init): Remove WSL abbrev of /mnt/c as /c since may not exist.
Expand Down
8 changes: 8 additions & 0 deletions HY-NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
- Markdown In-file Links: With point on the link title, in-file links are
now activated properly (previously point had to be on the link itself).

- Git#directory Buttons: New flag, hibtypes-git-use-magit-flag, which if
set to t and Magit is available, then when activating a git directory
button, such as git#/hyperbole, use Magit rather than Dired.

- Explicit Buttons Work Immdiately: Previously you had to save the buffer
in which you created an explicit button before it would work. Now they
work immediately after creation.

DOCUMENTATION

- Helm Mode: Added Hyperbole Manual section, "Smart Key - Helm Mode"
Expand Down
4 changes: 3 additions & 1 deletion TALK/HY-TALK.org
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
* [[file:hyperbole-banner.png]]
* [[file:../hyperbole-banner.png]]

GNU Hyperbole

Make Your Text Come Alive

Expand Down
7 changes: 0 additions & 7 deletions hbdata.el
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,8 @@ On failure, return nil."
(setq entry (car cons) lbl-instance (cdr cons))
(prin1 entry (current-buffer))
(terpri (current-buffer))
(when buffer-file-name (not (file-exists-p buffer-file-name))
;; This is the first explicit button created in this
;; directory, so .hypb does not yet exist and unless it is saved
;; here, the first explicit button won't work until its source
;; buffer is saved.
(save-buffer))
(or lbl-instance t))))


;;; ************************************************************************
;;; Private variables
;;; ************************************************************************
Expand Down
5 changes: 5 additions & 0 deletions hbut.el
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,11 @@ represent the output of particular document formatters."
src)
((file-readable-p (setq src (hpath:symlink-referent src)))
(set-buffer (find-file-noselect src))
src)
;; Buffer may be newly created with an attached file that has
;; not yet been saved, so it can't be read.
((get-file-buffer src)
(set-buffer (get-file-buffer src))
src)))

(defun hbut:key-to-label (lbl-key)
Expand Down
6 changes: 3 additions & 3 deletions hib-social.el
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@
: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."
(defcustom hibtypes-git-use-magit-flag nil
"If magit is available, when activating a git directory button, use Magit rather than Dired."
:type 'boolean
:group 'hyperbole-button)

Expand Down Expand Up @@ -808,7 +808,7 @@ 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
(if (and hibtypes-git-use-magit-status (featurep 'magit))
(if (and hibtypes-git-use-magit-flag (fboundp #'magit-status-setup-buffer))
(hpath:display-buffer (save-window-excursion
(magit-status-setup-buffer
(file-name-as-directory project-dir))))
Expand Down

0 comments on commit 845119a

Please sign in to comment.