Commit graph

76 commits

Author SHA1 Message Date
Henrik Lissner
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
Henrik Lissner
f058505306
New bin/doom (eventual replacement for make)
This commit adds bin/doom, which acts as the middle man that make once
was (and will stay for a while, though the documentation will shift away
from using it). It does everything the previous make interface did, but
is faster and more flexible. bin/doom should eventually replace the
makefile.

bin/doom also makes it easier to run Doom outside of ~/.emacs.d and
~/.doom.d with, for example:

  bin/doom run -p ~/.other.doom.d/ -e ~/.other.emacs.d

bin/doom.cmd is included for Windows users, but I don't recommend using
it yet. It hasn't been tested nor have I ever written a batch script
before.

Also update init.example.el with new defaults.
2018-05-21 01:38:17 +02:00
Henrik Lissner
0bd88b8414
Add restart-emacs package & commands 2018-05-14 13:05:03 +02:00
Henrik Lissner
a5877139cd
feature/workspaces: persp-mode integration for eshell, compile & magit-status 2018-04-21 21:04:34 -04:00
Henrik Lissner
484cba1b1b
feature/workspaces: unselect side-windows when switching workspaces #499 2018-04-08 18:14:07 -04:00
Henrik Lissner
a2ab9e739c
feature/workspaces: minor refactor 2018-03-22 06:30:49 -04:00
Henrik Lissner
d5683ba681
feature/workspaces: fix recursive load errors on 25.x #470
+workspaces|protect-buffers-in-other-persps was unnecessary, in any
case.
2018-03-22 06:26:42 -04:00
Henrik Lissner
d84222b6d0
feature/workspaces: use new switch-buffer hooks 2018-03-14 18:31:48 -04:00
Henrik Lissner
a17fc86761
feature/workspaces: fix buffer getting killed across workspaces 2018-03-12 13:33:50 -04:00
Henrik Lissner
e659ab0609
feature/workspaces: refactor switch-project integration 2018-02-20 17:56:38 -05:00
Henrik Lissner
1db29a951e
feature/workspaces: fix counsel-projectile-switch-project actions 2018-02-06 13:50:26 -05:00
Henrik Lissner
3830a8aba1
feature/workspaces: fix infinite recursion in buffer-predicate #399
By refactoring so that the middle-man buffer predicate wasn't necessary.
2018-02-03 18:06:47 -05:00
Henrik Lissner
cbd6bf190a
feature/workspaces: minor refactor 2018-02-02 20:47:33 -05:00
Henrik Lissner
d9a80a9520
feature/workspaces: fix buffer-bleedover from other workspaces
The frame buffer-predicate wasn't discriminating against buffers that
were in other perspectives, allowing you to `next-buffer` into them.
UNACCEPTABLE.
2018-02-02 20:47:33 -05:00
Henrik Lissner
2989296521
Use frame's buffer-predicate instead of doom/{next,previous}-buffer
doom/{next,previous}-buffer was implemented so that these commands could
skip over unreal buffers, and land us on either a real one or the
dashboard. Using the frame's buffer-predicate parameter accomplishes
exactly this, natively.
2018-02-01 19:58:43 -05:00
Henrik Lissner
dc2b905933
feature/workspace: don't pop up warnings/display tabs on every new frame 2018-01-31 02:16:02 -05:00
Henrik Lissner
81bba9c0bc
feature/workspace: fix frames incorrectly initialized via emacsclient
A new workspace is now correctly created for files opened via
emacsclient. This fixes #119. Again.
2018-01-31 01:13:59 -05:00
Henrik Lissner
834e92c465
feature/workspaces: fix hash-table-p error on startup in daemon Emacs
Because persp-mode initializes differently (and later) in daemon/noninteractive
Emacs, +workspaces|init would fail while trying to use persp-mode features in a
broken state.
2018-01-30 16:17:53 -05:00
Henrik Lissner
22f4404210
feature/workspace: improve daemon/frame compatibility
This update fixes issues with frame-local perspectives, and ensures that
a workspace is always selected in a daemon session's frames.
2018-01-28 20:32:10 -05:00
Henrik Lissner
83b04b4f14
feature/workspace: associate emacsclient frames with workspace too 2018-01-28 18:26:32 -05:00
Henrik Lissner
3578d433c2
Integrate counsel-projectile-switch-project & restore file prompt when switching projects 2018-01-28 03:34:18 -05:00
Henrik Lissner
381a4416ed
feature/workspaces: major refactor & various fixes
+ Rewrite projectile integration.
+ Fix per-frame workspaces not cleaning up after itself when an
  frame-associated workspace (or its frame) is destroyed.
+ Alias +workspace-p to perspective-p instead of persp-p (which isn't as
  accurate, because it counts nil as a valid perspective).
+ Extract orphaned-buffer list functionality in +workspace-buffer-list
  into seperate function: +workspace-orphaned-buffer-list.
