Commit Graph

3007 Commits

Author SHA1 Message Date
Henrik Lissner
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
Henrik Lissner
674ad9837d
Update after! docstring 2018-12-22 04:25:15 -05:00
Henrik Lissner
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
Henrik Lissner
5e7a2d8703
Merge pull request #1038 from ztlevi/ranger
Adding Ranger module to doom
2018-12-13 15:04:37 -05:00
Henrik Lissner
f4698d2f0a
Fix uncaught errors during incremental load 2018-12-10 13:50:58 -05:00
Ting Zhou
eedbbdd9c1 emacs/dired: use all-the-icons font lock fix recipe 2018-12-08 21:52:24 -08:00
Henrik Lissner
c56f802b4b
Update (if|when)-let* alias comments 2018-12-06 17:45:53 -05:00
Henrik Lissner
b5552eed39
Improve predicate fn for byte-compile targets
Will now avoid dotfiles and unit test files.
2018-12-06 17:45:53 -05:00
Henrik Lissner
33f2d5d321 Upload load-order in doom!'s docstring 2018-12-05 22:11:54 -05:00
Henrik Lissner
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
Henrik Lissner
f003d2b4fe
Merge pull request #1032 from mfiano/develop
Various changes
2018-12-05 18:59:42 -05:00
Aria
fe8b17d6da move projectile fd out of magit.el
lol
2018-12-04 20:09:44 +11:00
Michael Fiano
9c96a2bab7 Fix: Prevent projectile from deleting important buffers 2018-12-02 02:02:56 -05:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
56d7f70b2f
Make all-the-icons return empty string in tty #941 2018-10-16 23:50:46 -04:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
0ebf526e01
Fix doom/info omitting first module in each category
Discovered in #941
2018-10-12 14:07:25 -04:00
Henrik Lissner
d21887149f
Minor refactor/reformatting 2018-10-06 20:44:25 -04:00
Henrik Lissner
9a17c909c9
Don't always create dummy files on doom quickstart
Only when DOOMDIR doesn't exist.
2018-10-06 20:44:25 -04:00
Henrik Lissner
5d3bada86e
Don't byte-compile xdg-path in doom-private-dir
The danger of a stale value post-byte-compilation far outweighs the
benefits.
2018-10-06 20:44:25 -04:00
Edwin Török
cd314a1188 fix setq-hook error path
In setq-hook!:
core-lib.el:280:41:Warning: ‘listp’ called with 2 args, but requires 1

Signed-off-by: Edwin Török <edwin@etorok.net>
2018-10-04 00:38:05 +01:00
Edwin Török
7795da4800 Fix doom-serif-font and doom-variable-pitch-font: they need to be set for current frame too
On Emacs 26.1 these two font settings had no effect on the main frame.

