Commit graph

145 commits

Author SHA1 Message Date
Henrik Lissner
b0438f1589 fix: wrong-type-arg error on startup
Regression caused by change to doom-enlist in b35b32273.

Amend: b35b32273a
2021-10-20 22:06:25 +02:00
Henrik Lissner
f5c1332a31 refactor: minor refactors & nit picks across core 2021-10-10 18:36:46 +02:00
Henrik Lissner
8862f8694c Activate general-auto-unbind-keys post-startup
To prevent "X starts with non-prefix key Y" errors except at startup.
2021-07-13 14:34:30 -04:00
John Grey
37df4b4ff4 define-localleader-key's featurep -> featurep! 2021-05-22 02:35:10 +01:00
Henrik Lissner
6fdaaf3ae6 Revert 3b0f23792 "Distinguish C-m from RET"
Unpredictably hijacks C-m in some cases, which is unacceptable. A better
solution is needed.
2021-05-17 22:33:22 -04:00
Henrik Lissner
b237de5619 Fix <C-m> shadowing keypad return 2021-05-17 18:40:59 -04:00
Henrik Lissner
3b0f23792d Distinguish C-m from RET
But you must bind keys to "<C-m>" or [C-m] to target it.
2021-05-16 14:44:53 -04:00
Henrik Lissner
1274de3d34 Minor reformatting & refactors across the board 2021-02-25 13:59:43 -05:00
Henrik Lissner
8c258c272d
Update comments 2021-01-11 02:41:14 -05:00
Henrik Lissner
a567834ff8
Fix #4457: broken key sequences ending with C-i 2021-01-03 22:40:06 -05:00
Henrik Lissner
04b29c70d2
doom/escape: change this-command only if interactive 2020-12-13 19:48:32 -05:00
Henrik Lissner
5d3496575c
Fix #4421: masquerade doom/escape as keyboard-quit
Or abort-recursive-edit, depending. Some other packages/commands listen
for these two (like undo-fu), and by remapping C-g we break those.
2020-12-12 22:54:48 -05:00
Henrik Lissner
96d7e50f3e
Distinguish <C-i> from "C-i" 2020-12-11 15:50:02 -05:00
Henrik Lissner
d88e0795b6
Allow eldoc after doom/escape or evil state change 2020-12-02 17:58:10 -05:00
Henrik Lissner
ed1996e6f9
Reformat map! docstring
Mention correct placement of state keyword.
2020-11-14 14:02:07 -05:00
Henrik Lissner
86722ee67e
Minor refactors & reformatting 2020-11-03 16:16:12 -05:00
Henrik Lissner
61ec1d9698
mac-right-option-modifier = none
Then right option can be used for special symbols and left option can be
used as meta.
2020-10-29 02:36:59 -04:00
Henrik Lissner
fd6984f2e7
Sort which-key labels alphabetically
Fixes #4177
2020-10-29 01:42:04 -04:00
Henrik Lissner
390594442a
Reset which-key replacements on doom/reload
Prevents build-up of which-key entries.

See justbur/emacs-which-key#226
2020-10-16 22:30:07 -04:00
Henrik Lissner
d9683d1148
Fix #4074: map! with meta/hyper modifier prefixes 2020-10-11 20:31:46 -04:00
Henrik Lissner
4bc70a8537
ns-right-option-modifier = none
So the right option key can still be used to insert symbols on macOS.
2020-08-18 20:32:34 -04:00
Henrik Lissner
85b5103cd9
Fix #3717: command = super, option = meta 2020-08-10 19:36:05 -04:00
Henrik Lissner
8bf902d5f4
General refactors & reformatting across the board 2020-06-04 20:13:28 -04:00
Henrik Lissner
0e851ace9b
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.

Fixes #2802, #2737, #2386

The big highlights are:

- Fix #2802: We now update recipe repos *before* updating/installing any
  new packages. No more "Could not find package X in recipe repositories".

- Fix #2737: An edge case where straight couldn't reach a pinned
  commit (particularly with agda).

- Doom is now smarter about what option it recommends when straight
  prompts you to make a choice.

- Introduces a new init path for Doom. The old way:
  - Launch in "minimal" CLI mode in non-interactive sessions
  - Launch a "full" interactive mode otherwise.
  The new way
  - Launch in "minimal" CLI mode *only* for bin/doom
  - Launch is a simple mode for non-interactive sessions that still need
    access to your interactive config (like async org export/babel).
  - Launch a "full" interactive mode otherwise.

  This should fix compatibility issues with plugins that use the
  async.el library or spawn child Emacs processes to fake
  parallelization (like org's async export and babel functionality).

- Your private init.el is now loaded more reliably when running any
  bin/doom command. This gives you an opportunity to configure its
  settings.

- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
  deferred activation of a number of packages. Users can remove these
  modes from these hooks; altogether preventing them from loading,
  rather than waiting for them to load to then disable them,
  e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
  'doom-first-buffer #'smartparens-global-mode)

  Hooks added to doom-first-*-hook variables will be removed once they
  run.

  This should also indirectly fix #2386, by preventing interactive modes
  from running in non-interactive session.

