Commit Graph

104 Commits

Author SHA1 Message Date
Henrik Lissner
8766499b0d
Fix some file permissions errors
Occurs when deferred packages are loaded while in an unreadable or
non-existent directory.
2019-08-27 00:05: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
702369e888
Move :ui tabbar to :ui tabs
And update its README.org
2019-08-11 02:05:09 -04: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
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
03a4461d3b
Indent use-package! the same as use-package 2019-07-24 16:53:33 +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
7ebc9045f2
Fix reference to renamed variable targets 2019-07-23 01:27:20 +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
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
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
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
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
71d505b893
Cache doom-modules on doom refresh 2019-07-07 14:10:21 +02:00
Henrik Lissner
faeefc1775
Add FLAG argument to doom-module-p 2019-07-07 14:07:11 +02:00
Henrik Lissner
af7a2d16c4
Clarify argument in after!'s docstring
after! takes a package, not a mode.
2019-07-06 23:22:28 +02:00
Henrik Lissner
cb783b0609
Prevent hash-table-p errors on startup 2019-07-02 23:17:20 +02:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Henrik Lissner
b245237b0c
Move custom-file to DOOMDIR/init.el
(And don't auto-load it at startup; no need)
2019-06-26 14:31:06 +02:00
Henrik Lissner
5e9c020c21
doom-files-in: replace NOSORT w/ SORT; change default MATCH
- SORT defaults to t
- MATCH's new default regexp excludes files that start with underscore.
2019-06-16 19:16:23 +02:00
Henrik Lissner
efb06ee42f
Improve deprecation warnings for modules
Hopefully makes them easier to understand.
2019-05-21 17:24:23 -04:00
Henrik Lissner
2214c3175e
Minor tweaks across the board 2019-05-21 00:34:32 -04:00
Henrik Lissner
c3cb7c5000
:tools password-store -> :tools pass
A simpler name and matches the prefix of its module.
2019-05-19 02:18:25 -04:00
Henrik Lissner
8c65a63b1c
Move eshell, term & vterm modules to :term 2019-05-19 02:17:59 -04:00
Henrik Lissner
6ea0c39137
Ensure use-package settings are set @ compile-time 2019-05-13 00:57:59 -04:00
Henrik Lissner
84c5da844b
Add email/{wanderlust,mu4e,notmuch} modules
Removed app/{email,notmuch}
2019-05-05 14:14:12 -04:00
Henrik Lissner
6d314c2795
Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
Henrik Lissner
a57d9d3a25
Change :after-call heuristic for detecting fn/hook 2019-04-30 15:12:07 -04:00
Henrik Lissner
6b69eaa397
Minor refactors across the board 2019-04-26 17:42:44 -04:00
Henrik Lissner
88406bb11a
Fix unit test runner 2019-04-24 18:16:07 -04:00
Henrik Lissner
77e4cc4d58
💥 Remove :feature category
:feature was a "catch-all" category. Many of its modules fit better in
other categories, so they've been moved:

- feature/debugger -> tools/debugger
- feature/evil -> editor/evil
- feature/eval -> tools/eval
- feature/lookup -> tools/lookup
- feature/snippets -> editor/snippets
- feature/file-templates -> editor/file-templates
- feature/workspaces -> ui/workspaces

More potential changes in the future:

- A new :term category for terminal emulation modules (eshell, term and
  vterm).
- A new :os category for modules dedicated to os-specific functionality.
  The :tools macos module would fit here, but so would modules for nixos
  and arch.
- A new :services category for web-service integration, like wakatime,
  twitter, elfeed, gist and pastebin services.
2019-04-24 18:16:04 -04:00
Henrik Lissner
ff42cf0767
Rewrite require! and change depends-on!
depends-on! was changed to no longer load a specified module's
packages.el, but to preform a module-enabled assertion. It emits an
error if the linked module isn't (or specified flags aren't) enabled.
2019-04-21 19:40:02 -04:00
Henrik Lissner
03b76e1789
Fix deprecated modules not passing on their flags
Also fixes redundant deprecated-module warnings from 'bin/doom refresh'.
2019-04-21 18:54:57 -04:00
Henrik Lissner
3e74b339c7
Revise featurep! docstring & error message 2019-04-20 02:18:49 -04:00
Henrik Lissner
79ee09d65b
Replace :ui evil-goggles w/ :ui ophints
Now offers op hinting for non-evil users.
2019-04-19 17:26:26 -04:00
Henrik Lissner
31eb845f6b
Reset more state on doom/module initialization
Makes `doom/reload` a little more reliable and the side effects of
`doom-initialize`/`doom-initialize-modules` a little more deterministic.
2019-04-09 03:43:13 -04:00
Henrik Lissner
defd60b24b
Fix doom quickstart not installing packages
If the user had no ~/.doom.d/init.el to begin with, and never reads it
after it's been created (by `doom quickstart`), then Doom can't possibly
know what modules to install packages for, therefore no packages get
installed!
2019-04-09 03:31:05 -04:00
Henrik Lissner
f9b6f6746f
General, minor refactor/reformatting 2019-04-08 23:03:19 -04:00
Henrik Lissner
390edee702
ui/fci -> fill-column: replace fci w/ hl-fill-column
fci was buggy, slow and presented numerous incompatibilities with other
modes. It is also unmaintained.

