Commit Graph

857 Commits

Author SHA1 Message Date
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
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
3313058c76
Make doom-adjust-font-size non-interactive
As it was intended.
2019-07-14 20:44:16 +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
f0abd10409
Fix #1558: doom/forward-to-last-non-comment-or-eol
Should jump to EOL if end-of-non-comment is before point.
2019-07-12 13:33:31 +02:00
Henrik Lissner
c627972d20
Add set-indent-width & toggle-indent-style commands
And SPC t I keybind

Also sorts keybinds under the SPC t prefix
2019-07-11 17:22:01 +02:00
Henrik Lissner
c99c184f85
Fix error in doom/help-packages for gnu packages
Due to validation checking for the wrong strings. Also extends support
for user-supplied archives (though the link may not be as helpful).
2019-07-09 23:30:59 +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
71d505b893
Cache doom-modules on doom refresh 2019-07-07 14:10:21 +02:00
Henrik Lissner
b58b5e1d64
Fix auto-removal of builtin-preferred packges 2019-07-07 14:07:41 +02:00
Henrik Lissner
dd4c70fe93
Add doom/reload-autoloads 2019-07-07 13:20:25 +02:00
Henrik Lissner
51c067cc4d
Fix vanilla-doom+ sandbox instance
Now initializes doom-modules correctly and suppresses an undo-tree
error.
2019-07-07 01:58:49 +02:00
Henrik Lissner
d8e7a2003b
Fix custom.el writing to DOOMDIR/init.el too early
This would cause ~/.doom.d/init.el to exist before `doom quickstart` can
copy ~/.emacs.d/init.example.el into it, causing some newcomers to
experience a wrong-type-argument: hash-table-p error at startup (and no
modules being enabled).
2019-07-02 23:17:20 +02:00
Henrik Lissner
58299341b8
Fix vanilla-doom+ launcher in sandbox (C-c C-p)
vanilla-doom+ should launch an instance of Doom with doom core plus
modules minus your private config loaded.
2019-06-30 13:18:14 +02:00
Henrik Lissner
81cf6080bf
doom/window-maximizer-buffer: fail gracefully in popups
Doesn't work within popups and it's non-trivial to fix this, so better
it fail gracefully with a suggestion, instead of fail silently.
2019-06-27 17:21:00 +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
2aa9252725
Move doom|disable-show-paren-mode to autoload/ui 2019-06-27 13:26:03 +02:00
Henrik Lissner
6317fa0435
Fix #1509: failure to resize certain popups (part 2)
doom/window-enlargen would fail silently for windows with a preserved
size (e.g. all ui/popup popup windows)
2019-06-26 23:06:46 +02:00
Henrik Lissner
9c29ad78e0
Add SHELL to doom-info 2019-06-26 14:31:07 +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
26da625981
Fix #1509: failure to resize certain popups 2019-06-26 14:28:40 +02:00
Henrik Lissner
ae365272ad
Set exec-path/shell-file-name in doom-load-env-vars
And perform file-readable-p check inside doom-load-env-vars
2019-06-18 11:46:27 +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
d27c148e14
Fix font-resizing in child frames #1500 2019-06-17 16:01:37 +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
84fd744e3f
Minor, general refactor & comment revision 2019-06-14 11:08:59 +02:00
Henrik Lissner
6641e26283
Refactor package management API
Sets out to solve a number of issues with the package management
process. Namely:

- To-be-removed packages that are simply being removed are no longer
  incorrectly labeled "quelpa->elpa", but "removed" instead.
- A backend (elpa vs quelpa) column was added to the package listing
  confirmation when running `doom update`.
- Doom now correctly recognizes that packages installed with a psuedonym
  are installed, and will not endlessly attempt to uninstall and
  reinstall them on every `doom refresh`.
- Packages declared with :built-in will no longer lose their built-in
  marking if said package is not actually present in Emacs' site load
  paths. i.e. if you say it's built in, Doom won't question it.
- package!'s :ignore property is now treated as a form whose evaluated
  result will be used as its value.
2019-06-11 08:01:42 +02:00
Henrik Lissner
158e4cc97c
Fix doom/clone-and-narrow-buffer
Also restores window scroll position after widening.
2019-06-10 09:38:57 +02:00
Siddharth Shekar
aa64cf9426 Replace kill-this-buffer with kill-current-buffer
As per the documentation for kill-this-buffer, it should only be invoked
from the menu and behaves unpredictably when invoked programmatically.
2019-05-30 18:54:58 -07:00
Henrik Lissner
390647da87
Fix case where package has no backend
In doom/help-packages
2019-05-30 13:59:39 -04:00
Henrik Lissner
c9493038a0
Auto-unbind non-prefix keys on doom/reload #1431 2019-05-28 23:47:53 -04:00
Henrik Lissner
9860cebe9f
Don't save package-selected-packages to custom-file
It's already saved in doom-package-autoload-file
2019-05-28 23:47:52 -04:00
Henrik Lissner
3d7626341f
Fix vestigial reference to load-env-vars
Was replaced with in-house envvar parser.
2019-05-28 23:47:49 -04:00
Henrik Lissner
977d587479
Bring back doom-big-font #1428
Falls back to doom-big-font-increment if doom-big-font isn't set.
2019-05-22 17:05:05 -04:00
Henrik Lissner
8f9056906d
Rethink scratch buffer keybinds & commands
For non-evil users:

