These optional dotfiles indicate the root of a module or module
group (:lang), and will later contain module metadata. They will also
serve as an alternative to packages.el and doctor.el, and will aide the
parts of the v3.0 module API concerned with resolving the current module
from a path (`doom-module-from-path`), which currently rely too heavily
on parsing path strings.
For now, however, they're simply placeholders.
As per the description in 6671adc68, this module should always use
Helpful's functions as long as Helpful is available (ie. not explicitly
disabled by the user in packages.el). The remapping of `describe-symbol`
is irrelevant here - the user might prefer to rebind `C-h C-o` to
`describe-symbol` (as `helpful-symbol` cannot look up types), but that
doesn't necessarily mean they want this module not to use it.
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>
As `+emacs-lisp-non-package-mode` handles both flymake and flycheck,
making two internal modes that then `+emacs-lisp-non-package-mode`
calls, makes the code cleaner
Due to cd26975, `with-file-contents!` leaves the cursor at point-min,
not point-max, so this `re-search-backward` call would never find its
mark. Now, the elisp demos for Doom functions/macros should show up
again in helpful-*/describe-* buffers.
Amend: cd269753cf
In emacs 29 wrong quotes in docstrings throw up compilation errors,
which pop up randomly with no real context when using doom. I have found
a reference to url's being single quoted in the emacs wiki[0], but the
emacs manual shows the standard format[1], not sure if it changed or was
a mistake. Also it should have a URL prefix apparently.
[0]: https://www.emacswiki.org/emacs/DocString
[1]: info elisp 'Documentation tips'
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>
Introduces a system to announce what execution contexts are active, so I
can react appropriately, emit more helpful logs/warnings in the case of
issues, and throw more meaningful errors.
* bin/doom: load module CLIs in the 'modules' context.
* lisp/cli/doctor.el: load package files in 'packages' context.
* lisp/doom-cli.el:
- (doom-before-init-hook, doom-after-init-hook): trigger hooks at the
correct time. This may increase startup load time, as the benchmark
now times more of the startup process.
- (doom-cli-execute, doom-cli-context-execute,
doom-cli-context-restore, doom-cli-context-parse,
doom-cli--output-benchmark-h, doom-cli-call, doom-cli--restart,
doom-cli-load, run!): remove redundant context prefix in debug logs,
it's now redundant with doom-context, which doom-log now prefixes
them with.
* lisp/doom-lib.el (doom-log): prefix doom-context to doom-log output,
unless it starts with :.
* lisp/doom-packages.el (package!, doom-packages--read): throw error if
not used in a packages.el file or in the context of our package
manager.
* lisp/doom-profiles.el (doom-profile--generate-init-vars,
doom-profile--generate-load-modules): use modules doom-context instead
of doom-init-time to detect startup.
* lisp/doom-start.el (doom-load-packages-incrementally-h): move function
closer to end of doom-after-init-hook.
* lisp/doom.el:
- (doom-before-init-hook, doom--set-initial-values-h,
doom--begin-init-h): rename doom--set-initial-values-h to
doom--begin-init-h and ensure it runs as late in
doom-before-init-hook as possible, as that is the point where Doom's
"initialization" formally begins.
- (doom-after-init-hook): don't trigger at the end of command-line-1
in non-interactive sessions. This will be triggered manually in
doom-cli.el's run!.
* lisp/lib/config.el (doom/reload, doom/reload-autoloads,
doom/reload-env): use 'reload' context for reload commands.
* modules/lang/emacs-lisp/autoload.el (+emacs-lisp-eval): use 'eval'
context.
* modules/lang/org/config.el: remove doom-reloading-p; check for
'reload' doom context instead.
* lisp/doom-cli.el:
- reference backport source commit.
- doom-cli--restart: a type check is all we need here. This is a
programmer error, not a user error.
* lisp/doom-editor.el (recentf): mention recentf-show-abbreviated (added in
emacs-mirror/emacs@32906819ad)
* lisp/doom-keybinds.el (doom-init-leader-keys-h): move to
doom-after-init-hook, in case the user customizes leader variables in
a previous hook (like emacs-startup-hook or after-init-hook).
* lisp/doom-start.el: use eval-when! to compile out the section on
non-macOS systems (when Doom gets around to compiling its core files,
later).
* modules/config/literate/autoload.el (+literate-config-file): use
file-name-concat instead of string concat. This relaxes the
requirement that doom-user-dir end in a /; a requirement I intend to
fully phase out.
* modules/lang/emacs-lisp/autoload.el (+emacs-lisp-non-package): remove
empty map! macro in flycheck-emacs-lisp-check-form. The macro already
no-ops at compile-time/in noninteractive sessions since b480ed51a3.
* modules/ui/hl-todo/config.el (hl-todo-keyword-faces): revise
commentary for default hl-todo keywords.
Ref: emacs-mirror/emacs@32906819ad
Ref: b480ed51a3
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/'