Commit Graph

920 Commits

Author SHA1 Message Date
Henrik Lissner
c360f0dceb
Minor refactor & comment/docstring revision 2019-10-26 23:44:28 -04:00
Henrik Lissner
1dd73b7486
Integrate helpful into doom/describe-active-minor-mode 2019-10-26 13:30:53 -04:00
Henrik Lissner
d0ae6c9bda
Merge module list into doom/help-search 2019-10-26 02:12:58 -04:00
Henrik Lissner
592c548b24
Fix ref to renamed function in doom/help-* helper
And improve their UX by displaying a loading message while Doom crawls
the headings.
2019-10-26 02:12:58 -04:00
Henrik Lissner
7c54478335
Ensure doplist! has no side effects 2019-10-26 02:12:58 -04:00
Henrik Lissner
9f8277b2c4
Correct doom/reload-autoloads docstring 2019-10-25 20:25:20 -04:00
Henrik Lissner
9936bd9623
Add 'SPC h d {k,i,c}'
For jumping to init.el, config.el and packages.el
2019-10-25 20:25:20 -04:00
Henrik Lissner
f516d4c342
Fix package! mutating package state at expansion time
Fixes an issue where package! declarations were read unconditionally at
compile time, whether or not they were on a reachable code path. e.g.
evil is always disabled by:

  (when nil
    (package! evil :disable t))
2019-10-25 02:38:15 -04:00
Henrik Lissner
ee80ed680c
Defer evaluation of custom-set-faces!'s arguments
...until the theme has first loaded.

You'll need to set `doom-theme` to nil if you want to use this macro
without a theme!
2019-10-24 19:43:10 -04:00
Rudi Grinberg
ac58eaf031 Add comment to search loaded .el files
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2019-10-23 14:41:12 +09:00
Henrik Lissner
0df480bf85
Bind 'SPC h d l' for text-searching load-path
Co-authored-by: Rudi Grinberg <139003+rgrinberg@users.noreply.github.com>
2019-10-23 00:51:09 -04:00
Henrik Lissner
e0469e14c0
Minor refactors & reformatting across the board 2019-10-20 19:57:27 -04:00
Henrik Lissner
a8cc68e00b
Add doom/homepage command
Not that the site exists yet, but I'm tired of having all these tidbits
of uncommitted code laying about. It'll exist eventually!
2019-10-20 15:14:37 -04:00
Henrik Lissner
c109acd6fd
Optimize doom-visible-buffers
Walking the window list is almost always faster than walking the buffer
list.
2019-10-20 10:58:53 -04:00
Henrik Lissner
c8efb45746
Add doom-{file,directory}-size file functions 2019-10-19 14:38:56 -04:00
Henrik Lissner
679b16a22e
Fix doom-exec-process not returning output 2019-10-19 02:34:57 -04:00
Henrik Lissner
f2cd5bdf97
Add doom-{call,exec}-process functions & let-cliopts! macro
Needed for 3e947d39b and for upcoming CLI rewrite.
2019-10-17 14:38:00 -04:00
Henrik Lissner
8b57226634
doom/toggle-debug-mode: affect jka-compr-verbose & lsp-log-io 2019-10-17 02:36:19 -04:00
Henrik Lissner
24b336322c
Fix doom/kill-buried-buffer closing windows
By making doom/kill-all-buffers less gung ho about deleting windows when
the buffer list is empty.
2019-10-14 18:48:42 -04:00
Henrik Lissner
da7aef9a4c
Move --restore handler to init.el #1893 2019-10-14 02:54:29 -04:00
Rudi Grinberg
55e00bbd26 re-search-forward to search-forward when no re
When no regular expression is present, it's faster and simpler to use
search-forward

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2019-10-13 12:25:41 +09:00
Henrik Lissner
30c091d3f5
Fix non-string args to file-exists-p! macro 2019-10-12 00:48:48 -04:00
Henrik Lissner
82167ab48a
Remove :lang vala module
To small to warrant a module and vala-mode is unmaintained. It's trivial
for end users to install it themselves.
2019-10-10 21:31:13 -04:00
Henrik Lissner
a3fa1e07b1
Refactor doom/kill-*-buffer commands 2019-10-10 16:11:42 -04:00
Henrik Lissner
9e3974d2f3
doom/help-faq: restrict to second-levels headings 2019-10-10 16:11:41 -04:00
Henrik Lissner
d9945d8964
autoload/format: add doom-format-indent-increment 2019-10-07 12:57:18 -04:00
Henrik Lissner
fa051797f2
Move --restore handler to autoload/sessions 2019-10-07 12:56:53 -04:00
Henrik Lissner
297728bf74
Generalize doom-file-cookie-p
And move it to doom-file-cookie-p for anyone to use.
2019-10-04 22:42:53 -04:00
Henrik Lissner
38e445afe7
Fix #1831: typo & extra args in doom/toggle-narrow-buffer 2019-09-27 11:34:21 -04:00
Henrik Lissner
4a8cef56ea
Fix doom/info omitting flags on some modules 2019-09-26 21:57:55 -04:00
Henrik Lissner
22e3dfa677
Update doom/reload-env
To use `doom env` instead of `doom env refresh` (which is deprecated)
2019-09-26 14:26:47 -04:00
Henrik Lissner
e10cd8cf2e
Insult byte-compiler's mom
Yeah, that shut him up.
2019-09-20 23:10:53 -04:00
Henrik Lissner
5f7add8360
Update doom/reload-{theme,font}
To reflect changes introduced in 17174e143
2019-09-20 19:52:55 -04:00
Henrik Lissner
ac87e3d517
Merge pull request #1784 from flatwhatson/many-faces
Fix the multi-face form of custom-set-faces!
2019-09-15 01:43:56 -04:00
Henrik Lissner
fff4968da9
Change how doom/info lists private packages 2019-09-14 18:27:58 -04:00
Henrik Lissner
c8cd94a5d2
Add window-system & daemonp props to 'doom info' 2019-09-14 18:27:58 -04:00
Andrew Whatson
f23a833f31 Fix the multi-face form of custom-set-faces! 2019-09-15 02:09:58 +10:00
Henrik Lissner
f9190c08bf
Remove unused argument in doom/narrow-buffer-indirectly 2019-09-14 01:55:53 -04:00
Henrik Lissner
6bef031e25
Bind SPC b - to doom/toggle-narrow-buffer 2019-09-14 01:55:16 -04:00
Henrik Lissner
4c0eb989fb
Fix duplicate paths in initial input for doom/save-session
Forgot to do this in 3e3808aa8
2019-09-13 22:00:34 -04:00
Henrik Lissner
31ccd9be78
Replace vestigial references to def-package!
def-package! is deprecated and is replaced with use-package! to reduce
confusion about its purpose and connection to use-package.
2019-09-13 22:00:34 -04:00
Henrik Lissner
8ad8b5d8ad
Make narrow/widen commands incremental
Doom's narrow/widen commands will now narrow/widen incrementally (using
indirect buffer clones). If the prefix arg is passed to the widen
command, kill all indirect buffers and widen the parent buffer.
2019-09-13 01:58:27 -04:00
Henrik Lissner
5e6c2205b8
Bind to zn/zN to new narrow/widen (indirect) commands 2019-09-13 00:28:08 -04:00
Henrik Lissner
3e3808aa8d
Fix duplicate paths in initial input for doom/load-session 2019-09-12 17:25:54 -04:00
Henrik Lissner
9d775ca798
Autoload format library
If you byte-compile your config, the expanded forms of this library's
macros (like print! or format!) will use internal functions that aren't
autoloaded (like `doom--format`, mentioned in #1768), causing
void-function errors.
2019-09-09 13:59:13 -04:00
Henrik Lissner
4bc65a3f78
Prevent C-c C-p sandbox from loading private modules
And don't change doom-private-dir, as it isn't necessary and it affects
the purity of the test environment.
2019-09-06 15:37:40 -04:00
Henrik Lissner
d665c7173a
Remove esup
Because esup is fundamentally incompatible with Doom, we are removing
it. Hopefully we can replace it later down the road.
2019-09-06 00:15:13 -04:00
Henrik Lissner
44ef61a7f7
Fix doom/help-packages 2019-09-03 16:53:41 -04:00
Henrik Lissner
52b6c51914
Read packages.el files directly for doom-info
This is a little more accurate and affects less state of the current
session.
2019-09-03 00:38:29 -04:00
Henrik Lissner
4b736bef68
Introduce doom-interactive-mode
As soft inverse alias for noninteractive; this makes it easier to unit
test functionality that depends on the session type.
2019-09-03 00:37:30 -04:00
Henrik Lissner
7727920629
Rewrite doom/reload 2019-08-28 15:19:58 -04:00
Henrik Lissner
464ebabc2a
Add warning to doom/reload (SPC h R) 2019-08-28 12:40:59 -04:00
Henrik Lissner
a5096ff86b
Add ELPA packages to doom info output 2019-08-27 00:05:12 -04:00
Henrik Lissner
aff5cc5b28
Move file-exists-p! to core/autoload/files.el 2019-08-22 13:03:12 -04:00
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
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
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
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
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
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
48415edce3
Fix #1644: --restore switch not recognized 2019-08-08 23:30:16 -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
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
eb0ae8622c
Fix file paths in comment headings 2019-08-06 14:45:55 -04: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
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
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
Henrik Lissner
a6d77e951f
Move doom-run-all-startup-hooks-h to autoload/debug.el 2019-07-28 02:32:25 +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
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
1a72cf0677
Minor, general refactors to package API 2019-07-26 20:17:30 +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
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
Henrik Lissner
6f56b9f9d4
Add autoload/themes.el library 2019-07-23 14:31:00 +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
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
6200f5d876
Move file functions in core-lib to autoload/files 2019-07-22 23:22:55 +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
d8dbb90931
Add core plist library 2019-07-22 18:04:50 +02:00
Henrik Lissner
ea65f82e4d
Fix void doom-package-list error on first install 2019-07-22 03:48:29 +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
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
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
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
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
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
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
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