forked from magit/magit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No longer define magit-section's hook variables as custom options
Instead define them as regular variables and add the default hook functions using `add-hook'. We need to do this so that we can distribute `magit-section' as a standalone package, which cannot use function that are defined in `magit's on its hooks--they might not be defined since it is now possible to load `magit-section' without loading `magit'.
- Loading branch information
Showing
5 changed files
with
67 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
#+TEXINFO_DIR_CATEGORY: Emacs | ||
#+TEXINFO_DIR_TITLE: Magit: (magit). | ||
#+TEXINFO_DIR_DESC: Using Git from Emacs with Magit. | ||
#+SUBTITLE: for version 2.90.1 (v2.90.1-880-gf63077242+1) | ||
#+SUBTITLE: for version 2.90.1 (v2.90.1-895-g1f79b3d77+1) | ||
|
||
#+TEXINFO_DEFFN: t | ||
#+OPTIONS: H:4 num:3 toc:2 | ||
|
@@ -25,7 +25,7 @@ directly from within Emacs. While many fine Git clients exist, only | |
Magit and Git itself deserve to be called porcelains. | ||
|
||
#+TEXINFO: @noindent | ||
This manual is for Magit version 2.90.1 (v2.90.1-880-gf63077242+1). | ||
This manual is for Magit version 2.90.1 (v2.90.1-895-g1f79b3d77+1). | ||
|
||
#+BEGIN_QUOTE | ||
Copyright (C) 2015-2020 Jonas Bernoulli <[email protected]> | ||
|
@@ -921,6 +921,16 @@ the following commands. | |
The above commands all call the hook ~magit-section-movement-hook~. | ||
Any of the functions listed below can be used as members of this hook. | ||
|
||
You might want to remove some of the functions that Magit adds using | ||
~add-hook~. In doing so you have to make sure you do not attempt to | ||
remove function that haven't even been added yet, for example: | ||
|
||
#+BEGIN_SRC emacs-lisp | ||
(with-eval-after-load 'magit-diff | ||
(remove-hook 'magit-section-movement-hook | ||
'magit-hunk-set-window-start)) | ||
#+END_SRC | ||
|
||
- Variable: magit-section-movement-hook | ||
|
||
This hook is run by all of the above movement commands, after | ||
|
@@ -930,7 +940,9 @@ Any of the functions listed below can be used as members of this hook. | |
|
||
This hook function ensures that the beginning of the current section | ||
is visible, provided it is a ~hunk~ section. Otherwise, it does | ||
nothing. This function is a member of the hook's default value. | ||
nothing. | ||
|
||
Loading ~magit-diff~ adds this function to the hook. | ||
|
||
- Function: magit-section-set-window-start | ||
|
||
|
@@ -943,15 +955,17 @@ Any of the functions listed below can be used as members of this hook. | |
|
||
This hook function only has an effect in log buffers, and ~point~ is | ||
on the "show more" section. If that is the case, then it doubles | ||
the number of commits that are being shown. This function is a | ||
member of the hook's default value. | ||
the number of commits that are being shown. | ||
|
||
Loading ~magit-log~ adds this function to the hook. | ||
|
||
- Function: magit-log-maybe-update-revision-buffer | ||
|
||
When moving inside a log buffer, then this function updates the | ||
revision buffer, provided it is already being displayed in another | ||
window of the same frame. This function is a member of the hook's | ||
default value. | ||
window of the same frame. | ||
|
||
Loading ~magit-log~ adds this function to the hook. | ||
|
||
- Function: magit-log-maybe-update-blob-buffer | ||
|
||
|
@@ -1067,7 +1081,7 @@ useful. But your mileage may vary. | |
|
||
When a buffer is first created then some sections are shown expanded | ||
while others are not. This is hard coded. When a buffer is refreshed | ||
then the previous visibility is preserved. The initial visibility of | ||
then the previous visibility is preserved. The initial visibility of | ||
certain sections can also be overwritten using the hook | ||
~magit-section-set-visibility-hook~. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters