BREAKING CHANGE: This moves helpful.el out of core into :lang
emacs-lisp. Since most (all) people have this module enabled, this
shouldn't make a difference for most people, but if you're one of the
few that don't have :lang emacs-lisp enabled, Doom will revert to using
Emacs' built-in help.el and describe-* commands.
Others can also disable helpful with (package! helpful :disable t) if
they prefer Emacs' built-in help system, which wasn't possible before,
because it was a core package.
This was done as part of an ongoing effort to slim down Doom's core in
preparation for v3.
This removes the truncation of `package!` `:pin`s. This was originally
intended to make packages.el files easier to skim, but in hindsight it
didn't really. It served little other purpose but to make it harder for
folks to interact with the :pin string.
- Move Doom core elisp API demos out of docs/examples.org into lisp/demos.org.
- Recognize and search demos.org file in modules for additional
demos (including $DOOMDIR/demos.org).
- Refactor emacs-lisp module to use new elisp-demos-user-files variable
instead of an advice. This way, elisp-demo's commands (such as
`elisp-demos-find-demo` and `elisp-demos-add-demo`) will include
Doom's demos.
This prevents +emacs-lisp-non-package-mode from being activated in
non-elisp buffers.
Amend: #7341Close: #7645
Co-authored-by: PatrickNorton <PatrickNorton@users.noreply.github.com>
In Emacs 28+, the mode-name in emacs-lisp-mode is "ELisp/X" (where X = d
or l depending on lexical-binding). I find this much more useful than
"Emacs-Lisp" in <=27.x or our static replacement "Elisp".
Permit `;;* ...` be recognized by imenu and outline-minor-mode (and
outline's commands). This also patches Lispy to reflect this new
configuration (if :lang emacs-lisp is active).
Close: #6732
Co-authored-by: LemonBreezes <LemonBreezes@users.noreply.github.com>
This adds the basic framework of docs/examples.org, including the former
contents of demo.org in :lang emacs-lisp. elisp-demo has also been
reconfigured to search it instead.
Keep in mind that examples.org references a few things in as-of-yet
published documentation. This will be rectified soon.
This was adapted from
https://www.reddit.com/r/emacs/comments/d7x7x8/finally_fixing_indentation_of_quoted_lists/.
It fixes the indentation of quoted data (and plist keywords) so they're
indented like data, rather than function arguments, like so:
BEFORE:
`(foo bar baz
doom emacs)
'(:foo 1
:bar 2
:baz 3)
'(:foo 1
2
3
:bar 4)
(:foo 1
:bar 2)
(:foo 1
;; test comment
:bar 2)
(:foo 1
2
:bar 3)
AFTER:
`(foo bar baz
doom emacs)
'(:foo 1
:bar 2
:baz 3)
'(:foo 1
2
3
:bar 4)
;; only align unquoted keywords if keywords start each line:
(:foo 1
:bar 2)
(:foo 1
;; test comment
:bar 2)
(:foo 1
2
:bar 3)
Also, I added a way to declare that plists in an macro's arguments
should be indented like data:
(put 'map! 'indent-plists-as-data t)
BEFORE:
(map! :localleader
:map emacs-lisp-mode-map
(:prefix ("d" . "debug")
"f" #'+emacs-lisp/edebug-instrument-defun-on
"F" #'+emacs-lisp/edebug-instrument-defun-off))
AFTER:
(map! :localleader
:map emacs-lisp-mode-map
(:prefix ("d" . "debug")
"f" #'+emacs-lisp/edebug-instrument-defun-on
"F" #'+emacs-lisp/edebug-instrument-defun-off))
There was a third improvement I was hoping to include, namely,
proper indentation of interpolated forms:
BEFORE:
`(foo
bar
,(if t
'baz
'boo))
`(foo
bar
(if t
baz
boo))
AFTER:
`(foo
bar
,(if t
'baz
'boo))
`(foo
bar
(if t
baz
boo))
But this was removed because it breaks indentation for quoted macro
forms (or dynamic elisp programming):
BEFORE: (good)
`(with-temp-buffer
(if (always)
(message
"Hello %s"
user-login-name)
(message
"Goodbye %s"
user-login-name)))
AFTER: (bad)
`(with-temp-buffer
(if (always)
(message
"Hello %s"
user-login-name)
(message
"Goodbye %s"
user-login-name)))
Ref: https://www.reddit.com/r/emacs/comments/d7x7x8/finally_fixing_indentation_of_quoted_lists/'
BREAKING CHANGE: This performs the following backwards-incompatible
changes:
- Replaces `+emacs-lisp-reduce-flycheck-errors-in-emacs-config-h` with a
`+emacs-lisp-non-package-mode` minor-mode.
- Removed the `+emacs-lisp-disable-flycheck-in-dirs` variable, as this
mechanism no longer checks a directory list to detect a "non-package".
If you've referenced either of these symbols, you'll need to
update/remove them from your config. No extra config is needed
otherwise.
Why: Doom has always tried to reduce the verbosity of Flycheck when
viewing elisp config files or scripts (i.e. non-packages). These are so
stateful that the byte-compiler, package-lint, and checkdoc inundate
users with false positives that are more overwhelming than helpful.
The heuristic for this has always been a simple "is this file in
$DOOMDIR or $EMACSDIR", but this wasn't robust enough, especially in
cases where symlinking was involved, so I've employed a new, more
general heuristic for detecting non-package files:
- The file isn't a theme in `custom-theme-load-path`,
- The file doesn't have a (provide ...) or (provide-theme ...)
statement whose first argument matches the file name,
- The file lives in a project with a .doommodule file (doom modules
never have convention package files in them),
- Or the file is a dotfile (like .dir-locals.el or .doomrc).
I've also tweaked byte-compile-warnings to yield a little more output,
but not by much. Whether this is too permissive or not will require
further testing to determine.
What's more, I've updated this to reflect recent changes to Doom's
startup process (in c05e615).
Ref: c05e61536e
- Deprecates the doom-private-dir variable in favor of doom-user-dir.
- Renames the pseudo category for the user's module: :private -> :user.
- Renames the doom-private-error error type to doom-user-error.
Emacs uses the term "user" to refer to the "things" in user space (e.g.
user-init-file, user-emacs-directory, user-mail-address, xdg-user-dirs,
package-user-dir, etc), and I'd like to be consistent with that. It also
has the nice side-effect of being slightly shorter. I also hope
'doom-user-error' will be less obtuse to beginners than
'doom-private-error'.
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.
featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
It's hardcoded to return t for symbols that end in any of '-command',
'-frame-alist', '-function', '-functions', '-hook', '-hooks', '-form',
'-forms', '-map', '-map-alist', '-mode-alist', '-program', or
'-predicate' -- which I think is excessive next to a safety check.
I'll trust that: if the user marks X as safe, and it isn't *explicitly*
marked risky, and it destroys the universe, then it's their fault, not
mine, not Emacs'.
This suppresses the annoying "do you want to apply these unsafe file/dir
local variables" prompt by ignoring them (but stills them so at least
users are told).
Fixes issue mentioned in #4335
`+emacs-lisp-append-value-to-eldoc-a' `error's if the symbol isn't
bound, because `symbol-value' errors in that case. Fix that bug by only
modifying the result of `elisp-get-var-docstring' if the symbol is
bound.
In `+emacs-lisp-append-value-to-eldoc-a', if the `frame-width' of the minibuffer
is smaller than the length of the documentation + " [...]" + 1, a negative
maximum %s bound is passed, causing the error in the title.
Fix this by clamping the computed LIMIT to 0.