Commit Graph

155 Commits

Author SHA1 Message Date
1081095a64 Initialize dashboard later on doom-init-ui-hook 2019-03-15 16:26:48 +10:00
de2d681567 Initialize dashboard on doom-init-ui-hook 2019-03-15 01:36:57 -04:00
910bfc41cc Initialize dashboard later in window-setup-hook
Since bb3f027c moved `projectile-mode` into `doom-init-ui-hook`,
projectile was getting initialized after the dashboard.  This means for
non-evil users, the `C-c p p` binding is not shown, because it's not yet
loaded.
2019-03-15 13:51:22 +10:00
54d1c0dd56 Minor, general refactors 2019-03-09 03:42:55 -05:00
a05b1877be Rewrite switch-{buffer,window} hooks
+ Add doom-switch-frame-hook
+ Replace doom-{enter,exit}-{buffer,window}-hook with
  doom-switch-{buffer,window}-hook
+ New switch-buffer hooks run on buffer-list-update-hook rather than
  in select-window advice.
+ Blank our buffer-list-update-hook in some places to reduce how many
  times it gets triggered.
2019-03-08 02:37:33 -05:00
d46bb287ae General refactor of Doom core
- Code reduction and refactor across the board (cull unneeded minor
  advise, hooks and hacks or update them)
- Revise outdated comments and docstrings
- Reorganize core autoload libraries
- Remove large file check (Emacs already has a built-in one, which we
  augment to be even more performant when it does kick in)
- helpful.el can now be disabled completely through package!
2019-03-02 01:34:19 -05:00
8a90f29c91 Make session persistence module agnostic
They've been removed from feature/workspaces and moved into
core/autoload/sessions, which falls back to desktop.el if persp-mode
isn't present. This also offers a substantial speed up to
restart+restoring and restoring sessions in general.

Also fixes #1210, where the newly spawned frame after doom/restart
wasn't focused.

Introduces the following commands:

- doom/restart
- doom/restart-and-restore
- doom/quickload-session
- doom/quicksave-session
- doom/load-session
- doom/save-session
- +workspace/restore-last-session (alias for doom/quickload-session)

And removes

- +workspace/load-session
- +workspace/save-session
- +workspace/load-last-session (renamed to +workspace/restore-last-session)
- +workspace/restart-emacs-then-restore (replaced by doom/restart-and-restore)
- :ss (ex command)
- :sl (ex command)
2019-03-02 01:34:19 -05:00
735ec58b36 ui/doom-dashboard: show command at point in echo-area 2019-03-02 01:34:15 -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
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
5a442932d7 ui/doom-dashboard: reload dashboard in daemon frames
Fixes an issue where creating a graphical frame from the daemon can
cause the non-GUI version of the dashboard to show.
2018-10-17 14:49:35 -04:00
0bb06f052e Fix dashboard hiding files opened via emacsclient 2018-10-13 13:28:13 -04:00
cc1c28a27c Fix dual windows when opening files via terminal #850 2018-09-20 15:01:28 -04:00
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
50fdaa0ed5 Silence "unbound key" spam on mouse-1 in dashboard 2018-09-09 09:58:19 -04:00
469aa81570 Forward-require dependencies in tests
Easier to see at a glance what the test's dependencies are.
2018-08-26 00:20:16 +02:00
ee73d6c9af Minor reformatting & comment tweaks 2018-08-21 03:34:39 +02:00
6ab9cf6460 Switch org-agenda-list for org-agenda on dashboard 2018-08-17 04:10:11 +02:00
e33cb446aa Refactor dashboard banner display & centering 2018-08-10 12:34:17 +02:00
923093b263 Don't set buffer-read-only in +doom-dashboard-mode
This is already set by the parent mode, special-mode.
2018-07-29 19:31:33 +02:00
043dc4e875 Update dashboard on +doom-dashboard/open 2018-07-10 17:46:31 +02:00
1a068f82f1 Add +workspace/load-last-session
And fix the load last session button on dashboard.
2018-07-07 11:41:24 +02:00
c38d324663 Make banner customizable
Add banner-file and banner-dir variables. If banner-file is nil, use
ASCII banner.
2018-07-05 14:33:48 +02:00
b67745a9b6 Don't show "Open user manual" button
...unless the manual exists (it will soon)!
2018-07-05 12:37:05 +02:00
3a1ba5381e Use +default/find-in-config instead on dashboard
Instead of browse-config.
2018-07-05 12:36:32 +02:00
1fa4c65c3a ui/doom-dashboard: minor refactor 2018-07-05 01:32:04 +02:00
f949df5646 Reformat ui/doom-dashboard tests 2018-07-04 23:14:31 +02:00
ebd4d19fa4 Fix +doom-dashboard-p 2018-07-04 23:14:12 +02:00
c55d6dad17 Reduce coupling with buffers library and dashboard 2018-07-04 23:06:47 +02:00
0b1cb1bb48 Look up command binds dynamically in dashboard
Keys are no longer hard coded.