Relevant to #1045
2019-04-01 13:44:20 -04:00
Henrik Lissner
d7e9b47266
Fix #1278
Refactors :after-call to not fmakunbound the transient hook function, as
it may get executed multiple times before getting a chance to fully
remove itself, causing void-function errors.
2019-03-22 14:11:59 -04:00
Henrik Lissner
b0bc1d925f
Minor refactors; revise docstrings+comments 2019-03-09 19:56:47 -05:00
Henrik Lissner
17714c2c63
Refactor Doom use-package extensions 2019-03-09 19:56:45 -05:00
Henrik Lissner
748b197676
Minor, general refactors 2019-03-08 04:25:45 -05:00
Henrik Lissner
a443d9ab07
Refactor doom-initialize-packages & package API
- Packages are initialized once, when package.el is first loaded, and
  must be updated manually via doom/reload-packages.
- Package->module association is now stored in the package's PLIST under
  :modules. This is an internal property and cannot be explicitly set
  through `package!'
- Add doom-package-list function
- Rename doom-get-packages to doom-find-packages
- Updated doom-find-packages' docstring
- Added the :core filter to doom-find-packages
- Simplified doom-initialize-packages
- doom/reload calls doom/reload-packages if necessary.
- Fix redundant properties in doom-packages
- Remove tracking of after!, def-package! and def-package-hook! blocks.
  Replaced with doom-package-list being able to see all packages, even
  in disabled modules.
- Add :built-in property to package! for dummy packages. This is
  important so that doom/describe-package can see built-in packages.
2019-03-08 04:25:44 -05:00
Henrik Lissner
917d89da87
Refactor module init hooks
Also adds doom-after-init-modules-hook for consistency, which is an
alias to after-init-hook until I decide if it's necessary for it to be
independent.
2019-03-08 02:37:33 -05:00
Henrik Lissner
cfa97470fc
Add links to config files in describe-packages
Also dims packages that aren't installed.
2019-03-05 01:55:40 -05:00
Henrik Lissner
05303c0fdb
💥 Rethink core hook order & naming
- doom-post-init-hook was renamed doom-init-modules-hook
- doom-init-hook was renamed doom-before-init-modules-hook
- doom-init-modules-hook now runs before the user's config.el is run
- Moved doom-init-ui-hook to run later (on window-setup-hook rather than
  emacs-startup-hook).

Yield a modest improvement in startup times.
2019-03-04 20:47:26 -05:00
Henrik Lissner
f6cc2644b0
New doom-log macro for debug-time logging
doom-log won't interfere with the minibuffer if it's in use, and will
report the originating module.

Addresses #1215
2019-03-04 18:38:25 -05:00