Commit Graph

3783 Commits

Author SHA1 Message Date
Henrik Lissner
3b9701161a
Fix build date in doom/version
When it is called interactively from a file outside of ~/.emacs.d
2019-08-21 12:17:32 -04:00
Henrik Lissner
879f3a660a
Use new straight-base-dir variable
We can't phase out doom--straight-use-local-dir-a until I fix the issue
with straight not reinstalling packages when their recipes change.
2019-08-21 00:29:12 -04:00
Henrik Lissner
40e6a37652
Expand on doom-module-load-path's docstring
Mention that value in the returned list is always doom-private-dir.
2019-08-21 00:10:24 -04:00
Henrik Lissner
0b2b5d1c6c
Install & track from straight.el's develop branch 2019-08-21 00:09:44 -04:00
Henrik Lissner
1cd219dfa7
Update the docstring for leader/localleader vars
They should be set in your private config.el, not init.el.
2019-08-19 21:04:54 -04:00
Henrik Lissner
2eb8035f15
Add more DEPRECATED tags
For Emacs 25 functionality that'll be removed when 25.x support is
dropped.
2019-08-19 21:04:11 -04:00
Henrik Lissner
b854a089eb
Sort & optimize package list on 'doom purge' 2019-08-18 11:24:44 -04:00
Henrik Lissner
2a3f95f615
Update line-number-display-width polyfill
It takes one argument in later versions of Emacs. This file really
shouldn't be visible to Emacs 25.x and earlier, but there has been one
case of it being indexed by Doom's autoload scanner.

Also marks the library with the new DEPRECATED tag. It will be removed
once Doom removes 25.x support.
2019-08-17 16:04:26 -04:00
Henrik Lissner
2b3f522858
Update :recipe example in dummy packages.el
Deployed by `doom quickstart`/`doom install`
2019-08-17 16:04:26 -04:00
Henrik Lissner
b2fd76cb49
Ensure straight is loaded on doom-initialize-packages
Without causing recursive require errors if called in an after! handler
for straight.
2019-08-15 19:56:20 -04:00
Henrik Lissner
8d3536fa77
Initialize package.el on doom-initialize-packages
So that packages installed via package.el are still available.
2019-08-15 19:52:43 -04:00
Henrik Lissner
bc8b6605db
Don't byte-compile straight
This eliminates the possibility of straight throwing an
emacs-version-changed error, which is difficult to catch, when uses
could invoke a straight command interactively and any time. We'll do our
own version checks (later).
2019-08-15 19:51:36 -04:00
Henrik Lissner
a7bdf6825a
Set default exec-path & shell-file-name
In case doom-load-envvars-file is called when these vars have local
bindings.
2019-08-15 18:42:26 -04:00
Henrik Lissner
d298a8e71c
Update envvar file comment header
Envvar files are now refreshed on `doom refresh`, if it exists. A while
back I removed the `doom env reload` step.
2019-08-15 17:29:08 -04:00
Henrik Lissner
4e016eb843
Merge pull request #1621 from ashtonbaker/fix-spelling
fix small spelling mistake in fonts.el
2019-08-15 15:02:17 -04:00
Henrik Lissner
5aa7415d87
Add -t/--timeout switch to 'doom update'
To get around timeout issues on slower connections or larger packages.
2019-08-15 01:34:28 -04:00
Henrik Lissner
b29a7ba8fe
Fix 'doom compile'
Fixes `void-function define-key!` error.
2019-08-15 01:33:40 -04:00
Henrik Lissner
374940b959
Persist scratch buffers more proactively
Prior to this change, scratch buffers were saved only when Emacs is
killed. In cases where Emacs doesn't die properly, you'd lose your
scratch contents. Now, they are persisted as soon as you close them.
2019-08-15 01:07:45 -04:00
Henrik Lissner
7ded14f548
Refactor scratch buffer init 2019-08-15 01:02:00 -04:00
Henrik Lissner
7d714b7531
Fix #1673: restore project-file-exists-p! macro 2019-08-14 22:36:19 -04:00
Ashton Baker
aa3538591a fix small spelling mistake in fonts.el 2019-08-12 14:47:39 -04:00
Henrik Lissner
702369e888
Move :ui tabbar to :ui tabs
And update its README.org
2019-08-11 02:05:09 -04:00
Henrik Lissner
856a2afe43
Add delete! convenience macro
And polish delq!'s docstring.
2019-08-11 02:05:09 -04:00
Henrik Lissner
2cd9685758
Discard timed out future correctly on 'doom update'
And list packages immediately after message (no newlines).
2019-08-09 22:23:38 -04:00
Henrik Lissner
624c5e1a71
Complain about unknown targets in 'doom compile' #1657 2019-08-09 22:23:37 -04:00
Henrik Lissner
48415edce3
Fix #1644: --restore switch not recognized 2019-08-08 23:30:16 -04:00
Henrik Lissner
0a44881df1
Increase number of sub-processes for 'doom update' 2019-08-08 23:00:54 -04:00
Henrik Lissner
c266680c11
Fix #1653: uncaught error when async process times out 2019-08-08 22:59:57 -04:00
Henrik Lissner
115a436273
Fix 'doom update' for chemacs users
Or users who have Doom in a non-standard location (i.e. outside
~/.emacs.d).
2019-08-08 11:48:13 -04:00
Henrik Lissner
956b8cc532
Merge pull request #1619 from filalex77/fix-doom-reload-packages
Require straight.el in doom/reload-packages
2019-08-07 21:48:10 -04:00
Henrik Lissner
ef60762a92
Fix wrong-type-arg: listp error on 'doom update'
Caused when async fails to create a child process for a certain group of
packages (needs to be investigated more).
2019-08-07 21:07:43 -04:00
Henrik Lissner
f42bfde8ae
Fix #1648: doom upgrade not updating packages
...when Doom itself is up-to-date.
2019-08-07 20:55:56 -04:00
Henrik Lissner
4a92d12267
Fix void-variable package error on 'doom update' 2019-08-07 17:22:46 -04:00
Henrik Lissner
b808c4e1ab
Reload autoloads files in noninteractive sessions
After it's been regenerated, so that any hacks (*cough*org/magit*cough*)
are in scope.
2019-08-07 16:55:04 -04:00
Henrik Lissner
87358db85e
Fix void-function mapcan on Emacs 25.x 2019-08-07 16:54:47 -04:00
Henrik Lissner
c8d6ab823b
Update documentation for 'doom env' 2019-08-07 01:42:46 -04:00
Henrik Lissner
b34a542ca0
Fix over-eager whitespace-mode after switching major modes
Some major modes (like rust-mode) may trigger
doom-highlight-non-default-indentation-h twice, causing whitespace-style
to be set to its default global value, which (by default) enables
whitespace-mode with all its features. This may overwhelm the
unsuspecting user, so we instead only tack on our modifications to
whitespace-style to its existing buffer-local value, rather than its
global value.
2019-08-06 20:38:04 -04:00
Henrik Lissner
29e851da27
Try counsel-file-jump before project-find-file-in
The former is more reliable (and faster, with the fd/rg hack in the next
commit).

