Commit graph

38 commits

Author SHA1 Message Date
Henrik Lissner
7c5903c339
Bump :ui modules
hlissner/emacs-doom-themes@0760079 -> hlissner/emacs-doom-themes@bbb3725
tarsius/hl-todo@5d2ea49 -> tarsius/hl-todo@3bba459
abo-abo/hydra@e3beffd -> abo-abo/hydra@16fa8d1
seagle0128/doom-modeline@0df5585 -> seagle0128/doom-modeline@0642f71
syohex/emacs-anzu@592f8ee -> syohex/emacs-anzu@2e69955
jaypei/emacs-neotree@c2420a4 -> jaypei/emacs-neotree@98fe213
ema2159/centaur-tabs@af50f87 -> ema2159/centaur-tabs@e6bf9f5
Alexander-Miller/treemacs@4eb8eb8 -> Alexander-Miller/treemacs@81b69d9
syohex/emacs-git-gutter-fringe@16226ca -> syohex/emacs-git-gutter-fringe@da19a47
Bad-ptr/persp-mode.el@e330e62 -> Bad-ptr/persp-mode.el@391a7dc
jabranham/mixed-pitch@6090716 -> jabranham/mixed-pitch@734fbdf
2020-03-27 16:18:52 -04:00
Henrik Lissner
aa1f11af4f
Enable git-gutter backends conditionally
Follow up to #2634
2020-03-01 01:36:16 -05:00
Sebastian Sturm
2ce58c6df3 Extend backend-agnostic vc functionality
this commit adds a default keybinding for the vc-gutter hydra (leader-g
.) if both vc-gutter and hydra are enabled. It ensures that the various
vc-*-log-view-modes open up in emacs state, and it adds hg, svn and bzr
to the list of vc backends handled by git-gutter
2020-02-29 14:41:20 +01:00
Henrik Lissner
eb69073578
Fix infinite redrawing/freezing with {centaur,awesome}-tabs
Caused by over-zealous doom-switch-window-hook.