Signed-off-by: Edwin Török <edwin@etorok.net>
2018-10-03 23:03:11 +01:00
Henrik Lissner
5b4690419b
Increase doom-large-file-size threshold to 2mb
1mb is a little *too* conservative.
2018-10-03 15:10:08 -04:00
Henrik Lissner
48f7d33c03
Don't doom|check-large-file on tags files
Fixes an issue where reading TAGS files could cause "%s is a large file,
open literally to avoid performance issues?" prompts every time you open
a project file, if the tags file was larger than `doom-large-file-size'
2018-10-03 15:08:25 -04:00
Henrik Lissner
fe425c005e
Add g-/g= keys for buffer narrowing/widening 2018-10-03 11:14:08 -04:00
Henrik Lissner
6368ef9ba0
Add docstrings to fix hooks 2018-10-01 20:29:43 -04:00
Henrik Lissner
e85aaabed9
Rewrite bin/doom quickstart
Now creates a packages.el file as well, with some commented examples,
and includes comment headers for config.el and packages.el.
2018-09-30 22:49:23 -04:00
Henrik Lissner
fd19698927
doom|hack-local-variables => MODE-local-vars-hook
Uses a less destructive method (the same that Spacemacs uses) than the
one introduced in 13cee68, by introducing MODE-local-vars-hook hooks,
which run after local vars have been initialized.

The old method was to call `hack-local-variables` *before* mode hooks
run, however, this causes variables set by modes to have higher
precedence than local vars, which is unacceptable.

Also moved intero-mode & dante-mode to haskell-mode-local-vars-hook
2018-09-29 15:01:35 -04:00
Henrik Lissner
e7fc1d3290
Fix wrong-type-arg: stringp, nocache errors
Fix old usage of doom-project-name and doom-project-root.
2018-09-28 23:49:18 -04:00
Henrik Lissner
cae5009925
cl-remove-if -> cl-delete-if
Minor optimization for doom-load-packages-incrementally (cl-delete-if
deletes in-place).
2018-09-28 22:50:39 -04:00
Henrik Lissner
f994fb07bf
bin/doom: make invalid command a user-error
It shouldn't invoke error handlers.
2018-09-28 22:29:42 -04:00
Henrik Lissner
2908112dc4
Update doom-project-root test 2018-09-28 21:25:32 -04:00
Henrik Lissner
13cee6870e hack-local-variables before mode hooks
The default behavior is to read file+directory-local variables after the
major mode and its hooks have run. I think this is backwards. What if we
want to use these local variables to customize the things running in
hooks?

This does mean hack-local-variables will run at least twice when the
mode changes, but this is an acceptable compromise.
2018-09-28 21:13:28 -04:00
Henrik Lissner
05d759fa8b doom/window-{enlargen,zoom}: assoc -> assq
A minor optimization. assq is significantly faster than assoc (not that
it matters for this incredibly insignificant use-case, but yay for
premature optimization!)
2018-09-28 21:13:28 -04:00
Henrik Lissner
461fc8e312 Refactor doom-big-font-mode
Complain if doom-font or doom-big-font aren't set.
2018-09-28 21:13:27 -04:00
Henrik Lissner
6da307d30e Refactor font initialization
+ Add doom-serif-font variable
+ Update docstrings of all doom-*font variables to mention that they all
  support font-specs, font objects, XFT strings and XLFD strings.
+ Set doom-font if the user hasn't, ensuring that other functions know
  what the current, default font is set to (fixes doom-big-font-mode not
  switching back to normal when disabled).
2018-09-28 21:13:27 -04:00
Henrik Lissner
1785adb068 projectile-require-project-root = t
Now that projectile-project-root has changed not throw errors (depending
on projectile-require-project-root), it is safe to change this, in case
you use other projectile commands that do require a project.
2018-09-28 21:13:27 -04:00
Henrik Lissner
53fe7a1f04 Refactor Project API to reflect changes upstream
projectile-project-root no longer returns `default-directory` if not in
a project (it returns nil). As such, doom-project-* functions (and their
uses) have been refactored.

+ doom-project-p & doom-project-root are aliases for
  projectile-project-p & projectile-project-root.
+ doom-project-{p,root,name,expand} now has a DIR argument (for
  consistency, since projectile-project-name and
  projectile-project-expand do not).
+ The nocache parameter is no longer necessary, as projectile's caching
  behavior is now more sane.
+ Removed some projectile advice/hacks that are no longer necessary.
+ Updated unit tests
2018-09-28 21:13:27 -04:00
Henrik Lissner
3961ba1662 Fix command-log-mode not disabling on toggle
clm/toggle-command-log-buffer enables global-command-log-mode, but
doesn't disable it on second invocation, so we use
global-command-log-mode instead.
2018-09-28 21:13:27 -04:00
Henrik Lissner
ddaf1e5b67 Fix wrong-type-arg error on menu-bar-open
Due to malformed menu-bar-lines frame property. Same for tool-bar-lines
as well.
2018-09-28 21:13:27 -04:00
Henrik Lissner
15991b5639 Refactor quiet! to be less destructive
It's possible for the debugger to be invoked from inside code wrapped in
a (quiet! ...) call. The debugger pauses Emacs in a broken state where
the functions locally rebound by quiet! (e.g. message, load-file,
write-region, etc) are never returned to their original definitions.

This attempts to reduce that probabilityby changing how quiet! silences
code. Rather than silencing them completely, they will be logged
to *Messages* but not displayed in the echo area.

Also, quiet! is now used less, where it isn't strictly needed (or where
inhibit-message is sufficient).
2018-09-28 21:13:27 -04:00
Henrik Lissner
8a8b5c6089 Refactor bin/doom & doom-dispatch
Done to make bin/doom produce better debugger output (and more readily).
A lot of bin/doom errors aren't recurring, so it's better to produce the
full error report ASAP.
2018-09-28 21:13:27 -04:00
Henrik Lissner
4ea4754162 Add commands for using bin/doom from inside Emacs
This is experimental. I'd eventually like users to be able to management
Doom from inside Emacs, if they desire. This may be the only way to have
a decent user experience on Windows, for that matter.

Also adds a popup rule for it.
2018-09-28 21:13:27 -04:00
Henrik Lissner
078e3028a6 Minor, general comment revision 2018-09-28 21:02:59 -04:00
Henrik Lissner
4bdd6002a4
Restore projectile-project-root's old behavior
For now...
2018-09-27 21:55:19 -04:00
Henrik Lissner
9afc61e57e
Refactor & optimize doom! + module API 2018-09-25 23:52:20 -04:00
Henrik Lissner
aa930256b8
Update doom/reload-project for changes upstream
In projectile.
2018-09-25 23:36:54 -04:00
Henrik Lissner
377dbae3fc
Install/compile packages in order of declaration
This should fix an issue where a package A, which uses macros from a
package B, is installed before package B, causing void-function errors.

The currently known and affected packages are neotree, parinfer, and
evil-collection.
2018-09-25 11:00:30 -04:00