Commit Graph

859 Commits

Author SHA1 Message Date
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
Henrik Lissner
fa7f7042b0
Add and expand doom/help* commands
Adds the following commands:

- doom/help (opens the Doom manual)
- doom/help-search (for searching through org headlines in Doom's
  documentation)
- doom/help-faq (for searching the FAQ)
- doom/help-news (for browsing the Doom newsletters)
- doom/help-autodefs (renamed from doom/describe-autodef -- for looking
  up documentation on autodef function/macros, like
  `set-lookup-handler!`)
- doom/help-modules (renamed from doom/describe-module, for jumping to a
  Doom module's documentation)
- doom/help-packages (renamed from doom/describe-package and recently
  fixed -- looks up information about installed packages, including what
  Doom module(s) install it and where it is configured)
- doom/help-package-config (for searching and jumping to any block where
  a package is configured in Doom Emacs)

Also adds the SPC h d (or C-h d) prefix for Doom-specific help commands.
SPC h D will invoke doom/help.

However, the documentation itself hasn't been committed yet, so some of
these commands may be useless atm. Sorry!
2019-04-24 18:16:06 -04:00
Henrik Lissner
9bea168cc1
Rewrite doom-doctor
- Use message library instead of reinventing the wheel
- Fix -d/--debug support for `bin/doom doctor`
- Add indent and autofill support to print! and format!
- Add doom-message-backend for forcing format! to use a specific backend
- Phase out anaphoric when! macro in doctor scripts, it was hardly used
2019-04-24 18:16:05 -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
123f7174ed
Revise docstrings for scratch buffer commands 2019-04-19 20:50:53 -04:00
Henrik Lissner
99c26e2fc2
Allow doom-project-find-file on arbitrary paths
- If DIR is not in a valid project, index it as normal and do
  projectile-find-file from current directory (but do not cache).
- If DIR is a valid project, but not the project root, fall back to
  different mechanism for exploring it (project-find-file,
  counsel-file-jump, or find-file).
- If DIR is a valid project AND is the project root, use
  projectile-find-file as normal.

This is to make doom-project-find-file more do-what-I-mean.
2019-04-19 20:48:48 -04:00
Henrik Lissner
1136e9f49b
Improve doom/describe-module
Opens module's README.org, if present, otherwise it prompts if you want
to browse the module's root.
2019-04-17 18:37:52 -04:00
Henrik Lissner
863fc1a6bb
Add buffer-live-p check to doom-real-buffer-p 2019-04-17 11:29:41 -04:00
Henrik Lissner
6cd30c926b
Persist scratch buffer across sessions
- Adds doom/open-project-scratch-buffer (persistent project scratch
  buffers)
- Prefix arg = open scratch buffer in current window, for both
  doom/open-scratch-buffer and doom/open-project-scratch-buffer.
- Rename doom/delete-scratch-files ->
  doom/delete-persistent-scratch-file
- Remove doom-scratch-buffer-display-fn
- Rename doom-scratch-files-dir -> doom-scratch-dir
- Add SPC p s keybind to open project scratch buffer
2019-04-17 11:15:56 -04:00
Henrik Lissner
20a63a35ab
Reformat doctor output & add DOOMDIR check
- Will now warn you if both .doom.d and .config/doom exists.
- Include branch and last commit date in doctor/info, next to Doom
  version.
- Issues in Doom core are now indented.
2019-04-16 20:57:03 -04:00
Henrik Lissner
f37b1342a2
Don't show hostname in doom info or doctor output
It doesn't help me, and some folks may not want it publicized.
2019-04-16 20:57:03 -04:00
Henrik Lissner
4724d0a109
Fix #1323: void-variable projectile-project-root 2019-04-11 18:29: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
d3a12a3914
Refactor projects api
Improves correctness of projectile project state. Namely, prevents
projectile-project-root from poisoning the return value of
doom-project-root or doom-project-p, which may be causing an elusive bug
where doom-project-find-file is searching the wrong directory.
2019-04-09 03:13:18 -04:00
Henrik Lissner
a4283427f5
Fix autoloaded hydras
They weren't marked as interactive, making them unavailable for `M-x` or
keybinds.
2019-04-07 16:06:52 -04:00
Andrew Whatson
fe6dfb08b6 Add doom/kill-project-buffers command
Prompts for an open project and kills all its buffers.  This is useful
for closing `.emacs.d` in an effort to get some *billable* work done.

Added `doom-fixup-windows` and `doom-kill-buffer(s)-fixup-windows`
helper functions for leaving affected windows on a real buffer or the
fallback buffer.

Fixed `doom/kill-this-buffer-in-all-windows` to properly "fixup"
windows.
2019-04-05 16:04:26 +10:00
Henrik Lissner
23467374f5
Fix doom/forward-to-last-non-comment-or-eol #1306
This command would no-op if used in major modes with "fake" comments.
i.e. modes where "comments" are merely highlighted as comments, but have
no comment entry in its syntax table. e.g. text-mode + git-commit-mode.
2019-04-04 15:13:48 -04:00
Henrik Lissner
34e3985409
Remove doom/open-env
This file shouldn't be edited by hand anyway.
2019-04-02 20:09:44 -04:00
Henrik Lissner
fd48329c36
Reset exec-path/shell-file-name on doom/reload-env 2019-04-02 00:55:43 -04:00
Henrik Lissner
803ca2863a
Use resolved, absolute paths in doom-project api
Ensures projectile caches files under the right key.
2019-03-28 19:57:34 -04:00
Henrik Lissner
ece7b8fdcd
Fix doom-project-find-file on non-project DIRs
This function should be as DWIM as possible.
2019-03-28 15:07:14 -04:00
Henrik Lissner
2dc52bc9be
💥 Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.

Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
  commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)

