Commit Graph

28 Commits

Author SHA1 Message Date
Henrik Lissner
93f7520c79
Refactor Doom core init process (again)
- Eager-load all core autoloaded libraries if autoloads file isn't
  present.
- Renames functions to be more descriptive of their true purpose:
  - doom-initialize-autoloads -> doom-load-autoloads-file
  - doom-load-env-vars -> doom-load-envvars-file
- Use doom-module-p instead of featurep! for backend use (the latter is
  mainly syntax sugar for module use, and evaluates at compile/expansion
  time, which may cause hash-table-p errors early in the startup
  process).
- Reorder plist library to prevent load order race condition with the
  functions using the macros that haven't been defined yet.
2019-07-22 23:22:54 +02:00
Henrik Lissner
832b7e9294
Remove witout-project-cache!, rename project-file-exists-p
To doom-project-file-exists-p, which is now a function.
2019-07-22 02:30:41 +02:00
Henrik Lissner
cd9378bb9e
Fix set-project-type!
Reference to non-existent variable, when
2019-07-09 02:19:35 +02:00
Henrik Lissner
22cc519ac1
Add set-project-type! autodef
And use it for love2d projects in lang/lua module.
2019-06-27 17:16:40 +02:00
Henrik Lissner
e2869c62a1
Add file-readable-p check to doom-project-find-file 2019-06-17 20:57:29 +02:00
Henrik Lissner
f696ff32f4
doom-project-find-file: add helm-find-files as a fallback 2019-05-13 00:18:51 -04:00
Henrik Lissner
99c26e2fc2
Allow doom-project-find-file on arbitrary paths
- If DIR is not in a valid project, index it as normal and do
  projectile-find-file from current directory (but do not cache).
- If DIR is a valid project, but not the project root, fall back to
  different mechanism for exploring it (project-find-file,
  counsel-file-jump, or find-file).
- If DIR is a valid project AND is the project root, use
  projectile-find-file as normal.

This is to make doom-project-find-file more do-what-I-mean.
2019-04-19 20:48:48 -04:00
Henrik Lissner
4724d0a109
Fix #1323: void-variable projectile-project-root 2019-04-11 18:29:26 -04:00
Henrik Lissner
d3a12a3914
Refactor projects api
Improves correctness of projectile project state. Namely, prevents
projectile-project-root from poisoning the return value of
doom-project-root or doom-project-p, which may be causing an elusive bug
where doom-project-find-file is searching the wrong directory.
2019-04-09 03:13:18 -04:00
Henrik Lissner
803ca2863a
Use resolved, absolute paths in doom-project api
Ensures projectile caches files under the right key.
2019-03-28 19:57:34 -04:00
Henrik Lissner
ece7b8fdcd
Fix doom-project-find-file on non-project DIRs
This function should be as DWIM as possible.
2019-03-28 15:07:14 -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
Henrik Lissner
c2d0cae6a5
doom-project-find-file: avoid helm-projectile #1274
helm-projectile-find-file misbehaves as a workspace project-switch
handler (likely because it runs asynchronously and misses the lexical
value of `default-directory`), so we avoid it and use
projectile-find-file directly (which still uses helm, just not the
helm-projectile package).
2019-03-26 03:38:37 -04:00
Henrik Lissner
687496167a
Fix void-function projectile-relevant-known-projects
Thrown when using doom/find-file-in-other-project and
doom/browse-in-other-project too soon.
2019-03-02 01:34:19 -05:00
Henrik Lissner
1b43ea50f0
Revise SPC f keybinds
- SPC f . -> counsel-file-jump or find-file
- SPC f > -> doom/browse-in-other-projects
- SPC f / -> projectile-find-file
- SPC f ? -> doom/find-file-in-other-project
- Moved doom/sudo-find-file to SPC f S

This change was made to accommodate the new
doom/browse-in-other-projects and doom/find-file-in-other-project
commands, which make it easy to jump to files in other known projects.
2019-02-26 13:21:16 -05: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
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
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
4bdd6002a4
Restore projectile-project-root's old behavior
For now...
2018-09-27 21:55:19 -04:00
Henrik Lissner
aa930256b8
Update doom/reload-project for changes upstream
In projectile.
2018-09-25 23:36:54 -04:00
Henrik Lissner
cffb1d367f Update without-project-cache! macro
To match upstream changes in projectile
2018-09-22 13:15:12 -04:00
Henrik Lissner
ac63596be8 Fix doom-project-root returning nil if no project
It should return default-directory. A change upstream broke this.
2018-09-22 13:15:12 -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
d2f9d28577
doom-project-(find-file|browse): resolve symlinks
This prevents absolute paths appearing in many find-in/browse commands,
like +default/find-in-emacsd, +default/find-in-config, or
+default/browse-project.
2018-09-09 09:58:18 -04:00
Henrik Lissner
247b219ea1
doom-project-find-file: set default-directory too #833
Be extra sure!
2018-08-26 12:00:13 +02:00
Henrik Lissner
1a6ee8e0df
Fix doom-project-find-file if $HOME is a repo #833
If HOME is a repo, projectile resolves all project roots to HOME. This
fixes any commands that rely on this project resolution by explicitly
telling them what project they're in instead.
2018-08-26 11:47:04 +02:00
Henrik Lissner
9ddfca44d1
Rename doom//reload-project -> doom/reload-project
Conform command to new naming convention (removed the doom//abc
convention).
2018-08-11 21:45:53 +02:00
Henrik Lissner
9a2f96c0f1
Lazy load projectile (experimental)
I can feel it; the power coursing through my veins. Every millisecond
saved at startup makes me more powerful. This world will be mine. Mine I
tell you!
2018-06-16 11:42:37 +02:00