<leader> x    doom/open-scratch-buffer
<leader> X    doom/switch-to-scratch-buffer
<leader> p s  doom/open-project-scratch-buffer
<leader> p S  doom/switch-to-project-scratch-buffer

For evil users:

<leader> x    doom/open-scratch-buffer
<leader> b s  doom/open-scratch-buffer
<leader> b S  doom/switch-to-scratch-buffer
<leader> p s  doom/open-project-scratch-buffer
<leader> p S  doom/switch-to-project-scratch-buffer
2019-05-20 21:09:12 -04:00
Henrik Lissner
1df35c166a
Display package homepage in doom/help-packages
If possible.
2019-05-20 21:09:11 -04:00
Henrik Lissner
9f63d94b13
Add doom/help-package-homepage command (SPC h d P) 2019-05-20 21:09:11 -04:00
Henrik Lissner
243a3a84a8
Add doom/help-news-search command (SPC h d N) 2019-05-20 21:09:11 -04:00
Henrik Lissner
8aa6273dcf
Remove org link syntax from help search commands
And prevent ivy sorting them.
2019-05-20 21:09:11 -04:00
Henrik Lissner
01face314d
Fix doom/help-* search commands
They weren't actually doing anything.
2019-05-19 02:17:59 -04:00
Henrik Lissner
2e6d8be6fc
Rethink SPC n keybinds and add new ones
Adds the following keybinds:

SPC n .    Browses org-directory
SPC n /    Text search in org-directory
SPC n *    Text search in org-directory with symbol at point
SPC n h    Jump to org headline in org-agenda-files
2019-05-17 23:57:24 -04:00
Henrik Lissner
67b6c44939
Enable show-trailing-whitespace globally
The variable is buffer-local and must be set with setq-default instead.

Also adds doom|{enable,disable}-show-trailing-whitespace hooks.
2019-05-17 01:58:08 -04:00
Henrik Lissner
40d2d4d222
Minor tweaks & byte-compiler offerings 2019-05-15 20:53:11 -04:00
Henrik Lissner
c612ba58a9
Fix stringp errors in doom/help search commands 2019-05-15 20:51:52 -04:00
Henrik Lissner
a4fb4070ea
Rework how unicode fonts are set and loaded 2019-05-15 20:24:52 -04:00
Henrik Lissner
c5a3556510
Fix interactive codes for doom/{move,copy,sudo}-this-file 2019-05-14 20:53:51 -04: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
0f0fdbc00c
Add doom/{increase,decrease,reset}-font commands
Borrows the idea from zoom-frm (see #1389).
2019-05-12 21:56:52 -04:00
Henrik Lissner
e5d566ea2a
Prevent non-prefix key errors on doom//refresh
May also help doom/reload
2019-05-12 01:43:22 -04:00
Henrik Lissner
ed562212eb
Fix & improve doom/help-package{s,-config}
The help buffer for Doom packages now display:

- locations of (and links to) where a package is configured in Doom
- limited documentation for site packages (like elisp-mode)
2019-05-08 02:08:08 -04:00
Henrik Lissner
f6dc4f6079
Fix void-function org-map-entries on doom/help-* 2019-05-08 00:56:16 -04:00
Henrik Lissner
e173fcbd54
Fix doom/help-package-config
And recenter after jumping to file.
2019-05-06 22:13:31 -04:00
Henrik Lissner
898ef11b76
Saving the world, one trailing space at a time 2019-05-02 16:20:40 -04:00
Henrik Lissner
6d314c2795
Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
Henrik Lissner
26050bb1d7
Refactor interactive CLI commands
Also fixes an issue where output wasn't colored correctly.
2019-04-26 22:11:37 -04:00
Henrik Lissner
6b69eaa397
Minor refactors across the board 2019-04-26 17:42:44 -04:00
Henrik Lissner
1ab8dac872
Fix arg-less color functions in print!/format! 2019-04-24 18:16:07 -04:00
Henrik Lissner
eb22177cea
Suppress kill-emacs-hook in noninteractive Doom 2019-04-24 18:16:06 -04:00
Henrik Lissner
cb172becd9
Make doom-get-outdated-packages synchronous
Concurrency doesn't speed this up enough to justify its problems. It
swallows errors emitted from the child processes and a child process can
block indefinitely.
2019-04-24 18:16:06 -04:00
Henrik Lissner
2066206e83
Update docstrings for config commands 2019-04-24 18:16:06 -04:00
Henrik Lissner
40f6a2b6e3
Rewrite vanilla sandbox & report-bug commands
- Renamed doom/open-vanilla-sandbox to doom/sandbox (because it's not
  just for vanilla testing anymore)
- Renamed doom/open-bug-report to doom/report-bug (for consistency with
  `report-emacs-bug`; makes it easier to discover)
- Add SPC h d b for doom/report-bug
- Add SPC h d s for doom/sandbox
2019-04-24 18:16:06 -04:00