Commit graph

27 commits

Author SHA1 Message Date
Henrik Lissner
51d3b1b424
💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
Henrik Lissner
108c7ba5ad
Fix 'selected killed buffer' error on +magit/quit 2019-06-30 13:20:07 +02:00
Huy Duong
c4b325fa4b Fix magit-clone error
magit-clone function has changed signature to work with transient.
So using the new magit-clone-regular instead.

Signed-off-by: Huy Duong <huy.duong@employmenthero.com>
2019-06-03 16:59:03 +07:00
Henrik Lissner
051f792205
tools/magit: remove +magit-display-popup-buffer
Because magit uses transient now, and other plugins that use magit-popup
don't seem to need it anymore.

And update docstring+comments.
2019-05-04 19:13:26 -04:00
Henrik Lissner
5bcab488a7
Add {vc,git-gutter}-mode checks to vc refresher 2019-04-01 13:21:25 -04:00
Henrik Lissner
bdd410cb9c
Refresh vc on-demand after quitting magit #1298
To avoid the long delay when you have many buffers open while quitting
magit.
2019-04-01 13:12:00 -04:00
Henrik Lissner
7f1c275d62
+magit/clone: fix void-function ghub--username 2019-02-18 20:13:37 -05:00
Henrik Lissner
ecfe52f71c
Fix +magit/clone to no longer use magithub 2019-02-18 18:26:19 -05:00
Henrik Lissner
ba0ccc1d34
tools/magit: cleanup magit concurrently
A quick attempt to make +magit/quit faster.
2019-02-14 00:40:19 -05:00
Henrik Lissner
f0465f22cc
tools/magit: fix +magit/quit & default display fn
When used with magit-display-buffer-traditional, q wouldn't close the
window, just kill the buffer inside.
2018-10-07 11:12:51 -04:00
Henrik Lissner
b573fcce20
quit-window on multiple magit-status windows
If you accidentally open multiple magit status windows, you'll be stuck
in a deadlock, where `q` will do nothing. Now, +magit/quit will use
`quit-window` on excess magit-status windows instead.
2018-10-03 00:04:08 -04:00
Henrik Lissner
fcd1e913c5
tools/magit: update vc on +magit/quit
Instead of magit-post-refresh-hook, which fires much more frequently.
Updating vc across all buffers is expensive, so let's only do it when we
quit magit.

Warning: this may make quitting magit expensive when you have many
buffers open. Still searching for a better solution.
2018-09-26 12:10:00 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
17abb990e4
tools/magit: don't make new windows too tall
Some popups (like logs or revisions) completely consume the current
window.
2018-08-21 22:45:42 +02:00
Henrik Lissner
9e0e586dd8
tools/magit: use current window instead of fullcol
Full column is a bit tempermental. This also removes the need to restore
the window config after quitting magit.

Why the switch from full-frame magit to current-buffer? It is the least
intrusive policy; it doesn't rearrange the user's workspace.
2018-08-19 01:15:22 +02:00
Henrik Lissner
2cc5d223fe
Rewrite how magit windows/popups are managed
The old policy was to invoke magit in fullscreen, but in practice, I've
found myself wanting to peek at other buffers (maybe even notes) while I
manage my project in version control.

So this change introduces two big changes and one fix:

+ Instead of a full-frame policy, we use full-column. e.g. Invoking
  magit-status will take up a full column of windows (and will restore
  them when you quit).
+ Popups are displayed below the current window if called from a magit
  buffer, otherwise as a popup at the bottom of the frame.
+ Fixes popups opening in a random window if called from a magit buffer
  in a popup.

This is only a start and needs more testing.
2018-08-13 21:47:56 +02:00
Henrik Lissner
fd949e7063
Make diff larger when committing via magit
The diff window contains more important information, so we shrink the
git commit window and enlargen the diff window.
2018-06-16 21:48:37 +02:00
Henrik Lissner
01b2856cc2
From eshell, open magit buffers in same window 2018-06-16 15:20:10 +02:00
Henrik Lissner
c305d63dd7
Improve magit display-buffer logic
Now opens derivative magit buffers (from popup magit windows) in
fullscreen.
2018-06-16 14:38:52 +02:00
Henrik Lissner
383ecf7a08
Fix magit rebase/log windows being hidden by diffs 2018-06-10 17:28:17 +02:00
Henrik Lissner
85a0c9efc9
New default display-buffer handler for magit
+magit-display-buffer-fullscreen is a more sophisticated (albeit
experimental) replacement for magit-display-buffer-fullframe-status-v1,
which fullscreens magit, but will also:

a) Keep the status window visible
b) Treat magit buffers not opened from magit-status as popups
2018-06-07 02:51:45 +02:00
Henrik Lissner
bab530ea2e
Revert +hub flag, but disable magithub by default
Must be enabled on a per-project basis. You can change this behavior by
setting +magit-hub-enabled-by-default to non-nil (before magit is
loaded).

Magithub has been made opt-in because:

1. Magithub is imposing, asking the user for a token, especially for
   users who don't use github (much or at all), but may occasionally
   have a project with a github remote.
2. magithub is really slow on first load for medium-to-large repos.
3. It's really easy to enable it through the magithub popup (H C e).
   magithub.enabled is saved into the project's .git/config file, so the
   setting will persist.

Also added a docstring to +magit-hub-features
2018-06-01 11:13:37 +02:00
Henrik Lissner
3a16b70022
Add +magit/clone command & bind to SPC g C #633
magithub-clone doesn't support full urls, magit-clone doesn't support
user/repo notation. +magit/clone supports both.
2018-05-31 13:59:21 +02:00
Benjamin Andresen
8917bc9194 Fix: tools/magit: +magit--kill-buffer function call corrected 2018-04-12 00:41:38 +02:00
Henrik Lissner
460461ef54
tools/magit: clean up after magit more intelligently #506
Ensures magit buffers are cleaned up after magit-status is closed. Will
defer cleanup on process buffers, until the processes have finished.

Also fixes issue where quitting magit will leave leftover windows.
2018-04-08 20:44:40 -04:00
Henrik Lissner
163d0ce70e
tools/magit: don't kill processes 2018-04-04 09:35:39 -04:00
Henrik Lissner
b98e26856d
Add tools/magit/autoload.el 2018-04-04 08:04:54 -04:00