For my own sanity (and if you're curious), I'll break it down here:

1. Doom has a `doom-switch-window-hook` hook. It triggers when window
   focus is changed.
2. We use `buffer-list-update-hook` to trigger
   `doom-switch-window-hook`. (That may sound weird, but this hook is
   reliably executed when window focus is changed -- there are
   safeguards to prevent this from triggering too often)
3. `buffer-list-update-hook` triggers whenever a buffer is created, but
   `doom-switch-window-hook` only triggers if the created buffer is in
   a new window.
4. The use of `with-temp-buffer` in `centaur-tabs-line-format` counts as
   "buffer creation" in a "new window".
5. `+vc-gutter-update-h` is in `doom-switch-window-hook`. This refreshes
   git-gutter, which initiates a redraw of Emacs.
6. When Emacs redraws, it recalculates its mode and header lines. which
   triggers `doom-switch-window-hook` once, which triggers
   `+vc-gutter-update-h`, which redraws the screen, then Emacs recalculates
   the header line, running `centaur-tabs-line-format`...

Infinite loop ensues

Hopefully fixes:
- hlissner/doom-emacs#2436
- ema2159/centaur-tabs#18
- ema2159/centaur-tabs#88
2020-02-27 21:47:32 -05:00
Henrik Lissner
4830f9784f
Fix load order of vc-gutter default style
So you can unset `+vc-gutter-default-style` in your config.el to disable
it.
2020-02-27 14:52:53 -05:00
Henrik Lissner
e20f574b2e
Fix git-gutter in indirect buffers 2020-02-25 12:49:59 -05:00
Henrik Lissner
d522a7816d
Move flycheck customization out of git-gutter after block
To simplify the load path users would have to be aware of in order to
customize flycheck-indication-mode.
2020-02-25 12:45:30 -05:00
Henrik Lissner
b30f38ac06
Minor refactor & reformatting across the board 2020-02-23 15:42:43 -05:00
Henrik Lissner
a9402cfb55
Fix #2373: bring back package pinning
This needs some serious refactoring...
2020-01-25 19:02:00 -05:00
Henrik Lissner
4cc14389e8
PIN ALL THE PACKAGES 2020-01-14 22:32:11 -05:00
Henrik Lissner
e079b4b1e3
ui/vc-gutter: fix {next,previous}-hunk commands
They would sometimes jump to random hunks.
2019-09-27 15:18:44 -04:00
Henrik Lissner
a3e262c7ac
💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
Henrik Lissner
629249aa43
Enable git-gutter on find-file-hook and org-mode
And disable it in pdf-view-mode. Perhaps this is too comprehensive?
2019-07-23 20:43:35 +02:00
Henrik Lissner
fec53f7b1d
Fix git-gutter not updating when whole file is staged
But we don't want it triggering on git-gutter:*-hunk, because they do
their own refreshing work.
2019-07-23 18:18:43 +02:00
Henrik Lissner
76cacb5bfe
💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Henrik Lissner
d7ed52f3c7
Add ui/hydra module
And conforms all existing hydras to the naming convention for
interactive commands, e.g.

  +vc-gutter-hydra -> +vc/gutter-hydra
2019-07-22 23:51:12 +02:00
Henrik Lissner
88813ff196
Minor reformatting across the board
Gotta

Look

Nice
2019-07-22 22:34:08 +02:00
Henrik Lissner
7058facf9d
ui/vc-gutter: disable git-gutter in some modes
Disabling git-gutter in fundamental-mode theoretically reduces the
number of times git-gutter is initialized (because it has to switch to
and from fundamental-mode once, sometimes twice, when changing major
modes).

git-gutter also has trouble with org-indent-mode, so we disable it
there.

And it isn't useful in image-mode.
2019-07-22 02:30:41 +02:00
Henrik Lissner
b01606e99b
ui/vc-gutter: fix gutter not updating after stage
When using git-gutter:stage-hunk, the gutter would be updated just
before its state is changed, creating a stale diff.
2019-07-22 02:30:41 +02:00
Henrik Lissner
149b2617b0
💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
Henrik Lissner
84fd744e3f
Minor, general refactor & comment revision 2019-06-14 11:08:59 +02:00
Henrik Lissner
0f58634df4
Fix git-gutter:disabled-modes check #1482
Also ignores git-gutter-fringe config if package was disabled.
2019-06-13 10:10:37 +02:00
Henrik Lissner
74a4700486
ui/vc-gutter: conform functions to conventions
Since the module was renamed...
2019-06-12 20:24:11 +02:00
Henrik Lissner
77a7b76108
ui/vc-gutter: respect git-gutter:disabled-modes #1482 2019-06-12 09:32:55 +02:00
Henrik Lissner
6745ff1323
ui/vc-gutter: resize git-gutter popup to fit
Due to the prompt, you can't scroll the git-gutter popup, making it
difficult to see the full diff. This isn't a perfect fix but at least
improves the situation.
2019-05-21 17:24:24 -04:00
Henrik Lissner
1d40602c3e
ui/vc-gutter: defer git-gutter until file exists
If the current buffer doesn't represent a real file, defer enabling
git-gutter-mode until the file is saved.
2019-05-06 02:14:14 -04:00
Henrik Lissner
a4283427f5
Fix autoloaded hydras
They weren't marked as interactive, making them unavailable for `M-x` or
keybinds.
2019-04-07 16:06:52 -04:00
Henrik Lissner
1e1f725a55
ui/vc-gutter: remove redundant after-save hook
git-gutter already adds one to after-save-hook.
2019-03-13 19:20:07 -04:00
Henrik Lissner
7097739994
ui/vc-gutter: remove commented diff-hl config 2019-03-04 04:57:07 -05:00
fydai
2107e3caaf
ui/vc-gutter: switch git-gutter order
This change checks whether a file is remote before checking whether it's a version controlled repo, rather than the other way around. Gives a slight speed improvement to Tramp.
2018-12-30 04:16:40 -08:00
Henrik Lissner
693711bf9c ui/vc-gutter: git-gutter:window-width = 1
Hopefully fixes "jumpy gutter" when refreshing git-gutter in tty Emacs.
2018-12-05 22:11:54 -05:00
Henrik Lissner
661632d55e
ui/vc-gutter: fix git-gutter in tty Emacs
Use git-gutter-mode in tty Emacs, and git-gutter-fringe in GUI Emacs.
2018-10-06 20:44:25 -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
76d90e752f
Update git-gutter on magit stage/unstage file
Old magit-post-refresh-hook wasn't working (no guarantee the correct
buffer was current).
2018-07-12 18:47:54 +02:00
Henrik Lissner
26f514001e
Autoload git-gutter:{revert-hook,stage-hunk}
In case they're used before git-gutter has loaded; they should be
allowed to error themselves.
2018-06-27 18:51:32 +02:00
Henrik Lissner
017ba8d79c
Autoload defhydras & use new naming convention
Phasing out the +module@name convention for plain old
+module-name-hydra, which is more compatible with elisp reflection tools
like describe-function and such.

Also, Emacs starts up faster now. Tee hee.
2018-06-26 01:43:54 +02:00
Benjamin Andresen
61cdac230f ui/vc emacs/vc: unify hydra design
this design will also break less based on the fonts
2018-06-23 16:25:58 +02:00
Henrik Lissner
60779c9aed
feature/version-control => ui/vc-gutter, emacs/vc
Reorganize vcs functionality. Moves the custom fringe bitmaps into :ui
vc-gutter.
2018-06-22 01:49:20 +02:00