The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.

+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
  running `doom env enable` (`doom env clear` will reverse this and
  delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
  file. You won't need it if you're confident Emacs will always be
  started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
  doom/reload-env`. Note: this won't work if the Emacs session you're
  running it in doesn't have a correct SHELL set. i.e. don't use this to
  create your first env file!

The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.

This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 01:56:09 -04:00
Henrik Lissner
ab616cfb95
Merge pull request #1247 from jdnavarro/develop
Maximize window vertically/horizontally
2019-03-26 03:45:52 -04:00
Henrik Lissner
c2d0cae6a5
doom-project-find-file: avoid helm-projectile #1274
helm-projectile-find-file misbehaves as a workspace project-switch
handler (likely because it runs asynchronously and misses the lexical
value of `default-directory`), so we avoid it and use
projectile-find-file directly (which still uses helm, just not the
helm-projectile package).
2019-03-26 03:38:37 -04:00
Danny Navarro
d589f87253 Add maximize window key bindings
This includes maximization for entire buffer, vertically and
horizontally.
2019-03-24 14:47:55 +00:00
Henrik Lissner
cc20b28c26
Restore session later on restart-and-restore
So Doom has enough time to initialize before tryhing to restore the last
session.
2019-03-22 14:14:03 -04:00
Henrik Lissner
9befc015bb
Prompt to restart after doom//upgrade 2019-03-22 14:13:35 -04:00
Henrik Lissner
259590d54e
Remove doom|protect-visible-buffer
This behavior is now isolated to kill-this-buffer.
2019-03-16 23:59:50 -04:00
Henrik Lissner
689a3bb446
Remove :modules from private packages in doom/info
Unnecessary bulk.
2019-03-16 23:59:50 -04:00
Andrew Whatson
a086e6967e Fixes for doom/kill-this-buffer-in-all-windows
This was erroring when run inside a popup (eg. `M-x ielm` `C-x k`) due
to a missing check for `window-live-p`.  We don't need to do anything if
the window has already gone away.

The real vs unreal check was backwards; we should only try
`previous-buffer` if the current buffer is *not* real.
2019-03-17 00:53:17 +10:00
Henrik Lissner
82622c2d8f
Fix package.el command substitutions
doom//autoremove and doom//install are more appropriate replacements for
package-autoremove and package-install-selected-packages, respectively.
2019-03-14 17:59:24 -04:00
Henrik Lissner
5e5ae456bb
Replace doom/what-face with describe-char
describe-char produces the same information and much more.
2019-03-13 01:37:55 -04:00
Henrik Lissner
bca814cb7c
Fix listp error when updating #1235
The async process wasn't mapping through doom-package-outdated-p, only
filtered.

Also ensure no less than two packages per thread are checked.
2019-03-12 11:50:27 -04:00
Henrik Lissner
b618025e1d
Merge pull request #1237 from flatwhatson/fix-toggle-debug
Fix doom/toggle-debug-mode
2019-03-12 11:29:51 -04:00
Andrew Whatson
7b4afa32e4 Improvements to apropos and describe-symbol
Patch the apropos button types so they call helpful instead of the
built-in describe functions.  Also add some bindings to apropos-mode-map
so it behaves like other help modes.

Add `doom/describe-symbol` function, which shows documentation for
callable and variable symbols.  If a symbol is both a variable and a
callable, it dispatches to apropos.  This gives a better workflow than
`helpful-symbol`, which annoyingly prompts the user.

Remap `describe-symbol` to `doom/describe-symbol`, and update
`+emacs-lisp-lookup-documentation` to call it also.
2019-03-12 18:52:24 +10:00
Henrik Lissner
867f94e23a
Refactor doom-get-outdated-packages
May address #1235
2019-03-11 18:46:52 -04:00
Andrew Whatson
f065ddfdaa Fix doom/toggle-debug-mode
Previously this would error due to undefined `doom-debug-on-error`
variable.  Now behaves like a minor-mode function to toggle both
`doom-debug-mode` and `debug-on-error`.
2019-03-10 22:56:53 +10:00
Henrik Lissner
c3a9828fa3
Allow doom-package-list to scrape *all* packages
Even ones that are conditional. This does mean its plist is unevaluated,
however.
2019-03-10 08:10:59 -04:00
Henrik Lissner
681d0f1a2a
Improve vanilla sandbox
Can now launch four different sessions:

1. Vanilla Emacs
2. Vanilla Doom (only Doom core)
3. Doom core + modules - private config
4. A full Doom session (load everything)
2019-03-09 04:53:14 -05:00
Henrik Lissner
ca9a2c8c17
Refactor interactiove bin/doom commands #1220 2019-03-09 04:28:25 -05:00
Henrik Lissner
bb9cbfecc9
Improve interactive bin/doom commands #1220
Now prints to a buffer rather than in echo-area. Still experimental
however.
2019-03-09 03:53:38 -05:00
Henrik Lissner
cec2b4e9bc
Add doom/toggle-debug-mode command 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
44de995ca5
config/default: change SPC h keymaps
SPC h now maps to help-map to reduce redundancy. Some adjustments and
additions were made to this map so all users (evil and vanilla) can
benefit from Doom's extra help commands.
2019-03-08 02:37:33 -05:00
Henrik Lissner
a05b1877be
Rewrite switch-{buffer,window} hooks
+ Add doom-switch-frame-hook
+ Replace doom-{enter,exit}-{buffer,window}-hook with
  doom-switch-{buffer,window}-hook
+ New switch-buffer hooks run on buffer-list-update-hook rather than
  in select-window advice.
+ Blank our buffer-list-update-hook in some places to reduce how many
  times it gets triggered.
2019-03-08 02:37:33 -05:00
Henrik Lissner
31688c921d
Refactor doom-get-outdated-packages
Partitions quelpa packages so there are 4 threads tops.
2019-03-08 02:34:26 -05:00
Henrik Lissner
884957bdc6
Refactor format! macro
By removing the cl-flet call, we reduce the size of backtraces produced
during bin/doom commands by a whopping 80%. Noice.

Also renames doom-ansi-apply -> doom-color-apply
2019-03-07 18:26:44 -05:00
Henrik Lissner
c1beb39c5b
Rename doom/describe-setters -> doom/describe-autodefs 2019-03-05 01:55:40 -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
6a4682f3f1
Change doom/describe-module to browse module
Instead of opening its README.org, which may or may not exist.
2019-03-05 00:04:30 -05:00
Henrik Lissner
fbcb4e6973
Minor refactor across the board 2019-03-04 20:47:26 -05:00
Henrik Lissner
b054190820
New doom/describe-packages command
Replaces describe-packages and adds Doom module awareness to package
documentation.
2019-03-04 20:47:25 -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
Henrik Lissner
b98f34d1fd
Add :killb & doom/kill-buried-buffers
Also fix reported killed-buffer count when invoking kill commands
interactively.
2019-03-04 14:07:34 -05:00
Henrik Lissner
f0ad9b7585
Ensure explicitly installed pkgs are user-selected 2019-03-04 04:57:07 -05:00
Henrik Lissner
66d23e39bb
Fix doom/move-this-file not opening renamed file 2019-03-03 02:17:42 -05:00
Henrik Lissner
80607ff033
Confirm quit on doom/restart-and-restore 2019-03-02 03:06:29 -05:00
Henrik Lissner
d46bb287ae
General refactor of Doom core
- Code reduction and refactor across the board (cull unneeded minor
  advise, hooks and hacks or update them)
- Revise outdated comments and docstrings
- Reorganize core autoload libraries
- Remove large file check (Emacs already has a built-in one, which we
  augment to be even more performant when it does kick in)
- helpful.el can now be disabled completely through package!
2019-03-02 01:34:19 -05:00
Henrik Lissner
687496167a
Fix void-function projectile-relevant-known-projects
Thrown when using doom/find-file-in-other-project and
doom/browse-in-other-project too soon.
2019-03-02 01:34:19 -05:00
Henrik Lissner
8a90f29c91
Make session persistence module agnostic
They've been removed from feature/workspaces and moved into
core/autoload/sessions, which falls back to desktop.el if persp-mode
isn't present. This also offers a substantial speed up to
restart+restoring and restoring sessions in general.

Also fixes #1210, where the newly spawned frame after doom/restart
wasn't focused.

Introduces the following commands:

- doom/restart
- doom/restart-and-restore
- doom/quickload-session
- doom/quicksave-session
- doom/load-session
- doom/save-session
- +workspace/restore-last-session (alias for doom/quickload-session)

And removes

- +workspace/load-session
- +workspace/save-session
- +workspace/load-last-session (renamed to +workspace/restore-last-session)
- +workspace/restart-emacs-then-restore (replaced by doom/restart-and-restore)
- :ss (ex command)
- :sl (ex command)
2019-03-02 01:34:19 -05:00
Henrik Lissner
9b7d95f43a
Remove doom-cleanup-hook & doom/cleanup-session
These weren't reliable, often times buggy or overzealous about killing
buffers and processes. Best to do it manually or come up with a better
solution.
2019-02-26 22:57:02 -05:00
Henrik Lissner
4c35618044
Improve version check for line-numbers polyfill
Since there are early versions of Emacs [26.0, 26.1) that don't have the
new line numbers library.
2019-02-26 17:29:40 -05:00
Henrik Lissner
1b43ea50f0
Revise SPC f keybinds
- SPC f . -> counsel-file-jump or find-file
- SPC f > -> doom/browse-in-other-projects
- SPC f / -> projectile-find-file
- SPC f ? -> doom/find-file-in-other-project
- Moved doom/sudo-find-file to SPC f S

This change was made to accommodate the new
doom/browse-in-other-projects and doom/find-file-in-other-project
commands, which make it easy to jump to files in other known projects.
2019-02-26 13:21:16 -05:00
Henrik Lissner
4ccbc9c7df
Update major-mode=>module alist for help commands 2019-02-24 21:00:19 -05:00
Henrik Lissner
1758266ce4
Fix doom/describe-setters 2019-02-24 20:40:16 -05:00
Henrik Lissner
7c5eefee3e
General, minor refactoring 2019-02-24 13:58:56 -05:00
Henrik Lissner
acddf6a047
Move delete-backward-char & newline-and-indent advice
To config/default; the only place it is used.
2019-02-22 00:25:30 -05:00
Henrik Lissner
afae6e4f1d
Remove doom/toggle-comment-region-or-line
Replaced with simpler keybinds.
2019-02-21 19:13:36 -05:00
Henrik Lissner
c82faf7f10
General reformatting & minor refactors 2019-02-19 15:53:26 -05:00
Henrik Lissner
4437d80133
Add dos2unix & unix2dos conversion commands 2019-02-18 01:59:56 -05:00
Henrik Lissner
9558b5e793
copy-seq -> copy-sequence
It's a possibility that the copy-seq alias doesn't exist in certain
builds of Emacs. Better safe than sorry.
2019-02-15 20:03:57 -05:00
Sean Farley
11b4a3502a bindings: add common comment toggle
This is fairly common in most editors so let's make lives easier.
2019-01-28 23:14:14 -08:00
Luigy Leon
a3694edb15 Fix doom/update-package 2019-01-24 02:13:16 -05:00
Henrik Lissner
b6718715fe
Fix doom-big-font-mode when no frame exists
It must still be appended to emacs-startup-hook. If it's run any
earlier, doom|init-fonts will overwrite it.

Reported by @ar1a.
2019-01-21 22:19:14 -05:00
Henrik Lissner
efa577dec2
Improve error-handling in doom/update-package 2019-01-21 17:39:42 -05:00
Henrik Lissner
d80802d3c9
doom/cleanup-session: don't kill processes by default 2019-01-14 00:52:31 -05:00
Henrik Lissner
31a0ad5b95
Move doom--condition-case! to core/cli/packages
The only place it is being used
2019-01-10 15:44:42 -05:00
Henrik Lissner
81394cf733
Only prefer compiled theme on startup
...But not on doom/reload-theme or post-init load-theme calls.
2018-12-31 15:19:23 -05:00
Henrik Lissner
e9608ab939
doom-project-find-file: unset projectile-project-root
Instead of setting it default-directory, which can cause symlink
resolution issues.
2018-10-14 23:59:26 -04:00
Henrik Lissner
0ebf526e01
Fix doom/info omitting first module in each category
Discovered in #941
2018-10-12 14:07:25 -04:00
Henrik Lissner
fe425c005e
Add g-/g= keys for buffer narrowing/widening 2018-10-03 11:14:08 -04:00
Henrik Lissner
e7fc1d3290
Fix wrong-type-arg: stringp, nocache errors
Fix old usage of doom-project-name and doom-project-root.
2018-09-28 23:49:18 -04:00
Henrik Lissner
05d759fa8b doom/window-{enlargen,zoom}: assoc -> assq
A minor optimization. assq is significantly faster than assoc (not that
it matters for this incredibly insignificant use-case, but yay for
premature optimization!)
2018-09-28 21:13:28 -04:00
Henrik Lissner
461fc8e312 Refactor doom-big-font-mode
Complain if doom-font or doom-big-font aren't set.
2018-09-28 21:13:27 -04:00
Henrik Lissner
53fe7a1f04 Refactor Project API to reflect changes upstream
projectile-project-root no longer returns `default-directory` if not in
a project (it returns nil). As such, doom-project-* functions (and their
uses) have been refactored.

+ doom-project-p & doom-project-root are aliases for
  projectile-project-p & projectile-project-root.
+ doom-project-{p,root,name,expand} now has a DIR argument (for
  consistency, since projectile-project-name and
  projectile-project-expand do not).
+ The nocache parameter is no longer necessary, as projectile's caching
  behavior is now more sane.
+ Removed some projectile advice/hacks that are no longer necessary.
+ Updated unit tests
2018-09-28 21:13:27 -04:00
Henrik Lissner
4ea4754162 Add commands for using bin/doom from inside Emacs
This is experimental. I'd eventually like users to be able to management
Doom from inside Emacs, if they desire. This may be the only way to have
a decent user experience on Windows, for that matter.

Also adds a popup rule for it.
2018-09-28 21:13:27 -04:00
Henrik Lissner
4bdd6002a4
Restore projectile-project-root's old behavior
For now...
2018-09-27 21:55:19 -04:00
Henrik Lissner
aa930256b8
Update doom/reload-project for changes upstream
In projectile.
2018-09-25 23:36:54 -04:00
Henrik Lissner
377dbae3fc
Install/compile packages in order of declaration
This should fix an issue where a package A, which uses macros from a
package B, is installed before package B, causing void-function errors.

The currently known and affected packages are neotree, parinfer, and
evil-collection.
2018-09-25 11:00:30 -04:00
Henrik Lissner
cffb1d367f Update without-project-cache! macro
To match upstream changes in projectile
2018-09-22 13:15:12 -04:00
Henrik Lissner
ac63596be8 Fix doom-project-root returning nil if no project
It should return default-directory. A change upstream broke this.
2018-09-22 13:15:12 -04:00
Henrik Lissner
a65868ba89
Fix "end of buffer" errors on backspace 2018-09-21 00:52:53 -04:00
Henrik Lissner
9245e030bb
Fix doom/reload-font for XFT fonts 2018-09-20 22:22:14 -04:00
Henrik Lissner
1e710e94e3
Minor refactors
+ cl-flet* -> cl-flet
+ refactor display-line-numbers-mode
2018-09-19 19:43:32 -04:00
Henrik Lissner
a9c925c50b
Rename doom*newline-and-indent
To doom*newline-indent-and-continue-comments; to better describe what it
does.
2018-09-14 10:42:09 -04:00
Henrik Lissner
162b8dc81f
Add doom/set-frame-opacity command
I use this to play videos behind Emacs while I work.
2018-09-13 19:15:16 -04:00
Henrik Lissner
d9a9243a62 Remove unnecessary let block 2018-09-12 23:03:23 +01:00
Edwin Török
8f5d822363 make compile-core: fix warnings
It is easier to spot real problems if the code is warning-free.

Replacing `gensym` with `make-symbol` is an idea taken from here:
b44c08dd45

In defer-until!:
core-lib.el:150:19:Warning: function ‘gensym’ from cl package called at
    runtime

In add-transient-hook!:
core-lib.el:216:16:Warning: function ‘gensym’ from cl package called at
    runtime

In toplevel form:
autoload/message.el:35:1:Warning: Unused lexical variable ‘spec’

In toplevel form:
autoload/line-numbers.el:31:1:Warning: defcustom for
    ‘display-line-numbers-type’ fails to specify containing group
autoload/line-numbers.el:31:1:Warning: defcustom for
    ‘display-line-numbers-type’ fails to specify containing group
autoload/line-numbers.el:39:1:Warning: defcustom for
    ‘display-line-numbers-grow-only’ fails to specify containing group
autoload/line-numbers.el:39:1:Warning: defcustom for
    ‘display-line-numbers-grow-only’ fails to specify containing group
autoload/line-numbers.el:44:1:Warning: defcustom for
    ‘display-line-numbers-width-start’ fails to specify containing group
autoload/line-numbers.el:44:1:Warning: defcustom for
    ‘display-line-numbers-width-start’ fails to specify containing group

In toplevel form:
cli/autoloads.el:137:1:Warning: Unused lexical variable ‘type’

Preserve name of unused lexical var _type

Makes it obvious what is stored there.
2018-09-12 23:03:23 +01:00
Henrik Lissner
7b6dbe92c0
Add doom/reload-font command 2018-09-09 18:17:12 -04:00
Henrik Lissner
1b172e9f43
Better enh-ruby-mode suport in doom/describe-module & editorconfig
+ Associates enh-ruby-mode with :lang ruby for doom/describe-module
+ Enables editorconfig to detect extension-less or file-less ruby
  files (from shebang lines or file local variables).
2018-09-09 09:58:21 -04:00
Henrik Lissner
4d10c28c37
Change doom-ansi-apply, print! & format!
Color let-functions no longer take format string arguments. e.g.

  (format! (red "Hello %s" "world"))

Becomes

  (format! (red "Hello %s") "world")

The same goes for print!. Also, doom-ansi-apply now takes two arguments
instead of three.

Also merges doom-message-{fg,bg,fx} into doom-ansi-alist, and reduces
backtrace noise when errors originate from inside these macros.
2018-09-09 09:58:20 -04:00
Henrik Lissner
f7ad520ee0
doom update: prevent GC in async instances
Offers a marginal improved to outdated check times.
2018-09-09 09:58:20 -04:00
Henrik Lissner
309fd767d6
Add :deps property to doom-get-packages
Also fixes an issue where doom install wouldn't catch missing
dependnecies of desired packages.

If :dep is non-nil, doom-get-packages will include package dependencies
in the resulting package list.
2018-09-09 09:58:20 -04:00
Henrik Lissner
77d2d84e14
Refactor core-cli
Moved to separate files for better organization.
2018-09-09 09:58:20 -04:00
Henrik Lissner
49e6e68a07
Use EMACS26+ to detect native line numbers
Checking for the 'display-line-numbers symbol property is clumsy and
checking for boundp is pointless now that we have a Emacs 25 polyfill
for display-line-numbers-mode.
2018-09-09 09:58:19 -04:00
Henrik Lissner
be29623f0d
Reorganize doom core-lib & reformat autoload/ui.el
+ Move doom-files-in to autoload/files.el
+ Move doom*shut-up to autoload/ui.el
+ Reorganize autoload/ui.el
2018-09-09 09:58:19 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
84abac6b69
Remove def-menu!; use :localleader keys instead
def-menu was clumsy. We could use a better UI for refactoring commands,
but they should be available via localleader keybinds in any case.
2018-09-09 09:58:18 -04:00
Henrik Lissner
d2f9d28577
doom-project-(find-file|browse): resolve symlinks
This prevents absolute paths appearing in many find-in/browse commands,
like +default/find-in-emacsd, +default/find-in-config, or
+default/browse-project.
2018-09-09 09:58:18 -04:00
Henrik Lissner
72d8c5dd56
New doom/delete-trailing-newlines command 2018-09-01 12:30:34 +02:00
Henrik Lissner
708ad138c8
doom/sudo-find-file: don't sudo writeable files 2018-09-01 00:02:39 +02:00
Henrik Lissner
44e536e8e8
Refactor core-ui
+ Remove doom/switch-theme (replaced with an advice for load-theme)
+ Reorganize core-ui
+ Fix Emacs 26+ hl-line hack being applied for Emacs 25 users
+ Rename doom|show-whitespace-maybe to doom|highlight-non-default-indentation
+ Disable tool-bar, menu-bar and vertical-scroll-bars via
  default-frame-alist; this is a little faster than using the minor
  modes.
2018-08-31 23:44:08 +02:00
Henrik Lissner
d80e79203a
Replace delete-trailing-whitespace with ws-butler
ws-butler only strips trailing spaces on lines that have been modified.

+ ws-butler is disabled if editorconfig enables
  trim_trailing_whitespace, which resorts to delete-trailing-whitespace
  instead.
+ Updates doom|(enable|disable)-delete-trailing-whitespace hooks to use
  ws-butler-mode.
2018-08-31 13:59:12 +02:00
Henrik Lissner
edc9bf70af
Delete trailing whitespace, globally, by default
Also adds doom|disable-delete-trailing-whitespace hook, which can be
used to disable this behavior on a per-buffer basis. If you want to turn
off this global behavior:

  (remove-hook 'write-file-functions #'delete-trailing-whitespace)
2018-08-30 20:36:15 +02:00
Henrik Lissner
25cc01ce41
Fix & refactor doom/open-vanilla-sandbox
It would fail to run the new instance because the arguments send to it
were incorrectly formatted.
2018-08-30 13:29:56 +02:00
Henrik Lissner
d6695d4cf3
Update doom/toggle-line-numbers #847
Now that display-line-numbers-mode has been backported to Emacs 25, we
can use it instead of interacting with nlinum directly.
2018-08-29 02:15:51 +02:00
Henrik Lissner
6318572d10
Fix invalid marker in doom/window-enlargen #825 2018-08-27 20:07:17 +02:00
Henrik Lissner
247b219ea1
doom-project-find-file: set default-directory too #833
Be extra sure!
2018-08-26 12:00:13 +02:00
Henrik Lissner
1a6ee8e0df
Fix doom-project-find-file if $HOME is a repo #833
If HOME is a repo, projectile resolves all project roots to HOME. This
fixes any commands that rely on this project resolution by explicitly
telling them what project they're in instead.
2018-08-26 11:47:04 +02:00
Henrik Lissner
8e092b9884
Refactor doom-quit-p 2018-08-25 04:01:35 +02:00
Henrik Lissner
77838534ce
Polyfill line-number-display-width for Emacs 25
Fixes void-function line-number-display-width errors (used in
company-pseudo-tooltip-frontend).
2018-08-25 03:16:32 +02:00
Henrik Lissner
9eae0860c6
Fix doom/window-enlargen in popup windows #825 2018-08-23 17:21:42 +02:00
Henrik Lissner
1890356d11
Refactor & fix vanilla sandbox in tty Emacs
Except for Windows users. Doesn't seem to be possible to suspend and
foreground Emacs in windows' shell.
2018-08-23 16:18:56 +02:00
Henrik Lissner
12f6add329
package-initialize for doom/open-vanilla-sandbox 2018-08-23 11:27:27 +02:00
Henrik Lissner
9e08620350
Use locate-library to detect display-line-numbers
Now that display-line-numbers is polyfilled, a boundp check is useless.
2018-08-21 04:32:27 +02:00
Henrik Lissner
9a4cce8d9a
Refactor detection of native display-line-numbers 2018-08-21 04:10:18 +02:00
Henrik Lissner
a7da9a4738
💥 Rewrite line numbers system for Emacs 25
This removes the various doom-line-number* variables and replaces it
with the Emacs 26 display-line-numbers API, which I've ported to Emacs
25.x (however, it uses nlinum under the hood, and not all of
display-line-numbers options are supported).
2018-08-21 03:34:39 +02:00
Henrik Lissner
4618b7afad
Refactor & reformat core-ui 2018-08-21 02:56:54 +02:00
Henrik Lissner
6b7f97f4fc
Autoload doom-quit-p & revise its docstring 2018-08-20 23:56:56 +02:00
Henrik Lissner
480378d30c
Fix doom/info in noninteractive sessions 2018-08-16 01:26:28 +02:00
Henrik Lissner
5714ff423a
Fix evil jumplist after jumping to ag match
helm-ag would formerly add multiple entries to the jump list. It now
only adds one, and recenters the window when jumping to an ag match.
2018-08-13 21:47:55 +02:00
Henrik Lissner
b149dcffd4
Replace esup with doom/profile-emacs #788
Since esup (called directly) doesn't work with Doom.
2018-08-13 03:50:17 +02:00
Henrik Lissner
25d9786edf
Add early-init-file support to doom/profile-emacs #788
And fix wrong-type-argument: stringp errors when running esup.

Also ensure that doom|run-all-startup-hooks sets after-init-time.
2018-08-13 03:47:33 +02:00
Henrik Lissner
c530866f0a
Add option to load doom in vanilla sandbox
This adds the option to run elisp in an environment where doom core &
modules are loaded, but not your private modules or config.

Also updates the vanilla sandbox text template.
2018-08-12 02:45:01 +02:00
Henrik Lissner
9ddfca44d1
Rename doom//reload-project -> doom/reload-project
Conform command to new naming convention (removed the doom//abc
convention).
2018-08-11 21:45:53 +02:00
Henrik Lissner
43e0314e86
Add doom/switch-theme; a more sensible load-theme
load-theme doesn't disable previously enabled themes before switching.
doom/switch-theme does.

This remaps any keys bound to load-theme to doom/switch-theme.
2018-08-11 01:59:37 +02:00
Henrik Lissner
d6f89aaafd
Make doom/copy-backtrace copy the whole backtrace 2018-08-10 19:13:31 +02:00
Henrik Lissner
2ee177d588
Don't invoke debugger on "Aborted" messages 2018-08-02 16:41:19 +02:00
Henrik Lissner
6d1512c2e2
Refactor doom/reload
+ Remove non-interactive use-case (no more relying on the server; too
  unstable).
+ Ensure autoloads are properly reloaded (and thus, the load-path is
  properly repopulated).
+ Provide feedback when it's finished
2018-08-02 14:17:53 +02:00
Henrik Lissner
c33de42dce
Don't use uname in doom/info on windows 2018-07-17 18:29:43 +02:00
Henrik Lissner
b7eeaa4525
Improve docstring for doom/copy-backtrace 2018-07-14 19:33:47 +02:00
Henrik Lissner
7ed9c5196f
Add doom/copy-backtrace command 2018-07-13 13:00:42 +02:00
Henrik Lissner
ee91748613
Document doom-cleanup-hook 2018-07-07 13:14:50 +02:00
Henrik Lissner
1530cdbdb6
Fix vanilla sandbox creating too many temp files
On every execution.
2018-07-03 03:41:08 +02:00
Henrik Lissner
537cc9e1ed
Rewrite doom-real-buffer-p; require first arg
Because of how widely used this function is, I'd rather it be as
explicit as possible to avoid bugs and to make it faster.
2018-06-30 01:57:51 +02:00
Henrik Lissner
70230b0892
Add doom-unreal-buffer-p predicate function 2018-06-30 01:57:51 +02:00
Henrik Lissner
af41e17355
Minor reformatting & docstring tweak 2018-06-26 01:48:15 +02:00
Henrik Lissner
017ba8d79c
Autoload defhydras & use new naming convention
Phasing out the +module@name convention for plain old
+module-name-hydra, which is more compatible with elisp reflection tools
like describe-function and such.

Also, Emacs starts up faster now. Tee hee.
2018-06-26 01:43:54 +02:00
Henrik Lissner
196638bf47
Improve handling for arbitrary package errors
e.g. if the package doesn't exist, it shouldn't simply die.
2018-06-24 22:23:09 +02:00
Henrik Lissner
335bef85fd
Remove unused memoize library 2018-06-24 22:23:09 +02:00
Henrik Lissner
e99ae5382c
Refactor package! macro
And have :ignore and :freeze be evaluated during package management,
rather than during macro expansion/compile time.

Also gives doom-package-prop a third, boolean argument. If non-nil,
`eval' the return value.
2018-06-24 22:23:08 +02:00
Henrik Lissner
adf143a853
Fix void-variable error when installing packages
Caused by a haphazardly refactor in f6dc6ac7.
2018-06-23 20:11:43 +02:00
Henrik Lissner
f6dc6ac74e
Refactor out map.el usage
After some profiling, it turns out map-put and map-delete are 5-7x
slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for
small lists (under 250 items), which is exactly how I've been using
them.

The only caveat is alist-get's signature is different on Emacs 25, thus
a polyfill is necessary in core-lib.
2018-06-23 19:53:54 +02:00
Henrik Lissner
d4ba03791f
Don't async refresh package contents
The performance benefit is minor and the loss of feedback is major in
case of errors.
2018-06-20 12:45:03 +02:00
Henrik Lissner
1efb0a8298
Rename core-dispatcher -> core-cli
The file's role is easier to guess at a glance.
2018-06-20 12:04:11 +02:00
Henrik Lissner
71f0b3ba10
Minor error handler refactor in package management
Allow debugger to produce better backtraces.
2018-06-20 02:23:55 +02:00
Henrik Lissner
ca2c8b5a45
Minor refactor, across the board
Do you see the board? Now look at the other side. That's how far this
refactor extends.

Yes.
2018-06-18 15:02:24 +02:00
Henrik Lissner
ab07e07352
Improve general error handling at startup
This will hopefully reveal more information as to the cause and origin
of errors at startup. It should also make doom-debug-mode more likely to
produce a backtrace in non-interactive sessions.
2018-06-18 14:47:36 +02:00
Henrik Lissner
0d925cda5e
Load core-os sooner & in all sessions
Indirectly fixes set-env! errors when using it from your init files.
2018-06-18 12:04:30 +02:00
Henrik Lissner
26caea7f2b
Move doom-docs-dir to core.el 2018-06-17 21:39:40 +02:00
Henrik Lissner
03022d09f9
Remove doom//x naming convention
This naming convention was meant to be for batch commands, but it grew
to include "commands that were helpful with managing Doom", but many of
these commands shouldn't be interactive in the first place!
2018-06-17 21:35:58 +02:00
Henrik Lissner
36992037d1
Update package dir mtimes for stale checks
This helps doom//reload-package-autoloads detect if packages have
changed.
2018-06-17 14:45:07 +02:00
Henrik Lissner
f3aadf6c77
Fix doom-temp-buffer-p & doom-real-buffer-p
A regression caused the former to error out (if the buffer name was less
than 2 characters long) and the latter to return t too eagerly (because
of an incorrect condition chain).
2018-06-17 02:30:02 +02:00
Henrik Lissner
ec6372ef66
Mark all temp buffers as unreal
Hopefully there are no plugins that use temp buffers to display things!
2018-06-16 21:02:54 +02:00
Henrik Lissner
bf44c1abcc
Add doom-temp-buffer-p predicate function 2018-06-16 21:02:40 +02:00
Henrik Lissner
44363cae40
General, minor refactor & revision
Across the board. All the boards.
2018-06-16 12:26:58 +02:00
Henrik Lissner
3f2318bc69
Fix wrong-type-argument errors on backspace
Caused when pressed at the beginning or end of a buffer.
2018-06-16 11:50:55 +02:00
Henrik Lissner
9a2f96c0f1
Lazy load projectile (experimental)
I can feel it; the power coursing through my veins. Every millisecond
saved at startup makes me more powerful. This world will be mine. Mine I
tell you!
2018-06-16 11:42:37 +02:00
Henrik Lissner
c81304d18b
Enable smartparens in eval-expression
This is experimental, so we can have delimiter/quote autopairing while
we write lisp into eval-expression.
2018-06-16 11:42:01 +02:00
Henrik Lissner
4d5a247d53
With C-u, doom/what-face doesn't fontify results
In case you get a face that's too hard to see.
2018-06-15 18:50:45 +02:00
Henrik Lissner
60e7b78739
Minor refactor of doom/describe-active-minor-mode 2018-06-15 18:32:53 +02:00
Henrik Lissner
f81a0e6f41
Remove redundant def-setting! docstrings
def-setting! will now grab the autodef's docstring if it has an
:obsolete property defined.
2018-06-15 16:54:39 +02:00
Henrik Lissner
58601488d9
describe-module: shows all modules, dim disabled
Shows all modules, whether or not they are enabled and dims disabled
modules.
2018-06-15 16:20:20 +02:00
Henrik Lissner
a500bfb0a0
Rewrite+rename describe-settings->describe-setters
Will now list autodefs instead of def-settings, including an origin
module label to tell you where it comes from at a glance.
2018-06-15 16:20:20 +02:00
Henrik Lissner
eaca8c58fa
Move unit tests from ert to buttercup
Easier to organize and write. Now I can hopefully strive for better
coverage!
2018-06-15 03:42:01 +02:00
Henrik Lissner
98d2f1de3f
Add set-env! autodef; make :env obsolete 2018-06-15 03:42:01 +02:00
Henrik Lissner
3228369d73
Fix void-function errors from doom//reload
Because certain commands aren't available without core-dispatcher.
2018-06-14 19:50:27 +02:00
Henrik Lissner
69c6e0b8fb
Add doom-get-package-alist
New function returns a list of (NAME . DESC) cons cells in the order
they were declared (in module packages.el files).

Fixes a load-order issue where autoloads from one package would depend
on the autoloads of another package, but was inserted into
doom-package-autoload-file *before* the depended package, causing
void-variable errors.

Also allows for a big refactor of the :plugins byte-compile target.
2018-06-14 03:36:46 +02:00
Henrik Lissner
b6f9bc9675 Fix package manager not :ignore'ing packages 2018-06-13 22:15:08 +02:00
Henrik Lissner
64e02e4232
Load core-packages in doom//run-tests 2018-06-12 01:45:52 +02:00
Henrik Lissner
1c3183b298
Remove space in backend labels during install
Minor reformatting. To be consistent with the backend transition labels
in doom//packages-autoremove.
2018-06-12 00:02:04 +02:00
Henrik Lissner
72201fead5
Major refactor of package management API
Fixes issues where:

+ package!'s :disable property was ignored and def-package! wouldn't
  ignore disabled packages.
+ Certain quelpa packages were being removed/reinstalled infinitely
+ Improved flexibility of doom-get-packages (its docstring needs to be
  updated!)
2018-06-12 00:02:04 +02:00
Henrik Lissner
0be2be5c82
Remove autoload/modules library
Move batch commands into core-dispatcher and doom//reload into
autoload/help. It will soon be renamed doom/reload.
2018-06-12 00:02:04 +02:00
Henrik Lissner
0741c8851a
Split core-packages into two (packages & modules)
+ Move doom-initialize et co into core.el
+ Lazy load core-packages
+ load! has been moved into core-lib
+ Added FILE! and DIR! macros
+ Fix package! not returning correct value when package is disabled
+ Remove :disabled support for def-package-hook! officially
2018-06-12 00:02:04 +02:00
Henrik Lissner
a25eff0189
delete-this-file: don't propagate deletion to vcs
Doom shouldn't assume the user always wants to stage the current
deletion after every delete.
2018-06-11 01:33:56 +02:00
Henrik Lissner
6bf529ddf8
Add magit/vcs support to doom file commands 2018-06-10 23:23:09 +02:00
Henrik Lissner
5295f36115
case-fold-search = nil in reload-package-autoloads
Slight optimization.
2018-06-10 20:54:32 +02:00
Henrik Lissner
2d5ac8a164
Fix void-variable package--builtins error
Occurs while running make install because package.el wasn't loaded in
time.
2018-06-10 19:15:39 +02:00
Henrik Lissner
85704bea33
Fix void-variable ex2 error while package managing 2018-06-10 19:10:58 +02:00
Henrik Lissner
8d4971d02b
Remove vestigial reference to doom-module-table 2018-06-10 17:48:48 +02:00
Henrik Lissner
9cc190adc9
Minor reformat & refactor keyword intern 2018-06-10 17:28:17 +02:00
Henrik Lissner
3498d5c6b1
Catch more *.elc files with bin/doom clean 2018-06-10 17:28:17 +02:00
Henrik Lissner
7e00a83acc
Update & refactor doom-info 2018-06-10 17:28:17 +02:00
Henrik Lissner
88f1ae3797
Refactor autoloads init in doom-initialize
Simplify doom-initialize-autoloads
2018-06-10 17:28:17 +02:00
Henrik Lissner
ee154911ae
Redesign doom-get-package
Now more useful for filtering packages by certain properties.
2018-06-10 17:28:17 +02:00
Henrik Lissner
01d1a814f9
Refactor doom-initialize functions
Removes doom-module-table; which was inflexible (though more stable). It
prevented you from putting your doom! block in anywhere but
~/.doom.d/init.el.

It is replaced (somewhat) by (doom-modules).
2018-06-10 17:30:26 +02:00
Henrik Lissner
99d6927e56
Improve error-handling for quelpa packages 2018-06-08 13:08:38 +02:00
Henrik Lissner
99afb01315
equals -> file-equal-p refactor
Use more reliable file comparison function.
2018-06-08 13:08:37 +02:00
Henrik Lissner
ee262e7737
Refactor error handling in package management API
I am hoping this will improve the ambiguous errors that originate from
package.el or quelpa.el.
2018-06-08 13:08:34 +02:00