+ Allow toggle-debug-on-error to catch workspace errors.
+ Remove +workspace/kill-session-and-quit (never used)
+ Ensure persp-mode is loaded as late as possible.
2018-01-20 15:38:59 -05:00
Henrik Lissner
25619908a2
Narrow down the purpose of init & post-init hooks
Essential hooks should be added to doom-init-hook. Non-essential and
extra hooks should be added to doom-psot-init-hook.
2018-01-07 00:15:58 -05:00
Henrik Lissner
0c3484414c
Fix dashboard replacing warnings buffer in popup at startup
It makes the dashboard screen a mess!
2018-01-07 00:15:57 -05:00
Henrik Lissner
b28f6ed477
General minor refactor & comment revision 2018-01-06 03:03:02 -05:00
Henrik Lissner
b3b31e4bd4
Display *Warnings* buffer in main workspace after startup #319
The creation of the main workspace would swallow the Warnings buffer, so
we forcibly display it (if it exists) on startup.
2018-01-04 16:58:21 -05:00
Henrik Lissner
f3562eb038
feature/workspaces: refactor persp-mode init 2018-01-04 03:01:35 -05:00
Henrik Lissner
9f884bf998
Move delayed-warnings deferral to core.el
Possibly addresses #319
2018-01-03 12:54:30 -05:00
Henrik Lissner
b6eec664bb
Fix new workspace when switching projects #314 2017-12-30 01:18:41 -05:00
Henrik Lissner
c9fe2de236
Ensure persp-kill-buffer-query-function is last in hook 2017-12-29 01:48:55 -05:00
Henrik Lissner
73333784f8
completion/ivy: fix cyclical-load errors when compiling 2017-12-17 00:03:45 -05:00
Henrik Lissner
27b1a9c3c6
+workspaces*auto-add-buffer: redisplay => force-mode-line-update 2017-12-10 17:00:29 -05:00
Henrik Lissner
f8e8dbad8f
General minor refactor 2017-12-08 23:14:12 -05:00
Henrik Lissner
9d81bc5a8b
Major refactor: use-package-always-defer = nil & use :hook
Possibly breaking change: packages are no longer deferred by default.

Addresses #286
2017-12-08 23:14:11 -05:00
Henrik Lissner
9408062f60
Move some plugins' storage to doom-etc-dir 2017-11-05 01:16:36 +01:00
Henrik Lissner
d28c64b4fa
General refactor & cleanup 2017-09-02 16:39:51 +02:00
Henrik Lissner
6d44cec666
Fix new workspace & file prompt on project switch
Properly initialize a new workspace, switch to the fallback buffer
(scratch/dash), update its default-directory to the project root, and
fuzzy-prompt for a file to open.
2017-08-06 18:49:47 +02:00
Henrik Lissner
85c28444b3
General cleanup & refactor 2017-08-06 16:30:53 +02:00
Henrik Lissner
d3a6a8317b
feature/workspaces: toggle doom-buffer-list advice 2017-07-08 13:47:40 +02:00
Henrik Lissner
b3a9889c53
Refactor feature/workspaces 2017-06-28 15:16:30 +02:00
Henrik Lissner
a894f3ee1e
Move persp-mode popup fix to core-popups 2017-06-28 12:26:50 +02:00
Henrik Lissner
eb20f3d5a6
Decouple workspaces module and doom buffer library 2017-06-28 12:26:50 +02:00
Henrik Lissner
90c3202f58
Don't activate main workspace if auto-resume is on
Other checks were unnecessary.
2017-06-28 12:26:50 +02:00
Henrik Lissner
5ebda9b0c6
Refactor buffer functions & update tests
+ Split doom-buffer-list into doom-buffer-list
  & doom-project-buffer-list.
+ doom-real-buffers-list => doom-real-buffer-list (for naming
  consistency).
2017-06-28 12:26:49 +02:00
Henrik Lissner
c0791e0790
Disable main workspace in noninteractive emacs
It is unnecessary in a noninteractive session.
2017-06-14 21:15:20 +02:00
Henrik Lissner
96ca709b23
Disable persp auto-save in noninteractive session 2017-06-14 21:15:19 +02:00
Henrik Lissner
816df321a5
General refactor & cleanup 2017-06-14 21:15:19 +02:00
Henrik Lissner
63b091f7aa
Fix *Warnings* buffer hiding on startup
...by holding them back until persp-mode is initialized.
2017-06-13 18:30:05 +02:00
Henrik Lissner
4984a548d1
Refactor DOOM init & add new init hooks
+ Add doom-init-hook and doom-post-init-hook to simplify Emacs init
  hooks into less ambiguous ones.
+ Attach former after-init-hook and emacs-startup-hook hooks to new doom
  init hooks.
+ Vastly improves daemon and tty support: preventing incorrect colors
  from bleeding across face class barriers, and into GUI Emacs and vice
  versa, when spawned with emacsclient.
+ Fix persp-mode breaking Emacs daemon, and ensuring that initialization
  is done properly in terminal Emacs (and emacsclient frames).
2017-06-12 00:37:14 +02:00
Henrik Lissner
c7254e7bdc
Major optimization refactor, across the board
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
  startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
  cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
  various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
  in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
  window-setup hooks; a customization opportunity for users + ensures
  custom functionality won't interfere with startup.
2017-06-09 00:47:45 +02:00