Commit graph

56 commits

Author SHA1 Message Date
Henrik Lissner
57f43e0953
fix(vc): *vc-{diff,change-log}* popup rules
The former rules weren't proccing on these buffers. Also
changes *vc-diff* popups to resize based on contents.
2024-04-05 19:05:54 -04:00
Henrik Lissner
659f7bfc71
refactor!: deprecate IS-* OS constants
BREAKING CHANGE: This deprecates the IS-(MAC|WINDOWS|LINUX|BSD) family
of global constants in favor of a native `featurep` check:

  IS-MAC      ->  (featurep :system 'macos)
  IS-WINDOWS  ->  (featurep :system 'windows)
  IS-LINUX    ->  (featurep :system 'linux)
  IS-BSD      ->  (featurep :system 'bsd)

The constants will stick around until the v3 release so folks can still
use it -- and there are still some modules that use it, but I'll phase
those uses out gradually.

Fix: #7479
2024-02-04 17:54:29 -05:00
Henrik Lissner
98f3af7a7c
feat(vc): browse-at-remote: recognize gitlab.* hosts
Previously, only gitlab.com and gitlab.gnome.org were recognized as
gitlab hosts. This tweaks browse-at-remote to recognize any subdomain
named gitlab.* as a gitlab host (as a fallback, if no other regexp
matches).
2023-07-24 02:58:35 +02:00
Henrik Lissner
c523cd0e93
fix(vc): browse-at-remote: codeberg support
Incorrect :type caused browse-at-remote to produce the wrong URL for
codeberg repos.

Amend: eed6d90586
2023-02-21 19:14:12 -05:00
Robbert van der Helm
eed6d90586
fix(vc): string type error caused by codeberg support
79736d8 added codeberg.org support to the browse-at-remote package, but
rmuslimov/browse-at-remote@73c4526 (absorbed in 81268cc) changed the
format of this variable, causing "wrong-type-argument: stringp, nil"
errors.

Amend: 81268cc5cf
Ref: rmuslimov/browse-at-remote@73c45265a1
Ref: 79736d832d
2023-02-21 18:32:35 -05:00
Henrik Lissner
79736d832d
feat(vc): add codeberg support to browse-at-remote
This should be PRed upstream later.
2023-02-20 19:00:45 -05:00
Henrik Lissner
ad6a3d0f33
refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
Henrik Lissner
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
Henrik Lissner
87e48cbc90 Add git-timemachine support to browse-at-remote
browse-at-remote commands will now open the current file at the active
revision on that project's git forge in your browser.
2021-05-10 16:55:54 -04:00
Henrik Lissner
fa4f03de22 Fix #4784: browse-at-remote-prefer-symbolic = nil
+ Default browse-at-remote-prefer-symbolic to nil because a permanent
  URL is generally more desirable for developers sharing links.
+ 'SPC g y' and 'SPC o o' now support the prefix arg, which will negate
  the default value of browse-at-remote-prefer-symbolic for that call.
2021-03-11 13:41:16 -05:00
Henrik Lissner
14eb254b4b Bump :tools magit
magit/magit@1c60edc -> magit/magit@4735b92
magit/forge@fa80a87 -> magit/forge@8382fd3

The same predicates are now specified in upstream magit, so there is no need to
override `safe-local-variable'.

Closes #4760

Co-authored-by: Nikita Bloshchanevich <nbfalcon@users.noreply.github.com>
2021-03-09 14:38:09 -05:00
Nikita Bloshchanevich
973f23b1df `git-commit': fix variable predicates
`git-commit-summary-max-length' should be a number, not a symbol.

`git-commit-major-mode' should be checked more carefully, as otherwise
exploits are possible (e.g. if it is `erase-buffer' or some more
dangerous function of the user's environment).
2021-03-07 18:25:01 +01:00
Henrik Lissner
9a77626804 Omit all but SVN, Git & Hg from vc-handled-backends
This means less file IO for each buffer spent checking for each version
control system.
2021-02-26 21:33:00 -05:00
Henrik Lissner
d149c59d2e
Add emacs mode checks to insert mode checks
This is to accommodate users who default to emacs mode, rather than
insert mode. The two are also very alike, so many of these checks should
apply to both (almost) equally.
2020-12-11 17:38:09 -05:00
Henrik Lissner
b49c40bbb3
Minor refactors & comment revision 2020-11-29 14:37:32 -05:00
Henrik Lissner
22b4462e18
Make git-commit-{major-mode,summary-max-length} safe local vars 2020-11-29 14:07:39 -05:00
Henrik Lissner
f02879dd04
Add ffap & bug-reference support to +lookup/file
And disable bug-reference-mode by default. It produces too many false
positives, particularly in web modes where color hexes in strings and
comments are very common. Now that bug-reference support is built into
+lookup/file (on gf), users can use that instead.
2020-10-30 19:09:31 -04:00
Henrik Lissner
64ac1609dd
emacs/vc: enable bug-reference-mode
Turns issue/pr ids into buttons.
2020-10-22 14:50:25 -04:00
Henrik Lissner
dd8b535eb1
emacs/vc: add git-commit package
Instead of relying on magit to install it for us.
2020-06-08 01:39:49 -04:00
Henrik Lissner
a25dea91d8
Bump :emacs vc
rmuslimov/browse-at-remote@aeee6bf -> rmuslimov/browse-at-remote@771a307

Closes #2680
2020-03-08 13:07:50 -04:00
Henrik Lissner
9c07cc719d
emacs/vc: minor refactor
Follow up to #2634
2020-03-01 01:37:41 -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
f55bcdfd30
Have browse-to-remote default to master in detached repos
Instead of producing links with nil branch.
2020-02-24 19:58:03 -05:00
Henrik Lissner
c522ca4fc0
Minor refactors & cleanup 2019-12-15 15:53:28 -05:00
Henrik Lissner
0088872c20
emacs/vc: remove extraneous next/prev keys
Also, 'q' is already bound upstream in evil-collection-git-timemachine
2019-12-15 02:26:36 -05:00
Henrik Lissner
721b635476
emacs/vc: refactor git-timemachine header-line advice
The function was removed in bb702acfd
2019-12-15 02:17:40 -05:00
Henrik Lissner
bc89de4228
Move vc-follow-symlinks to core-editor
And remove vc-make-backup-files setting. nil is already its default
2019-12-08 16:10:31 -05:00
Henrik Lissner
99cd52e70f
💥 Drop Emacs 25.x support
Emacs 26.1 is Doom's new minimum supported version

Closes #2026
2019-11-08 16:02:06 -05:00
Henrik Lissner
3c6f48f9ec
Move evil & corrective keybinds to respective modules
Keybinds that correct behavior or provide or extend vim functionality
were moved to their respective modules, or to the :editor evil module.

Keybinds in the global space, that are particularly opinionated but
potentially harmful or imposing as a default, or likely for users to
change (like leader keys), are kept in config/default.
2019-10-26 23:44:28 -04:00
Henrik Lissner
3d1569515b
emacs/vc: minor reformatting
And fix ;;;###package cookies. They aren't necessary for after! or
use-package! blocks.
2019-08-27 00:05:12 -04:00
Henrik Lissner
5b656ec56c
emacs/vc: refactor enforcement of git-commit conventions
To make it easier for users to customize.
2019-08-23 20:29:35 -04:00
Henrik Lissner
42869ece55
Remove git-timemachine-show-commit fix
The problem was fixed upstream.

See https://gitlab.com/pidu/git-timemachine/issues/77
2019-07-30 12:51:20 +02:00
Henrik Lissner
a89c004551
Refactor git-timemachine-show-commit fix (again) 2019-07-29 03:18:38 +02:00
Henrik Lissner
19ecf8e46a
Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +02:00
Henrik Lissner
aee1c851fc
Refactor git-timemachine-show-commit fix
As per https://gitlab.com/pidu/git-timemachine/issues/77
2019-07-28 02:32:25 +02:00
Henrik Lissner
82ae3a73f3
def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +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
c795a988e6
Conform many modules to new conventions 2019-07-23 12:30:47 +02:00
Henrik Lissner
96bff1076f
emacs/vc: bind gtc to git-timemachine-show-commit 2019-07-22 02:37:45 +02:00
Henrik Lissner
fdcb259bcd
Major refactor of Doom core files
- Remove core-os and move many of its settings out to other core
  libraries, where they belong
- Significantly improve commenting & compartmentalization of many
  settings
- Correct some mis-named public hooks (that were named as if they were
  private)
- Move the vast majority of optimizations to "Optimizations" section in
  core.el
- Don't activate xclip-mode or osx-clipboard-mode if we're accessing
  Emacs through an SSH connection (does more bad than good there)
- Add fast-but-imprecise-scrolling = t
- Set bidi-display-reordering = 'left-to-right, at the recommendation of
  an Emacs dev. Apparently setting it to nil is undefined, as Emacs is
  designed to always assume it's set; setting it explicitly to
  left-to-right will still do what was originally intended by turning it
  off: to reduce line/text scans for bidirectional text, which gives us
  a moderate boost in general runtime snappiness
- Set inhibit-compacting-fon-caches = t on windows (where it struggles
  especially with icon fonts)
- Disables "literal" mode for very large files (because I will be
  backporting so-long.el from Emacs 27 in the next commit)
2019-07-22 02:30:38 +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
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
ba71d95066
emacs/vc: add git-timemachine-show-commit fix
See https://gitlab.com/pidu/git-timemachine/issues/77
2019-07-18 13:13:31 +02:00
Henrik Lissner
47530bd19f
emacs/vc: refactor
And declare vc, vc-annotate & smerge-mode as built-ins (for
doom/help-packages).
2019-06-10 09:38:56 +02: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
b7bbf4d7ed
Add git-commit-mode to yas-extra-modes
Fixes snippets in git-commit-mode.
2018-08-01 19:26:20 +02:00
Henrik Lissner
cb7e471c90
General reformatting & comment revision/cleanup 2018-07-29 19:31:33 +02:00
Henrik Lissner
143fdd17e1
Use insert mode only if git commit is empty 2018-07-29 17:42:00 +02:00
Henrik Lissner
d094162d31
Refactor how git-timemachine loads magit-blame
Loading magit-blame immediately after git-timemachine is premature, only
one command uses magit-blame (git-timemachine-blame), so we defer it
until that command is called (also, it makes more sense to be in the
emacs/vc module, than tools/magit).
2018-07-29 17:42:00 +02:00
Henrik Lissner
d6461d495b
General & minor reformatting+refactor 2018-07-19 03:40:31 +02:00