Also (hopefully) fixes the "cl-no-applicable-method: No applicable
method: project-roots" error emitted when project-find-file-in fails to
identify the target as a project root.
2019-08-06 19:43:38 -04:00
Henrik Lissner
3423974234
Minor refactors & tweaks across the board 2019-08-06 14:50:42 -04:00
Henrik Lissner
3e4c02f92f
Resolve symlinks in doom-emacs-dir
Shaves a little time off startup on slower drives.
2019-08-06 14:46:15 -04:00
Henrik Lissner
eb0ae8622c
Fix file paths in comment headings 2019-08-06 14:45:55 -04:00
Henrik Lissner
80988a7ad4
Fix kill-current-buffer advise supressing exwm hooks 2019-08-06 14:37:46 -04:00
Daniel Koning
2d28808121 Correct argument name in `defadvice!' docstring 2019-08-05 18:27:56 -05:00
Oleksii Filonenko
ec45c9367a
Require straight.el in doom/reload-packages
Because it's not loaded for some reason.

Also, require is not a big problem IMO: if you run this interactively, the
require cost probably doesn't matter much already.

Fixes #1618.
2019-07-30 14:47:19 +03:00
Henrik Lissner
54edffc4bb
cli/packages: emit a little more debug info
To mark the start of purging/regrafting procedures.
2019-07-29 21:29:43 +02:00
Henrik Lissner
435436e390
Fix 'doom purge' failing to delete build directory 2019-07-29 21:18:49 +02:00
Henrik Lissner
7559949e09
Rewrite 'doom purge'; add repo regrafting
'doom purge -r' now re-grafts shallow cloned packages (compacting them
as much as possible).
2019-07-29 21:09:23 +02:00
Henrik Lissner
99c73cea0b
setq-hook!: don't append setq hooks
Now settings can take effect in time for hooks that could see them.
2019-07-29 21:09:23 +02:00
Henrik Lissner
c3e2ec0157
Redesign straight initialization #1610 #1607
Straight throws an 'emacs-version-changed' error if you load it with a
version of Emacs it wasn't compiled with. This update causes this to
emit a more helpful error.
2019-07-29 21:09:21 +02:00
Henrik Lissner
87fd81281f
Rewrite 'doom update'
- Is now much more fault tolerant (produces better errors)
- Now handles async.el process errors as well
- Standardizes data structure of thread responses
2019-07-29 21:01:46 +02:00
Henrik Lissner
da954aa361
Improve 'doom build' reporting & checks
- Fix 'doom build' not byte-compiling stale dependencies of rebuilt
  packages.
- Fix 'doom build' logging the wrong number of packages that were
  rebuilt.
2019-07-29 20:59:52 +02:00
Henrik Lissner
4e305dd2ab
Fix bin/doom misinterpreting wrong-num-of-args errors 2019-07-29 20:58:02 +02:00
Henrik Lissner
c32244ad4e
Generalize doom-sh
And slightly reformat 'doom upgrade' "you have updates" message.
2019-07-29 20:57:20 +02:00
Henrik Lissner
19b6e82dc4
Change package! :recipe to extend default recipe
Instead of replacing the whole recipe with the contents of :recipe, only
modify the specified properties. This allows you to specify helpful
parameters like :nonrecursive or :depth without having to include the
full recipe.
2019-07-29 17:22:27 +02:00
Henrik Lissner
baafa0f635
Fix #1617: fd is used despite being absent 2019-07-29 15:05:26 +02:00
Henrik Lissner
2b81233353
Clean up _upgrade rmeote after 'doom upgrade' 2019-07-29 03:47:56 +02:00
Henrik Lissner
ba07fe575e
Add {--no-{elpa,builds},-r,--repos} flags to 'doom purge' 2019-07-29 03:47:12 +02:00
Henrik Lissner
8a16513107
Fix various errors in 'doom upgrade' 2019-07-29 03:34:35 +02:00
Henrik Lissner
2304d69898
Fix wrong-type-arg number during 'doom upgrade' 2019-07-29 03:21:55 +02:00
Henrik Lissner
c28fff4fbf
Fix void-variable branch error on 'doom upgrade' 2019-07-29 03:18:39 +02:00
Henrik Lissner
e3d6d13be5
Fix doom/help-packages
Also adds doom-package-backend function.

TODO: Report more information about straight packages.
2019-07-29 03:18:38 +02:00
Henrik Lissner
1033087beb
Merge pull request #1609 from tchajed/fix-fetcher-warning
Fix :fetcher warning to include package name
2019-07-28 16:33:23 +02:00
Henrik Lissner
ff5be98cec
Disable show-trailing-whitespace by default #1593
Let people decide if they want it on or not.

See doom-enable-show-trailing-whitespace-h or setq-hook!
2019-07-28 16:10:54 +02:00
Henrik Lissner
c2af0723d7
Show progress percentage during 'doom update' 2019-07-28 16:10:54 +02:00
Henrik Lissner
19ecf8e46a
Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +02:00
Henrik Lissner
a354bba261
Appease byte-compiler-san-chan-sensei-sama-chama
Praise be.
2019-07-28 16:10:53 +02:00
Henrik Lissner
8773d85db0
Fix oversights in plist library
- doplist! now returns the RETVAL expression
- Fix doom-plist-merge (was incomplete)
2019-07-28 16:10:53 +02:00
Henrik Lissner
3330501af6
Remove examples in custom-*set-faces!
They're already in docs/api.org, which helpful buffers will display
alongside a function/macro's documentation.
2019-07-28 16:10:53 +02:00
Henrik Lissner
529f8d7e7a
Fix custom-theme-set-faces!
The body was still quoted from when it was a macro.
2019-07-28 16:10:53 +02:00
Tej Chajed
1eacda2d5c
Fix :fetcher warning to include package name 2019-07-28 10:00:36 -04:00
Henrik Lissner
efb4584797
Alias 'doom build' to 'doom rebuild' 2019-07-28 14:02:51 +02:00
Henrik Lissner
a9c1986a68
Fix and refactor 'doom upgrade' #1607
Now accepts the -f/--force switches to discard local changes to
the .emacs.d directory.
2019-07-28 13:47:57 +02:00
Henrik Lissner
a6d77e951f
Move doom-run-all-startup-hooks-h to autoload/debug.el 2019-07-28 02:32:25 +02:00
Henrik Lissner
4dc42de9e3
def-command! -> defcli!
And def-command-group! -> defcligroup!, to match our new convention for
naming definer macros.
2019-07-28 02:32:25 +02:00
Henrik Lissner
8dab8eefca
Prevent load-file-name/#$ replacements in strings & comments 2019-07-27 22:57:32 +02:00
Henrik Lissner
b332a923a5
Add in-house point-in-{comment,string} predicates
Toward uncoupling Doom from smartparens.
2019-07-27 22:56:49 +02:00
Henrik Lissner
8d388ebba9
Improve 'doom rebuild' checks & formatting of logs
Corrects stale bytecode a little more aggressively.
2019-07-27 17:22:47 +02:00
Henrik Lissner
a441435f3e
Fix debug helper for format!
Throwing format errors when there are no arguments.

Also makes relpath a little more lenient about nil/empty input.
2019-07-27 17:05:17 +02:00
Henrik Lissner
402260f154
Fix doom/reload & doom/reload-autoloads 2019-07-27 17:04:17 +02:00
Henrik Lissner
3c36a345d8
Fix file! not returning filename in some cases
There are scenarios where load-file-name is set, but load-in-progress is
not. It is safe to assume the value of load-file-name is always what we
want.

Also: file! now throws an error if it can't find the directory.
Otherwise we have to deal with roundabout errors from other places that
expect file! to never fail.
2019-07-27 17:00:12 +02:00
Henrik Lissner
21a27b52d8
Refactor autoloads generation
- Correctly replace references to load-file-name and $# in autoloads.
- Don't load resulting autoloads file twice
- Read package autoloads literally (a little faster)
2019-07-27 16:59:10 +02:00
Henrik Lissner
0dfdbd471c
Ensure envvars at top of envvar file are checked
The regexp expects there to be at least one newline at the top of the
file, otherwise the very first envvar is skipped.
2019-07-27 02:46:50 +02:00
Henrik Lissner
597ef77c20
Ignore envvars prefixed with __
They are likely private. There are some public variables with single
underscore prefixes, however, like _FASD_DATA and _FASD_VIMINFO.
2019-07-27 02:46:49 +02:00
Henrik Lissner
fe5d285a50
scroll-conservatively = 10
Match the vim default behavior of recenting the cursor in the window if
it moves more than 10 lines above or below the ends of the window.
2019-07-27 02:46:49 +02:00
Henrik Lissner
4d73f659f5
Refactor out nested hook defuns & refactor core.el
Moves file-handling config to core-editor.el.
2019-07-27 02:46:49 +02:00
Henrik Lissner
1a72cf0677
Minor, general refactors to package API 2019-07-26 20:17:30 +02:00
Henrik Lissner
6fcaa80355
Improve autoloads mtime scanning on packages
Scan source files in build directory rather than repos, which are better
indicators of a stale autoloads file.
2019-07-26 20:17:30 +02:00
Henrik Lissner
9c1c61752a
Fix 'doom refresh' skipping purging step 2019-07-26 20:17:29 +02:00
Henrik Lissner
38b69785dd
Don't load pkg autoloads in non-interactive sessions
Fixes an issue where autoloads would bloat load-path and auto-mode-alist
with duplicates because they were build on top of old autoloads state.

We initialize packages manually at the start of non-interactive sessions
anyway.
2019-07-26 20:17:29 +02:00
Henrik Lissner
08ba22c653
Minor refactor/reformatting of doom-initialize
- No need to use after! (it has a little magic associated with it that are
  meaningless this early in the startup process), so we use
  with-eval-after-load instead.

(And I've been itching for an excuse to use doom-rpartial)
2019-07-26 20:17:29 +02:00
Henrik Lissner
a10693886e
Fix double-rebuilding & lingering stale elc files
This update addresses two evasive issues:

1. Packages updated with `doom update` would not rebuild correctly,
   requiring a `doom refresh` afterwards,
2. Packages would fail to rebuild even if their byte-compiled files were
   stale. The result: "*.el is newer than *.elc" warnings at startup.
2019-07-26 20:17:29 +02:00
Henrik Lissner
f8c4d075a5
Fix doom purge reporting failure despite success 2019-07-26 20:17:29 +02:00
Henrik Lissner
a3e262c7ac
💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
Henrik Lissner
c2ae6f30a5
Don't compress auto-mode-alist
Modules may readd their entries afterwards, anyway.
2019-07-26 15:33:32 +02:00
Henrik Lissner
486e21ab44
Refactor doom-info; remove doom-find-packages
The function was overcomplicated and wasn't any more useful than looking
directly at doom-packages
2019-07-26 15:25:59 +02:00
Henrik Lissner
e70998228a
Fix doom-package-private-p 2019-07-26 15:25:30 +02:00
Henrik Lissner
8834ba17e3
Only return non-nil if doom-packages-purge worked 2019-07-26 13:59:14 +02:00
Henrik Lissner
88096a81a9
merge whitespace-style with global value, not local
And ensure it runs as late as possible in after-change-major-mode-hook.

Hopefully to increase the probability of
doom-highlight-non-default-indentation-h detecting a user-enabled
whitespace-mode and bowing out in time.
2019-07-26 13:57:42 +02:00
Henrik Lissner
9311744f7f
Restore comment header in envvar files
`shell-command` erases the target buffer before piping output to it.
Which means the envvar file comment header was wiped out. This causes
trouble for the envvar file parser, which expects the envvar list to
start with two newlines.
2019-07-26 13:38:13 +02:00
Henrik Lissner
331a53c0a1
Complain if envvar file exists, but isn't readable 2019-07-26 13:15:28 +02:00
Henrik Lissner
e6201ca952
Add :if, :when, :unless & :cond support to doom! macro
Now you can conditionally enable/disable modules.
2019-07-26 12:05:13 +02:00
Henrik Lissner
321b797046
cli/packages: fix infinite waiting on pkg update
Caused lecause straight is prompting for input in a headless
session *and* from a headless async child instance of Emacs. It waits
forever for input for a question we could never see or respond to.

How sad.
2019-07-26 11:54:37 +02:00
Henrik Lissner
a146e61728
Remove DIR!, FILE! and def-advice! obsolete aliases 2019-07-26 03:12:07 +02:00
Henrik Lissner
44c694da47
Make bin/doom options consistent & improve errors/docs 2019-07-26 03:12:07 +02:00
Henrik Lissner
829ad8c8b7
cli/packages: refactor doom-packages-purge
Sets it up for a later update where purging repos will no longer be the
default behavior.
2019-07-26 03:12:06 +02:00
Henrik Lissner
905ba1d23c
Refactor autoloads byte-compilation
- Let-bind byte-compile-* vars instead of using file-local vars.
- Fix duplicate bullet point in "Copied backup..." message.
- Only display refresh message if cli command was successful.
2019-07-26 03:12:06 +02:00
Henrik Lissner
d00c5a0de5
Add doom-cli-post-{failure,success}-execute-hook vars
To replace doom-cli-post-execute-hook. Now only displays "refresh"
message after a successful command.
2019-07-26 03:12:06 +02:00
Henrik Lissner
bdcb156b91
Manually finalize straight transactions
Straight expects to be used interactively, which don't do (yet). Its
transactional system depends on idle timers, which don't run in a
noninteractive session, so we have to nudge it ourselves.
2019-07-26 03:12:06 +02:00
Henrik Lissner
2aa7dbfb27
cli/packages: refactor doom-packages-update
- Now handles errors from threads gracefully, rather than failing
  silently.
- Exploits straights modification system to trigger rebuilds
  later (instead of force-rebuilding after each update).
2019-07-26 03:12:06 +02:00
Henrik Lissner
ecb655dc01
Add nested face support to custom-theme-set-faces!
And convert it and custom-set-faces! to functions because they didn't
need to be macros.
2019-07-26 03:12:06 +02:00
Oleksii Filonenko
62741a4214
Remove quoting in λ!! 2019-07-25 20:50:54 +03:00
Henrik Lissner
4299da1eb8
:after -> :after-while for load-theme advice
The advice shouldn't run if load-theme doesn't return
non-nil (indicating it succeeded).
2019-07-25 01:50:33 +02:00
Henrik Lissner
e0fe2a85d1
Ensure doom-projectile-fd-binary is never nil 2019-07-24 17:09:51 +02:00
Henrik Lissner
03a4461d3b
Indent use-package! the same as use-package 2019-07-24 16:53:33 +02:00
Henrik Lissner
b8837ac022
Fix keyword type check in doom-keyword-name 2019-07-24 15:26:43 +02:00
Henrik Lissner
ba990a6c9d
Build package autoloads in install order #374
Before this update, the autoloads files were collected in
lexicographical order (by traversing straight's build directory). By
using straight--build-cache's keys (which are entered in the order they
were registered) we avoid issues like
2019-07-23 21:54:50 +02:00
Henrik Lissner
d55f284386
Refactor file-exists-p macro
And refactor too doom--resolve-path-forms
2019-07-23 20:43:24 +02:00
Henrik Lissner
d95acb4caa
Change λ!! to a function
It doesn't need to be a macro
2019-07-23 19:09:29 +02:00
Henrik Lissner
003febd54c
Refactor doom--define-leader-key helper
And mark it as a hack, which it is, Mr. Anderson.
2019-07-23 18:14:49 +02:00
Henrik Lissner
58ab20ec5f
Fix prependq!
Used one too many levels of nesting
2019-07-23 18:10:40 +02:00
Henrik Lissner
876bed4813
Remove deprecated :map* & :keymap from map! macro
These have been deprecated for some time. They are all aliases for :map.
2019-07-23 17:35:56 +02:00
Henrik Lissner
9eaee096c8
Minor comment revision & general code reformatting 2019-07-23 17:30:32 +02:00
Henrik Lissner
be46d31866
Use display-multi-font-p check in all-the-icons advice
display-multi-font-p is just an alias for display-graphic-p, but it
communicates better the purpose of this advice.
2019-07-23 17:27:55 +02:00
Henrik Lissner
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
Henrik Lissner
6f56b9f9d4
Add autoload/themes.el library 2019-07-23 14:31:00 +02:00
Henrik Lissner
83763414fb
Improve docstring for def-advice! functions
Now lists linked functions that the advice was defined with.
2019-07-23 14:12:01 +02:00
Henrik Lissner
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
Henrik Lissner
c795a988e6
Conform many modules to new conventions 2019-07-23 12:30:47 +02:00
Henrik Lissner
7ac155f68d
Fix company help replacing the current buffer
Instead of displaying in a popup.
2019-07-23 02:04:44 +02:00
Henrik Lissner
7ebc9045f2
Fix reference to renamed variable targets 2019-07-23 01:27:20 +02:00
Henrik Lissner
d59405b282
Minor comment revision & refactors 2019-07-23 00:30:45 +02:00
Henrik Lissner
d7ed52f3c7
Add ui/hydra module
And conforms all existing hydras to the naming convention for
interactive commands, e.g.

  +vc-gutter-hydra -> +vc/gutter-hydra
2019-07-22 23:51:12 +02:00
Henrik Lissner
388267d256
Add --force/-f support to doom refresh 2019-07-22 23:22:55 +02:00
Henrik Lissner
6200f5d876
Move file functions in core-lib to autoload/files 2019-07-22 23:22:55 +02:00
Henrik Lissner
be2ade62d2
Add polyfill for Emacs 26+ alist-get 2019-07-22 23:22:54 +02:00
Henrik Lissner
0eb200c49f
Refactor package! macro 2019-07-22 23:22:54 +02:00
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
23d111132a
Update core-packages.el comments 2019-07-22 23:22:54 +02:00
Henrik Lissner
afebdb35da
Refactor autodef generator 2019-07-22 23:22:54 +02:00
Henrik Lissner
a301330603
Fix doom update #1584
It would no-op if you responded "y" to the 'update them?' prompt, and
proceed if you responded "n".

Doom must be in its rebellious phase.

Also relevant: #1585
2019-07-22 23:22:38 +02:00
Henrik Lissner
22404f1ec5
Fix "nil is not any command *I* know"
What good is sass if it isn't right?
2019-07-22 22:34:08 +02:00
Henrik Lissner
781783fe85
Refactor doom-module-from-path
Now returns (:core) or (:private) for files in doom-core-dir and
doom-private-dir, respectively, and will otherwise return the module for
the current file if called with no arguments.

Also fixes the case where it would disregard arguments and return
whatever the current value of doom--current-module.
2019-07-22 22:34:08 +02:00
Henrik Lissner
457b542795
Fix void-variable next error
And change TARGETS to PACKAGE, which is a more descriptive name.

Mentioned in #374
2019-07-22 18:57:17 +02:00
Henrik Lissner
d8dbb90931
Add core plist library 2019-07-22 18:04:50 +02:00
Henrik Lissner
0c678ee762
Refactor after! macro
The trouble with with-eval-after-load is it arranges for the body to be
byte-compiled, whereas eval-after-load does not. I won't go into how
they do that here, but it causes us some trouble:

Macro calls in with-eval-after-load are eagerly (immediately) expanded
at startup, whether or not the package or macro is available and
regardless of its execution path.

This sucks for Doom because, when expanded, autoloaded macros will be
loaded, along with whatever baggage they've got with them, and this
happens long before they're actually used. We also can't guarantee those
macros are available at startup, which will cause void-function errors
when the interpreter later treats them like an ordinary function call.

So, the simple fix is to pass a quoted body form to eval-after-load
instead of the closure that with-eval-after-load will wrap it in. This
means the body won't get byte-compiled if we compile our config, but in
exchange, macros stay lazy-loaded until they're finally needed!
Wonderful.
2019-07-22 14:49:25 +02:00
Henrik Lissner
4c70cfd102
Fix hash-table-p errors loading projectile
I was reading from a file without making sure it exists!
2019-07-22 06:28:32 +02:00
Henrik Lissner
ffdb726ed8
Exclude gh.el from autoloads
See sigma/gh.el#95
2019-07-22 06:06:58 +02:00
Henrik Lissner
6f878a38bd
Fix incorrect path to init.example.el 2019-07-22 04:48:44 +02:00
Henrik Lissner
1c4215c187
Fix 'command not found' errors for hidden commands 2019-07-22 04:46:14 +02:00
Henrik Lissner
e9e6786dd3
Fix file-missing cli/quickstart error 2019-07-22 04:22:42 +02:00
Henrik Lissner
879ab3b2f3
Replace incorrect usage of doom-dir with doom-path 2019-07-22 04:20:52 +02:00
Henrik Lissner
76bb892a0c
Move cli/quickstart -> cli/install 2019-07-22 04:16:47 +02:00
Henrik Lissner
d2fa1a3dd1
Load seq in core-cli 2019-07-22 04:15:45 +02:00
Henrik Lissner
ea65f82e4d
Fix void doom-package-list error on first install 2019-07-22 03:48:29 +02:00
Henrik Lissner
b465500a27
Improve smartparens config and comments 2019-07-22 02:38:20 +02:00
Henrik Lissner
82bcc2a68f
Disable straight+use-package integration
They won't be loaded together, and shouldn't be used anyway, what with
Doom's package management system.
2019-07-22 02:37:48 +02:00
Henrik Lissner
d980920c97
cli/packages: fix rebuild ignoring argument 2019-07-22 02:37:48 +02:00
Henrik Lissner
a7ce48c2df
bin/doom: add -l/--local/DOOMLOCALDIR
Will come in handy for the new testing framework.
2019-07-22 02:37:48 +02:00
Henrik Lissner
ff7fe6af9f
cli/doctor: fix stringp error if fd isn't installed 2019-07-22 02:37:47 +02:00
Henrik Lissner
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
Henrik Lissner
71ba4789ca
Fix hash-table-p errors on reloading pkg autoloads
Because doom-modules wasn't set in doom-module-path's scope.
2019-07-22 02:37:44 +02:00
Henrik Lissner
c7ce21af70
Fix prefix arg for doom/switch-to-scratch-buffer
Also use clearer name for prefix arg var in
doom/open-project-scratch-buffer.
2019-07-22 02:30:41 +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
47216117cc
Stop reloading theme on every new frame
It was slow and unnecessary (doom-themes and solaire-mode support
terminal colors already).
2019-07-22 02:30:41 +02:00
Henrik Lissner
a0593cc097
Refactor font loading
Init extra fonts within doom-init-fonts-h. This was moved because I used
to believe that set-fontset-font (according to its documentation) could
only change the frame-local fontset. It turns out that the exception
when you pass t for its first argument, which targets the default (i.e.
global) fontset.
2019-07-22 02:30:40 +02:00
Henrik Lissner
5005721039
lang/emacs-lisp: make company-elisp use helpful
Instead of describe-*
2019-07-22 02:30:40 +02:00
Henrik Lissner
be789caa04
Add elisp demos for Doom API in helpful buffer 2019-07-22 02:30:40 +02:00
Henrik Lissner
b90dede1ab
💥 Replace package.el/quelpa with straight #374
There are a few kinks to iron out, but for the most part it's done. Doom
Emacs, powered by straight. Goodbye gnutls and elpa/quelpa issues.

This update doesn't come with rollback or lockfile support yet, but I
will eventually include one with Doom, and packages will be (by default,
anyway) updated in sync with Doom.

Relevant threads: #1577 #1566 #1473
2019-07-22 02:30:40 +02:00
Henrik Lissner
492f2dea1e
core-lib: add nconcq! macro 2019-07-22 02:30:40 +02:00
Henrik Lissner
e8ecf65cf9
core-lib: add pushmany! macro, refactor pushnew! 2019-07-22 02:30:40 +02:00
Henrik Lissner
0a84d2f0a9
core-lib: add auto-minor-mode, revise def-project-mode!
- Adds the auto-minor-mode package to replace our in-house
  implementation.
- Merges associate! into the def-project-mode! macro because associate!
  on its own is less useful than auto-minor-mode-alist,
  auto-minor-mode-magic-alist or hooks.
- Changes the semantics of :modes and :add-hooks properties of
  def-project-mode!. Its arguments are evaluated as is; lists will need
  to be quoted.

squash! core-lib: remove associate! macro
2019-07-22 02:30:39 +02:00
Henrik Lissner
3404899ec3
core-lib: add doom-partial & doom-rpartial functions 2019-07-22 02:30:39 +02:00
Henrik Lissner
ee10b3b0d9
core-lib: add doom-{glob,path,dir}, replace {file,dir}!
- file! replaces FILE!
- dir! replaces DIR!
- doom-{glob,path,dir} have the power to construct paths out of the
  segment pieces provided to it.
- Move doom-files-in to core-lib and refactor to use the above.
2019-07-22 02:30:39 +02:00
Henrik Lissner
602e2f31c7
core-lib: refactor pushnew! macro
Do a little more work at expand-time.
2019-07-22 02:30:39 +02:00
Henrik Lissner
3306eaa17c
core-lib: refactor defer-until!, add-transient-hook!
Now uses an interned hook name (that could be removed, unlike the
uninterned symbol make-symbol creates).

Also, for consistency: fun -> fn

No fun allowed!
2019-07-22 02:30:39 +02:00
Henrik Lissner
b742bf086f
core-lib: add prependq! and appendq! macros 2019-07-22 02:30:39 +02:00
Henrik Lissner
0f98b5b3c2
core-lib: use projectile cache in file-exists-p!
If available.
2019-07-22 02:30:39 +02:00
Henrik Lissner
f05aa3a0b1
core-lib: add unsetq-hook! #1568 2019-07-22 02:30:39 +02:00
Henrik Lissner
987061aedd
Rewrite autoload/message.el & move to format.el
Adds new convenience macros like print! and insert!, and adds classes;
which are helper functions that can be called inline within format!,
print! et co, e.g.

  (format! "%s" (filename "/tmp/some/file")) ; => file
  (format! "%s" (relpath "/tmp/some/file" "/tmp")) ; => some/file
  (format! "%s" (dirname "/tmp/some/file")) ; => /tmp/some

Check out doom-format-class-alist for more.
2019-07-22 02:30:39 +02:00
Henrik Lissner
2df56b93a9
Add so-long package
This package kicks in if you open a file whose lines are too long.

It is built into Emacs 27+, but I've backported it for earlier users.
2019-07-22 02:30:38 +02:00
Henrik Lissner
fdcb259bcd
Major refactor of Doom core files
- Remove core-os and move many of its settings out to other core
  libraries, where they belong
- Significantly improve commenting & compartmentalization of many
  settings
- Correct some mis-named public hooks (that were named as if they were
  private)
- Move the vast majority of optimizations to "Optimizations" section in
  core.el
- Don't activate xclip-mode or osx-clipboard-mode if we're accessing
  Emacs through an SSH connection (does more bad than good there)
- Add fast-but-imprecise-scrolling = t
- Set bidi-display-reordering = 'left-to-right, at the recommendation of
  an Emacs dev. Apparently setting it to nil is undefined, as Emacs is
  designed to always assume it's set; setting it explicitly to
  left-to-right will still do what was originally intended by turning it
  off: to reduce line/text scans for bidirectional text, which gives us
  a moderate boost in general runtime snappiness
- Set inhibit-compacting-fon-caches = t on windows (where it struggles
  especially with icon fonts)
- Disables "literal" mode for very large files (because I will be
  backporting so-long.el from Emacs 27 in the next commit)
2019-07-22 02:30:38 +02:00
Henrik Lissner
81ab3dbc5d
Simplify and decouple init files
The two doom-gc-* variables in init.el couples the rest of the config to
these two files. The bulk of GC/file-handler optimization was moved into
core.el and simplified (all that idle-timer voodoo was overkill).

Also adds (setq frame-inhibit-implied-reize t) to early-init, which
speeds up startup a fair bit in some edge cases with larger fonts.

squash! Simplify and decouple init files
2019-07-22 02:30:38 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
e3a102d05a
core-lib: minor reformatting 2019-07-20 11:40:03 +02:00
Henrik Lissner
2caaec50e8
Remove cond!
Well, that was short lived, but pcase and pcase-let are superior and
already available.
2019-07-20 11:40:03 +02:00
Henrik Lissner
c3354e2620
cli: disable patch-macos (only --undo/-u works)
This has been deprecated for a while. I will remove it entirely with the 2.1
release, but for now, you can no longer patch your app bundle with this.

Use 'doom env refresh' instead.
2019-07-20 11:40:00 +02:00
Henrik Lissner
8b27d19e0b
Fix "err=[-50]" gnutls error
When updating/installing packages.
2019-07-20 11:05:52 +02:00
Henrik Lissner
24b40824ce
Add doom-{visible,buried}-buffer-p predicates 2019-07-18 13:13:31 +02:00
Henrik Lissner
103612a347
Add cond! macro to core-lib
An anaphoric cond.
2019-07-18 01:20:55 +02:00
Henrik Lissner
84d43643c9
Fix "Bad request" failures during package-refresh
Particular with elpa.gnu.org. This is caused by a known error in Emacs
26.x, which has been fixed in 27, and documented here:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34341
2019-07-15 01:00:49 +02:00
Henrik Lissner
2ff762b397
Fix fd/rtags on debian/ubuntu
On debian/ubuntu, these executables have a different name:

- fd -> fdfind
- rc -> rtags-rc
- rdm -> rtags-rdm
2019-07-14 22:04:50 +02:00
Henrik Lissner
3313058c76
Make doom-adjust-font-size non-interactive
As it was intended.
2019-07-14 20:44:16 +02:00
Henrik Lissner
0b28480a21
Remap xref-pop-marker-stack -> better-jumper
Better to have only one jumplist system.

Also remaps xref-find-* commands to +lookup commands earlier in the
startup process.
2019-07-13 15:47:19 +02:00
Henrik Lissner
57a5137b4b
Remove melpa mirror
It's fairly outdated (7 months) and only adds time to refresh process.
Need to find better mirrors or switch to straight soon.
2019-07-13 13:58:53 +02:00
Henrik Lissner
17d7130804
Fix #1558: remember position on C-a/C-e
When the cursor is between the swap points.
2019-07-12 18:19:28 +02:00
Henrik Lissner
e6540b419b
doom/set-indent-width: set standard-indent buffer-locally 2019-07-12 16:55:36 +02:00
Henrik Lissner
fddef812ec
tools/editorconfig: refactor how we ignore lisp modes 2019-07-12 16:47:49 +02:00
Henrik Lissner
f3fa1b0324
Fix editorconfig usage in doom/set-indent-width #1561 2019-07-12 16:39:00 +02:00
Henrik Lissner
527079094d
Expand docs for doom {install,update,autoremove} 2019-07-12 14:16:53 +02:00