Commit Graph

63 Commits

Author SHA1 Message Date
f05512c2e5 lang/rust: restore advice redefs
Update package-installed-p redefinition to use a safe `require`, so that rustic-setup-rls will fail gracefully if lsp/eglot aren't available.

And restore rustic-install-rls-client-p redefinition to prevent rustic from trying to install packages.
2019-09-20 14:49:39 -04:00
8e9d3fdc5d Fix package-installed-p hack for rustic 2019-09-20 21:49:44 +10:00
7f2c7e7ae3 lang/rust: prevent rustic from installing packages 2019-09-20 00:11:02 -04:00
e956c0dc5a lang/rust: enable rainbow-delimiters-mode #1787 2019-09-15 12:06:40 -04:00
56d2c95cc7 lang/rust: remove redundant editorconfig-indentation-alist entry 2019-08-15 14:51:06 -04:00
19ecf8e46a Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +02:00
82ae3a73f3 def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +02:00
76cacb5bfe 💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
149b2617b0 💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
51d3b1b424 💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
8158cb1402 lang/rust: rustic-format-on-save = nil by default
Use :editor format instead.
2019-07-12 01:14:16 +02:00
5c09772219 lang/rust: fix rustic load order
Since both the rust-mode and rustic packages aggressively fight for
precedence in auto-mode-alist, rustic *must* be loaded after rust-mode,
so we switch from rust-mode to rustic-mode if it's available. This only
needs to happen once.
2019-07-11 01:09:30 +02:00
31875b64f4 Set rustic-rls-pkg sooner
To give the user an opportunity to change it.
2019-07-09 19:29:08 +02:00
a7a9951a50 lang/rust: fix void-function package-installed-p 2019-07-09 18:50:50 +02:00
7f735bcafa lang/rust: fix cannot load file t error with +lsp 2019-07-09 18:46:27 +02:00
236c9ceeab lang/rust: use rustic-mode instead on Emacs 26+ 2019-07-09 17:54:18 +02:00
f09a2b60c4 lang/rust: move lsp! to local-vars hook
i.e. start lsp-mode as late as possible
2019-07-07 17:39:19 +02:00
e577ce0162 add b prefix back 2019-07-05 16:15:05 +02:00
301173f35f remove b prefix, small refactor 2019-07-04 21:33:13 +02:00
9f37363764 use keybindings from cargo mode 2019-07-04 20:58:44 +02:00
f20f477a44 lang/rust: fix documentation lookup handler #1374 2019-04-30 20:21:12 -04:00
8e18b402ce lang/rust: run cargo commands from Cargo.toml dir
Instead of the current directory, which breaks file links in the
compilation buffer.
2019-04-10 18:52:08 -04:00
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
eb3c569e1d Replace +lsp|init with lsp! autodef 2019-03-02 01:34:19 -05:00
69ed1a4a99 feature/{syntax-checker,spellcheck} -> tools/fly{check,spell} 2019-02-22 00:25:30 -05:00
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
01a166d5f0 lang/rust: fix async docs lookup handler #1155 2019-02-11 14:42:28 -05:00
02624251c1 lang/rust: update keybinds for new map! 2018-12-22 20:07:18 -05:00
56a2c15c44 add rust key bingding description 2018-12-19 19:00:58 +08:00
e8b6887259 lang/rust: remove company-racer
Racer provides completion-at-point integration, which makes
company-racer redundant (and it conflicts with company-capf).
2018-10-18 13:11:28 -04:00
cd22434df0 lang/rust: add cargo check localleader keybind 2018-09-12 23:32:17 +03:00
84abac6b69 Remove def-menu!; use :localleader keys instead
def-menu was clumsy. We could use a better UI for refactoring commands,
but they should be available via localleader keybinds in any case.
2018-09-09 09:58:18 -04:00
fd8f8c5108 feature/lookup: rewrite dash docset integration
+ Uses alist variable to store config, rather than hooks
+ Added check for installed docsets in +lookup/documentation
+ Set docsets for various language modules (c-mode, c++-mode, css-mode,
  scss-mode, sass-mode, web-mode, go-mode, racket-mode, emacs-lisp-mode,
  js2-mode, rjsx-mode, typescript-mode, rust-mode, and php-mode)
+ Made *eww* popups for dash docsets larger
+ Renamed set-docset! => set-docsets! (set-docset! is aliased to
  set-docsets!)
+ New +lookup/install-docset alias
2018-08-31 02:49:48 +02:00
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
c0251aacee Replace :lookup with set-lookup-handlers! autodef
And update all internal references.
2018-06-15 17:27:48 +02:00
b99ab59578 Replace :docset with set-docset! autodef 2018-06-15 16:20:20 +02:00
98d2f1de3f Add set-env! autodef; make :env obsolete 2018-06-15 03:42:01 +02:00
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
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
135ebd925f Enable global-eldoc-mode; less work for me! 2018-04-23 00:34:03 -04:00
0d056149be lang/rust: refactor & bind +rust/build-menu 2018-03-14 19:08:02 -04:00
1765ca7282 lang/rust: add :docset 2018-03-14 19:06:42 -04:00
74c8b1d113 Rewrite doctor; move warn! blocks out in doctor.el files 2018-03-12 13:32:01 -04:00
2edbf91a5e lang/rust: read RUST_SRC_PATH envvar on MacOS 2018-03-07 21:21:39 -05:00
4dd6bcdc5f lang/rust: rust-indent-method-chain = t 2018-03-05 13:43:20 -05:00
c5abcfa703 lang/rust: fix flycheck not activating in rust-mode 2018-02-28 17:57:30 -05:00
02ad689890 lang/rust: refactor racer config
A lot of the previous logic is redundant and already done by the racer
package.
2018-02-18 03:13:50 -05:00
bac73ec938 Replace warn => warn! 2018-02-14 07:46:38 -05:00
42cee2e046 Update :jump => :lookup 2018-01-05 23:57:48 -05:00
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