cc @UndeadKernel
2018-07-04 23:05:49 +02:00
ee4060ab80 Add image banner display logic to dashboard
But disabled by default (until the logo is ready).
2018-07-04 16:20:02 +02:00
e37e6fc25c Fix invalid face: quote errors in dashboard 2018-07-04 15:33:15 +02:00
00e23db0b0 Fix workspace restore/load workspace keybinds
As well as keybind on dashboard.
2018-07-04 13:40:44 +02:00
1d4a41833e Don't wrap forward/backward-button keys 2018-07-03 20:07:14 +02:00
d0eaa0af1e Redesign dashboard widgets 2018-07-03 20:07:14 +02:00
81ffed520b Rename doom-before-switch-*-hook hooks
+ doom-before-switch-buffer-hook => doom-exit-buffer-hook
+ doom-before-switch-window-hook => doom-exit-window-hook
+ doom-after-switch-buffer-hook => doom-enter-buffer-hook
+ doom-after-switch-window-hook => doom-enter-window-hook

Shorter, easier-to-type names that better describe their intended
purpose.

The old names are still usable, but deprecated.
2018-07-03 03:41:08 +02:00
15f2e21468 On second thought...
Causes char-table-p errors in some cases.

Setting hscroll-margin = 0 in dashboard accomplishes the same thing, by
preventing truncation glyphs from ever appearing anyway.
2018-06-30 02:58:01 +02:00
a4121f33c0 Revert "Require project root in dashboard buffer #733"
This reverts commit 2dac739ce7.

Causes breaking "Not in project" errors at startup in certain daemon
workflows.
2018-06-29 00:56:04 +02:00
2dac739ce7 Require project root in dashboard buffer #733
Require default-directory to be in a valid project for project commands
to work. This will prevent hangs when accidentally invoking
projectile-find-file from $HOME.
2018-06-28 20:15:50 +02:00
205cc718d2 Fix dashboard not appearing in daemon frames
Because they start in the *server* buffer, instead of the *scratch*
buffer.
2018-06-19 17:44:24 +02:00
486019d853 Remove leading space in dashboard buffer's name
The leading space indicates a temporary buffer. The dashboard is no such
thing!
2018-06-16 21:01:16 +02:00
08986d9101 Simplify dashboard initial buffer check
We only need to check if we're in the scratch buffer. doom-real-buffer-p
is overkill for that.

This also reduces file loads at startup for autoloaded functions added
to the doom-real-buffer-functions and doom-unreal-buffer-functions.
2018-06-16 21:00:37 +02:00
eaca8c58fa Move unit tests from ert to buttercup
Easier to organize and write. Now I can hopefully strive for better
coverage!
2018-06-15 03:42:01 +02:00
e71cd93488 Don't change which-key settings in doom dashboard 2018-06-03 17:22:23 +02:00
1e81a35461 Minimize dependence on map!
This is in preparation for general.el integration coming in 2.1.1. It is
very likely that map! will change (and even more, be split into several
macros). Not much, but change none-the-less. Specifically, the state
keywords (e.g. :nvi, :n, :i) will be removed in favor of a :state
property that takes a list, e.g. (normal visual insert).

In any case, both map! and general are also relatively expensive
compared to define-key and evil-define-key* (and the new define-key!
macro), so use that when we can.

This also means changes to either API won't affect Doom's modules in the
long term.
2018-06-03 15:46:00 +02:00
01b07e573e Fix visual j/k in dashboard and evil-mode
In case you've remapped j/k to gj/gk universally.
2018-06-03 12:04:42 +02:00
e66abfb9e8 Use newline-based alignment technique on dashboard
Fixes #645, because Emacs' mouse events don't appear to compensate for
variable-width whitespace.
2018-06-02 10:48:55 +02:00
2f83757018 ui/doom-dashboard: more robust feature detection
In case you aren't using those modules, but have other means of loading
those packages.
2018-05-25 00:54:07 +02:00
09cb4f6716 Major refactor & optimization of how modules load their packages
Now that we are loading package autoloads files (as part of the
generated doom-package-autoload-file when running make autoloads), many
:commands properties are redundant. In fact, many def-package! blocks
are redundant.

In some cases, we can do without a config.el file entirely, and can move
into the autoloads file or rely entirely on package autoloads.

Also, many settings have been moved in their module's autoloads files,
which makes them available ASAP; their use no longer depends on module
load order.

This gained me a modest ~10% boost in startup speed.
2018-05-25 00:46:16 +02:00
06c22a5af2 ui/doom-dashboard: add vertical centering (experimental) 2018-05-15 21:49:50 +02:00