Commit Graph

3186 Commits

Author SHA1 Message Date
a4cd5fafd8 Don't unbind keys when passed a label to :prefix
Fixes an issue where

  (map! :leader
        :prefix ("f" . "asdasdas")
        ...)

Would unbind SPC f before adding your new keybinds.
2019-01-03 02:26:11 -05:00
5e3d4c3ba2 Update map! tests for removal of :if 2019-01-02 16:06:39 -05:00
3923760c7c Adjust compile-time state in package helper macros 2019-01-02 14:11:02 -05:00
78ebec77ce Update packages after bin/doom upgrade 2019-01-02 13:56:13 -05:00
d3882f539c Remove :if from map!
It doesn't work as expected and would require too much work to support.
2019-01-02 13:18:19 -05:00
9628a74718 Fix disable-packages! macro
Now rolls out package! calls, rather than adjusting state directly.
2019-01-02 13:17:26 -05:00
81394cf733 Only prefer compiled theme on startup
...But not on doom/reload-theme or post-init load-theme calls.
2018-12-31 15:19:23 -05:00
6d10b9bbdf Revert to Meta, instead of Super
Using meta is a little more flexible. Since there is no dedicated meta
key on our keyboards (anymore), it can be remapped to another modifier
by changing mac-command-modifier, x-meta-keysym, etc. without
sacrificing super or alt keybinds.
2018-12-31 15:00:05 -05:00
e373052064 Restrict support to Emacs 25.3+ from now on
25.1-25.2 are no longer supported.
2018-12-28 15:22:52 -05:00
afee81dfde Fix define-leader-key! comment 2018-12-28 15:22:29 -05:00
f2d48a1764 Merge pull request #1066 from andresilva/fix-highlight-non-default-indentation
Fix highlight-non-default-indentation
2018-12-27 02:00:46 -05:00
63a224f0e8 Fix wrong which-key labels & leader key precedence
This changes how leader keys are bound, to fix an issue where the wrong
which-key label was assigned to the wrong keys, and cases where the
leader key was being shadowed by other minor mode mappings.

Unfortunately, this new method adds 10-20% to startup times. I'll
address this in a future patch. For now, correctness is more important.

Also fixes dashboard keybind detection.
2018-12-27 00:08:47 -05:00
cf5d7e3ba8 fix highlight-non-default-indentation 2018-12-26 11:54:18 +00:00
b7cfa90967 Update map! docstring
And remove all references to :alt-prefix
2018-12-26 00:55:39 -05:00
c0c84eb99b Fix M-SPC error with helm #1059
The global leader keybind was conflicting with a global M-SPC keybind in
helm-map. This keybind should only be set in non-evil sessions, so we
unset it if evil is found.
2018-12-25 03:56:24 -05:00
d337e255d3 Fix :leader/:localleader and :prefix
Due to issues with preset prefixes in general definers and nested
:prefix's supplied from a map! call not cooperating, many localleader
keybinds were broken and causing errors. For :leader/:localleader keys,
we now use :infix for sub-prefixes.

However, with this change, the :alt-prefix property has been removed, as
there is no simple way to support this without some major state
gymnastics in map!.