- Added `doom/bump-*` commands to make bumping modules and packages
  easier, and `doom/bumpify-*` commands for converting package!
  statements into user/repo@sha1hash format for bump commits.

- straight.el is now commit-pinned, like all other packages. We also
  more reliably install straight.el by cloning it ourselves, rather than
  relying on its bootstrap.el.

  This should prevent infinite "straight has diverged from master"
  prompts whenever we change branches (though, you might have to put up
  with it one more after this update -- see #2937 for workaround).

All the other minor changes:

- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
  simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
  already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
  trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
  doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
  1. Child instances will no longer inherit the process environment of
     the host instance,
  2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-15 01:33:52 -04:00
Henrik Lissner
500e078e12
Map windows key to super 2020-05-14 02:07:25 -04:00
Henrik Lissner
f83499c7a7
Revert 63ab88105
With this fix we're forced to rebind all C-i keybinds plugins bind. This
is too much of a maintenance nightmare. This "fix" doesn't really fix
anything really, so users can reinstate it themselves, if they prefer
it.

Relevant to #3090
2020-05-13 14:41:57 -04:00
Henrik Lissner
63ab88105f
Fix #3090: distinguish C-i from TAB 2020-05-11 16:22:15 -04:00
Henrik Lissner
eb381ce2bd
Remove custom indent functions for map! properties
Now that we have a634e2c81
2020-04-30 20:33:46 -04:00
Henrik Lissner
efee633311
Reduce wasteful after! blocks in map! expansion
When there are no labels, it produces empty after! forms, which do
nothing.
2020-04-25 00:48:20 -04:00
Henrik Lissner
916ef0fbbe
Rename unmap! to undefine-key!
unmap! gives the false impression that it is related or similar to map!,
but it isn't.
2020-04-23 23:56:17 -04:00
Henrik Lissner
c360f0dceb
Minor refactor & comment/docstring revision 2019-10-26 23:44:28 -04:00
Maximiliano
dea5d84069 Add more api demos (#1845)
* Added function Demos
* Added use-package demos
* Some corrections
* Fix duplicated use-package! type
2019-10-03 14:51:08 -04:00
Henrik Lissner
6c4f4a9d9d
Mac users: command = super, option = meta
Apparently these have different defaults on emacs-mac, so we set these
to keep them consistent.
2019-09-05 13:11:22 -04:00
Henrik Lissner
1cd219dfa7
Update the docstring for leader/localleader vars
They should be set in your private config.el, not init.el.
2019-08-19 21:04:54 -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
e6201ca952
Add :if, :when, :unless & :cond support to doom! macro
Now you can conditionally enable/disable modules.
2019-07-26 12:05:13 +02:00
Henrik Lissner
003febd54c
Refactor doom--define-leader-key helper
And mark it as a hack, which it is, Mr. Anderson.
2019-07-23 18:14:49 +02:00
Henrik Lissner
876bed4813
Remove deprecated :map* & :keymap from map! macro
These have been deprecated for some time. They are all aliases for :map.
2019-07-23 17:35: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
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
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
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
abfc8ced21
Add warning re :prefix-map in map! docstring
It really shouldn't be used outside of Doom proper; it has the
capability of destroying other :prefix-map's due to variable/keymap
naming collisions.
2019-07-07 02:00:36 +02:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Henrik Lissner
1e357310c4
Fix localleader alt key in insert mode 2019-06-26 14:28:40 +02:00
Henrik Lissner
7c33d2c2e0
Fix C-c & C-x when used as leader keys 2019-05-20 21:09:11 -04:00
Henrik Lissner
448d5fc71f
map!: fix :prefix-map for non-leader keys
Would no-op if used on a non-leader key.
2019-05-20 21:09:10 -04:00
Henrik Lissner
32f8fa9f46
Fix :prefix-map indentation in map! calls 2019-05-17 13:31:05 -04:00
Henrik Lissner
b7d1702484
Add :prefix-map to map! macro
Each prefix now defines a doom-leader-DESC-map keymap, where DESC is the
which-key description for that prefix key. This should make it easier
for users to move leader prefixes. e.g.

To move SPC TAB (workspaces) to SPC l:

  (map! :leader
        "TAB" nil
        "l" doom-leader-workspaces-map)
2019-05-13 22:30:21 -04:00