Commit graph

113 commits

Author SHA1 Message Date
Henrik Lissner
72fb5603e7
Minor, general refactor & reformatting
Also swaps C-o and M-o in ivy

And use new ;;;###package cookie (not used yet)
2019-04-06 01:36:46 -04:00
Henrik Lissner
2dc52bc9be
💥 Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.

Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
  commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)

The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.

+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
  running `doom env enable` (`doom env clear` will reverse this and
  delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
  file. You won't need it if you're confident Emacs will always be
  started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
  doom/reload-env`. Note: this won't work if the Emacs session you're
  running it in doesn't have a correct SHELL set. i.e. don't use this to
  create your first env file!

The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.

This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 01:56:09 -04:00
Huy Duong
d77237a9c4 Correct missing bindings for rspec-mode
Signed-off-by: Huy Duong <qhuyduong@hotmail.com>
2019-03-15 10:01:43 +07:00
Henrik Lissner
fba7bf7748
lang/ruby: don't unset rspec-mode's keymaps
No longer necessary, and is destructive for non-evil users.
2019-03-14 00:03:12 -04:00
Henrik Lissner
b06eae6ccf
Merge pull request #1214 from qhuyduong/rspec-bindings
Bind some rspec functions for ruby and enh-ruby mode
2019-03-12 11:32:23 -04:00
Huy Duong
2860633f91 Improve rspec key bindings
Signed-off-by: Huy Duong <huy.duong@employmenthero.com>
2019-03-12 09:21:56 +07:00
Henrik Lissner
eb3c569e1d
Replace +lsp|init with lsp! autodef 2019-03-02 01:34:19 -05:00
Henrik Lissner
8832737671
Adopt seagle0128/doom-modeline for :ui modeline
And remove obsolete :ui doom-modeline module.

Relevant to: #136, #921
2019-03-02 01:34:14 -05:00
Huy Duong
61645bb9ca Bind some rspec functions for ruby and enh-ruby mode
Some rspec-mode's functions can be used under any Ruby source files. So
adding some localleader bindings for them.

Signed-off-by: Huy Duong <huy.duong@employmenthero.com>
2019-03-01 09:35:28 +07:00
Henrik Lissner
8de36a3b5a
+ruby|adjust-mode-line -> +ruby|init-mode-line
To be consistent with other initializer hooks.
2019-02-24 22:23:24 -05:00
Henrik Lissner
cb923eadcc
Add basic LSP support
Still needs to be documented, but includes support for the following
languages:

+ C/C++/ObjC
+ Go
+ Java
+ Javascript
+ OCaml
+ PHP
+ Python
+ Ruby
+ Scala
+ Swift
+ HTML/CSS

Relevant to #460, #716, #1186
2019-02-21 19:13:35 -05:00
Henrik Lissner
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
Henrik Lissner
0665d10377
lang/ruby: remove dtrt-indent fix
This was merged upstream
2018-10-24 01:08:31 -04:00
Henrik Lissner
3d6b30675c
lang/ruby: remove redundant add-hook 2018-10-16 17:28:21 -04:00
Henrik Lissner
8bdb42fe15
lang/ruby: major refactor
+ Robe is now to be started manually.
+ Adds more keybindings for robe (including <localleader> ' for
  robe-start).
+ Use ruby-mode if ruby isn't available (e.g. editing ruby files on
  remote systems), enh-ruby-mode otherwise.
+ Added rake, bundler, rvm, rbenv and minitest packages
+ Added $RBENV_ROOT/shims to exec-path. This should fix rbenv support
  for the ruby version display in the modeline.
2018-09-25 22:45:13 -04:00
Henrik Lissner
8afbb804d9
lang/ruby: add bundler + keybinds 2018-09-25 16:40:23 -04:00
Henrik Lissner
d73f488c11
lang/ruby: add indent detection support
It already exists for ruby-mode, but not enh-ruby-mode. This fixes that.
2018-09-09 09:58:23 -04:00
Henrik Lissner
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
Henrik Lissner
c7abe743d1
lang/ruby: show messages when robe throws errors 2018-08-23 16:55:02 +02:00
Henrik Lissner
f23960b919
lang/ruby: don't enable global-rbenv-mode
To be consistent with pyenv/virtualenvs; rbenv should be managed
manually, rather than trying to guess what the user wants.
2018-08-23 16:54:02 +02:00
Henrik Lissner
a824e04e92
lang/ruby: fix wrong-num-of-args error from setq 2018-08-14 09:33:42 +02:00
Henrik Lissner
0c36b4450e
lang/ruby: update rspec-mode integration
Prompted by upstream updates.
2018-08-03 18:07:39 +02:00
Henrik Lissner
06aa16bbfb
lang/ruby: keep mode-line indicator up-to-date 2018-08-01 15:18:58 +02:00
Henrik Lissner
3948255445
lang/ruby: rewrite rbenv support; add rvm support 2018-07-31 15:51:25 +02:00
Henrik Lissner
1fc43dacfc
lang/ruby: don't pop up console on startup
This shouldn't compromise the features that robe provides (like code
completion), it only hides the REPL.
2018-07-11 13:06:28 +02:00
Henrik Lissner
867eaebd9d
Remove FIXME in lang/ruby (it's been fixed!) 2018-07-10 23:11:40 +02:00
Henrik Lissner
a0b0964355
lang/ruby: fix rbenv version detection 2018-07-06 23:58:11 +02:00
Henrik Lissner
00d6e7b9ca
Cleanup robe processes killing last ruby buffer
Experimental?
2018-07-06 23:11:26 +02:00
Henrik Lissner
f5f87ee0a3
Refactor lang/ruby & remove +ruby-ask-for-server
To conform to conventions and remove redundancies (like activating
flycheck-mode, which is global now).

Also, should now silently create a robe server.
2018-07-06 22:38:01 +02:00
Aria Edmonds
372f02b6c0 lang/ruby: fix type (enh-ruby-ode) 2018-07-06 23:56:10 +10:00
Aria Edmonds
811290368c lang/ruby: what's 'this' lol 2018-07-06 23:56:10 +10:00
Aria Edmonds
12b32d6208 lang/ruby: Add rubocop binds 2018-07-06 23:56:10 +10:00
Aria Edmonds
6b1265ae5a lang/ruby: bit more refactoring 2018-07-06 23:54:56 +10:00
Aria Edmonds
3f553b0a71
lang/ruby: Initial work on porting to enh-ruby 2018-07-06 23:32:06 +10:00
Henrik Lissner
e05d7cfee0
Change flycheck initialization strategy
Initialize it globally and turn it off where needed, instead of enabling
it on demand. Also fixes void-function: flycheck-mode errors when
:feature syntax-checker is disabled. This is experimental.

Indirectly fixes #710
2018-06-22 01:49:20 +02:00
Julien Wintz
97f7406469
Use :modes instead of :in. 2018-06-17 14:22:29 +02:00
Henrik Lissner
588359cc5f
Replace :eval/:repl with autodef functions
+ :eval => set-eval-handler!
+ :repl => set-repl-handler!
+ Updates all internal references.
2018-06-15 16:20:20 +02:00
Henrik Lissner
9f0ebe42e8
Replace :electric with set-electric-rules!
And general refactor of the emacs/electric-indent module.

Also updates (set! :electric ...) references in various :lang modules
2018-06-15 13:32:07 +02:00
Henrik Lissner
98d2f1de3f
Add set-env! autodef; make :env obsolete 2018-06-15 03:42:01 +02:00
Henrik Lissner
d8b1e469bc
Introduce autodefs to replace some settings
+ :popup -> set-popup-rule!
+ :popups -> set-popup-rules!
+ :company-backend -> set-company-backend!
+ :evil-state -> set-evil-initial-state!

I am slowly phasing out the setting system (def-setting! and set!),
starting with these.

What are autodefs? These are functions that are always defined, whether
or not their respective modules are enabled. However, when their modules
are disabled, they are replaced with macros that no-op and don't
waste time evaluating their arguments.

The old set! function will still work, for a while.
2018-06-15 03:42:01 +02:00
Henrik Lissner
f70c9ebb71
Fix void-symbol errors in compilation buffers
Occurs when :lang ruby is enabled, because the rspec-mode package
autoloads an advice, but not the advice function. Still, it seems silly
to do this advice before the package is loaded, so we disable it.
2018-06-11 14:21:35 +02:00
Henrik Lissner
fd95bfee07
Fix rspec-mode activation & localleader keybinds 2018-06-01 16:59:25 +02:00
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
6b573bc66b
Refactor :lang auto-mode-alist entries 2018-05-07 19:26:31 +02:00
Henrik Lissner
b181799f93
lang/ruby: fix rbenv version in mode-line 2018-03-13 01:27:53 -04:00
Henrik Lissner
76a4ae459d
Fix obsolete (when|if)-let messages in Emacs 26 2017-12-10 14:49:52 -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
738d85e84f
Let python/ruby modules handle version strings
Also, set RBENV_VERSION and PYENV_VERSION envvars.
2017-09-26 01:02:47 +02:00
Henrik Lissner
93ae5e5f51
lang/ruby: add rake support 2017-09-23 13:48:08 +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