Fixes #1059
2018-12-25 02:29:29 -05:00
3f195614d9 Normalize :leader/:localleader keybinds
Evil states no longer apply to them. Also removes x-alt-keysym.
2018-12-23 23:54:27 -05:00
9936532ea3 Move auth-sources & mc/list-files
...to move appropriate locations.
2018-12-23 23:16:03 -05:00
5ad0b749a1 Refactor map! & tests
This resolves issues with :leader/:localleader keys not working when
evil states are specified. Evil states are now ignored. Also, some of
map!'s internals have been optimized to yield a ~10% improvement in
macro expansion time.
2018-12-23 23:12:10 -05:00
451c16b8ee Revise :after-call & :defer-incrementally comments
Now implicitly adds the current package to :defer-incrementally's list
of packages.
2018-12-23 00:25:51 -05:00
0efa915164 Fix :leader/:localleader targeting preceding keys
This fixes an issue where even the keys preceding :leader/:localleader
were registered as leader/localleader keys.
2018-12-23 00:10:18 -05:00
91474c98ee Fix localleader binds hijacking SPC in insert mode 2018-12-22 19:33:20 -05:00
5447927e6a Refactor map! tests 2018-12-22 19:30:00 -05:00
4383531b32 Ensure gerneral-implicit-kbd=t in map!
Also updates map! tests (TODO: abstract all those cdr-caddr's!)
2018-12-22 17:11:20 -05:00
a29163740d GIT_ASKPASS=git-gui--askpass for GUI Emacs+Windows 2018-12-22 17:00:06 -05:00
604a41527f Use general custom definers rather than :definer
The former approach was the cause for a huge increase in startup
time (adding ~0.4s) when :leader and :localleader were used. This is
because general-define-key was called for every key-def pair.

This new approach batches these calls, which has decreased the
performance impact by at least 80%.
2018-12-22 16:50:01 -05:00
a124497f4e find-file-visit-truename = t 2018-12-22 14:30:29 -05:00
4d3587c8d0 Fix void-variable list error in multi-state binds
Caused by overzealous re-setting of a variable in a loop, when it should
only be set once.
2018-12-22 05:20:43 -05:00
d6cb0ec5f5 General cleanup & minor refactoring 2018-12-22 04:25:15 -05:00
3dd34abe61 Remove hide-undefined-binds advice for which-key
Before general.el was introduced to Doom, commands were bound to keys
whether or not their containing modules were enabled. This was out of
laziness and readability. I intend to change this, as such it is no
longer necessary to hide unavailable keybinds from which-key.
2018-12-22 04:25:15 -05:00
674ad9837d Update after! docstring 2018-12-22 04:25:15 -05:00
4daa9271a0 Introduce general.el & rewrite map!
+ Now uses an overriding keymap for leader keys, so that it is always
  available, even outside of normal/visual states. In insert/emacs
  states, or in sessions where evil is absent, an alternative prefix is
  used for leader/localleader keys. See these variables:
  + doom-leader-prefix
  + doom-leader-alt-prefix
  + doom-localleader-prefix
  + doom-localleader-alt-prefix
+ Keybinds now support alternative prefixes through the new :alt-prefix
  property. This is useful for non-evil users and non-normal evil
  states. By default, this is M-SPC (leader) and M-SPC m (localleader).
+ Removed +evil-commands flag from config/default (moved to
  feature/evil/+commands.el).
+ config/default/+bindings.el has been split into
  config/default/+{evil,emacs}-bindings.el, which one is loaded depends
  on whether evil is present or not. The latter is blank, but will soon
  be populated with a keybinding scheme for non-evil users (perhaps
  inspired by #641).
+ The define-key! macro has been replaced; it is now an alias for
  general-def.
+ Added unmap! as an alias for general-unbind.
+ The following modifier key conventions are now enforced for
  consistency, across all OSes:
    alt/option      = meta
    windows/command = super
  It used to be
    alt/option      = alt
    windows/command = meta
  Many of the default keybinds have been updated to reflect this switch,
  but it is likely to affect personal meta/super keybinds!

The map! macro has also been rewritten to use general-define-key. Here
is what has been changed:

+ map! no longer works with characters, e.g. (map! ?x #'do-something) is
  no longer supported. Keys must be kbd-able strings like "C-c x" or
  vectors like [?C-c ?x].
+ The :map and :map* properties are now the same thing. If specified
  keymaps aren't defined when binding keys, it is automatically
  deferred.
+ The way you bind local keybinds has changed:

    ;; Don't do this
    (map! :l "a" #'func-a
          :l "b" #'func-b)
    ;; Do this
    (map! :map 'local "a" #'func-a
                      "b" #'func-b)

+ map! now supports the following new blocks:
  + (:if COND THEN-FORM ELSE-FORM...)
  + (:alt-prefix PREFIX KEYS...) -- this prefix will be used for
    non-normal evil states. Equivalent to :non-normal-prefix in general.
+ The way you declare a which-key label for a prefix key has changed:

    ;; before
    (map! :desc "label" :prefix "a" ...)
    ;; now
    (map! :prefix ("a" . "label") ...)

+ It used to be that map! supported binding a key to a key sequence,
  like so:

    (map! "a" [?x])  ; pressing a is like pressing x

  This functionality was removed *temporarily* while I figure out the
  implementation.

Addresses: #448, #814, #860
Mentioned in: #940
2018-12-22 04:14:43 -05:00
5e7a2d8703 Merge pull request #1038 from ztlevi/ranger
Adding Ranger module to doom
2018-12-13 15:04:37 -05:00
f4698d2f0a Fix uncaught errors during incremental load 2018-12-10 13:50:58 -05:00
eedbbdd9c1 emacs/dired: use all-the-icons font lock fix recipe 2018-12-08 21:52:24 -08:00
c56f802b4b Update (if|when)-let* alias comments 2018-12-06 17:45:53 -05:00
b5552eed39 Improve predicate fn for byte-compile targets
Will now avoid dotfiles and unit test files.
2018-12-06 17:45:53 -05:00
33f2d5d321 Upload load-order in doom!'s docstring 2018-12-05 22:11:54 -05:00
7b761a9b42 Refactor feature deferral for (common|emacs)-lisp
'lisp-mode is now deferred, to make it easier to lazy-configure it
2018-12-05 22:11:54 -05:00
f003d2b4fe Merge pull request #1032 from mfiano/develop
Various changes
2018-12-05 18:59:42 -05:00
fe8b17d6da move projectile fd out of magit.el
lol
2018-12-04 20:09:44 +11:00
9c96a2bab7 Fix: Prevent projectile from deleting important buffers 2018-12-02 02:02:56 -05:00
f43e64e505 Add ns-auto-titlebar package for MacOS
This fixes mismatching frame title and frame coloring, as well as
auto-sets the ns-appearance parameter depending on your theme.
2018-10-25 13:42:20 -04:00
847983e278 Fix bin/doom hanging after generating autoloads
Emacs occasionally hangs when polling for the emacs server (with
server-running-p). Since this is used for such a trivial feature (to
decide whether or not to display the "you need to restart" message), I
removed it. Now it always shows that message (if the autoload files have
changed).
2018-10-19 12:07:17 -04:00
56d7f70b2f Make all-the-icons return empty string in tty #941 2018-10-16 23:50:46 -04:00
63e25b349d Silence undo-tree a little less destructively
undo-tree-load-history was formerly advised with doom*shut-up, which
uses the quiet! macro to suppress output. quiet! accomplishes this by
temporarily redefining message to a no-op function. However, if a fatal
error occurs while this binding is active, in some cases, message will
remain redefined, perpetually silencing all output to the minibuffer.

This tries to mitigate that, at least where undo-tree is concerned.

Also sharp-quotes an unquoted function.
2018-10-16 02:51:11 -04:00
e9608ab939 doom-project-find-file: unset projectile-project-root
Instead of setting it default-directory, which can cause symlink
resolution issues.
2018-10-14 23:59:26 -04:00
0ebf526e01 Fix doom/info omitting first module in each category
Discovered in #941
2018-10-12 14:07:25 -04:00
d21887149f Minor refactor/reformatting 2018-10-06 20:44:25 -04:00
9a17c909c9 Don't always create dummy files on doom quickstart
Only when DOOMDIR doesn't exist.
2018-10-06 20:44:25 -04:00