Commit graph

28 commits

Author SHA1 Message Date
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