Commit graph

124 commits

Author SHA1 Message Date
Henrik Lissner
0b2ccac007
fix(emacs-lisp): lookup docs backend w/o helpful
Use `helpful-symbol` if it's present and the symbol at point doesn't
represent a cl-type (falling back to `describe-symbol` otherwise).

Fix: #8068
2024-09-17 05:57:33 -04:00
45mg
2e5307e425 fix(emacs-lisp): always try Helpful for doc lookup
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.
2024-09-14 13:08:00 -07:00
Henrik Lissner
ad5e3dcce8
fix(emacs-lisp): byte-compiling missing function
This wasn't causing any errors, but `+emacs-lisp-truncate-pin` was
removed in 639fcc6.

Amend: 639fcc6a2e
2024-09-10 03:35:27 -04:00
Henrik Lissner
6671adc687
refactor!: move helpful from :core to :lang emacs-lisp
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.
2024-08-30 02:26:41 -04:00
Henrik Lissner
639fcc6a2e
tweak(emacs-lisp): remove pin truncation
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.
2024-03-26 10:30:34 -04:00
Henrik Lissner
4af536cde2
fix(emacs-lisp): +emacs-lisp--module-at-point: wrong-number-of-arguments error 2024-03-13 01:00:38 -04:00
Henrik Lissner
3bea4f66a8
refactor(emacs-lisp): elisp-demos: reorganize Doom demos
- 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.
2024-02-04 17:54:29 -05:00
Henrik Lissner
ffd2654aa3
fix(emacs-lisp): non-package-mode: only enable in elisp buffers
This prevents +emacs-lisp-non-package-mode from being activated in
non-elisp buffers.

Amend: #7341
Close: #7645
Co-authored-by: PatrickNorton <PatrickNorton@users.noreply.github.com>
2024-02-02 18:50:31 -05:00
Henrik Lissner
0290663cf3
fix(emacs-lisp): void-variable flycheck-disabled-checkers error
Fix: #7644
Amend: b50b2c4640
Amend: #7341
2024-02-02 03:18:52 -05:00
Jeetaditya Chatterjee
a7b810a93f
fix(emacs-lisp): lexical argument, error popup
this was caused by the use of fn! and an argument which interacted badly
with doom snippets of all things.
2023-10-15 19:33:07 +01:00
Jeetaditya Chatterjee
b50b2c4640
refactor(syntax): separate out implementations
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
2023-09-15 12:13:49 +01:00
Jeetaditya Chatterjee
c37f314f14
fix(syntax): s/connetion/connection
Also rework docstring and s/too/to
2023-09-15 12:13:49 +01:00
Jeetaditya Chatterjee
e976351424
feat(emacs-lisp): add reduced-flymake-byte-compile
This is a flymake backend that gives a reduced set of byte compiler
warnings in accordance too `+emacs-lisp-linter-warnings`
2023-09-15 12:13:49 +01:00
Jeetaditya Chatterjee
2e67ad18e9
feat(emacs-lisp): no doc warnings with flymake 2023-09-15 12:13:48 +01:00
Henrik Lissner
8e671f494d
fix(emacs-lisp): failure to look up module docs
Incorrect regex would cause (search-failed "\* ...$") errors, and would
fail to unfold the target entries if it was hidden.
2023-09-12 21:30:56 +02:00
Henrik Lissner
d8e16db605
fix(emacs-lisp): Doom API demos in help(ful) docs
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
2023-09-10 05:13:37 +02:00
Itai Y. Efrat
a1903ac4d5 fix(emacs-lisp): docstring url format which error popup
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'
2023-02-18 00:58:58 -05:00
Henrik Lissner
a0ccb6b95b
feat(emacs-lisp,lispy): recognize ;;* outline headings
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>
2022-10-29 01:57:43 +02:00
Henrik Lissner
156fade7e2
fix(emacs-lisp): set doom-module-context in eval handler
So module context is in scope of evaluated code.

Amend: 4efaf6837b
2022-09-25 17:52:07 +02:00
Henrik Lissner
f9201eb218
refactor: introduce doom-context
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.
2022-09-24 22:09:05 +02:00
Henrik Lissner
1c4217aa27
refactor: minor refactors & commentary revision
* 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
2022-09-24 20:31:34 +02:00
Henrik Lissner
732d87ac3e
nit: minor comment revision and refactors 2022-09-16 17:01:57 +02:00
Henrik Lissner
c5e88d229f
fix(lib): doom-compile-function throwing native-compiler-error 2022-09-16 16:15:07 +02:00
Henrik Lissner
e1ef4cc001
fix(emacs-lisp): datatype error in fileless elisp buffers
Due to +emacs-lisp-non-package-mode assuming it would always execute in
a file-visiting buffer.

Fix: #6786
2022-09-16 13:07:28 +02:00
Henrik Lissner
94ea4aa7dc
docs: add examples.org
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.
2022-09-16 01:14:20 +02:00
Henrik Lissner
e71daf5cc3
tweak(emacs-lisp): elisp indentation for data/plists
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/'
2022-09-16 01:14:20 +02:00
Henrik Lissner
afa154db27
refactor!(emacs-lisp): flycheck config in non-packages
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
2022-09-12 11:45:56 +02:00
Henrik Lissner
a5c80fcb4b
refactor: deprecate doom-private-dir for doom-user-dir
- 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'.
2022-08-14 20:43:35 +02:00
Henrik Lissner
422baedad7
refactor(cli): load cli libs from doom.el
This simplifies the entry point for loading Doom (and/or its CLI
framework).
2022-08-07 19:43:28 +02:00
Henrik Lissner
06db69bf76
fix(emacs-lisp): suppress popup warnings from flycheck
Typically caused by partial syntax errors in Doom Emacs (e.g. while
you're writing code in $EMACSDIR or $DOOMDIR, and haven't typed the
closing parenthesis yet).
2022-08-05 00:49:17 +02:00
Henrik Lissner
1f8bf7accb
merge: rewrite-docs
I've omitted docs/*.org from this merge, as there is still work left to
do there, but I am pushing the module docs early so folks can benefit
from the new docs sooner.
2022-08-03 03:27:50 +02:00
Henrik Lissner
b9933e6637
refactor!: restructure Doom core
BREAKING CHANGE: This restructures the project in preparation for Doom
to be split into two repos. Users that have reconfigured Doom's CLI
stand a good chance of seeing breakage, especially if they've referred
to any core-* feature, e.g.

  (after! core-cli-ci ...)

To fix it, simply s/core-/doom-/, i.e.

  (after! doom-cli-ci ...)

What this commit specifically changes is:
- Renames all core features from core-* to doom-*
- Moves core/core-* -> lisp/doom-*
- Moves core/autoloads/* -> lisp/lib/*
- Moves core/templates -> templates/

Ref: #4273
2022-07-30 22:41:13 +02:00
Henrik Lissner
a4aab45656
fix(emacs-lisp): flycheck false positives in Doom configs 2022-06-22 23:04:00 +02:00
Henrik Lissner
6c0b7e1530
refactor!(cli): rewrite CLI framework libraries
BREAKING CHANGE: this changes Doom's CLI framework in subtle ways, which
is listed in greater detail below. If you've never extended Doom's CLI,
then this won't affect you, but otherwise it'd be recommended you read
on below.

This commit focuses on the CLI framework itself and backports some
foundational changes to its DSL and how it resolves command line
arguments to CLIs, validates input, displays documentation, and persists
state across sessions -- and more. This is done in preparation for the
final stretch towarding completing the CLI rewrite (see #4273).

This is also an effort to generalize Doom's CLI (both its framework and
bin/doom), to increase it versatility and make it a viable dev tool for
other Doom projects (on our Github org) and beyond.

However, there is a *lot* to cover so I'll try to be brief:

- Refactor: generalize Doom's CLI framework by moving all bin/doom
  specific configuration/commands out of core-cli into bin/doom. This
  makes it easier to use bin/doom as a project-agnostic development
  tool (or for users to write their own).
- Refactor: change the namespace for CLI variables/functions from
  doom-cli-X to doom-X.
- Fix: subcommands being mistaken as arguments. "doom make index" will
  resolve to (defcli! (doom make index)) if it exists,
  otherwise (defcli! (doom make)) with "index" as an argument. Before
  this, it would resolve to the latter no matter what. &rest can
  override this; with (defcli! (doom make) (&rest args)), (defcli! (doom
  make index)) will never be invoked.
- Refactor!: redesign our output library (was core/autoload/output.el,
  is now core/autoload/print.el), and how our CLI framework buffers and
  logs output, and now merges logs across (exit! ...) restarts.
- Feat: add support for :before and :after pseudo commands. E.g.

    (defcli! (:before doom help) () ...)
    (defcli! (:after doom sync) () ...)

  Caveat: unlike advice, only one of each can be defined per-command.
- Feat: option arguments now have rudimentary type validation (see
  `doom-cli-option-arg-types`). E.g.

    (defcli! (doom foo) ((foo ("--foo" num))) ...)

  If NUM is not a numeric, it will throw a validation error.

  Any type that isn't in `doom-cli-option-arg-types` will be treated as a
  wildcard string type. `num` can also be replaced with a specification,
  e.g. "HOST[:PORT]", and can be formatted by using symbol quotes:
  "`HOST'[:`PORT']".
- Feat: it is no longer required that options *immediately* follow the command
  that defines them (but it must be somewhere after it, not before). E.g.
    With:
      (defcli! (:before doom foo) ((foo ("--foo"))) ...)
      (defcli! (doom foo baz) () ...)
    Before:
      FAIL: doom --foo foo baz
      GOOD: doom foo --foo baz
      FAIL: doom foo baz --foo
    After:
      FAIL: doom --foo foo baz
      GOOD: doom foo --foo baz
      GOOD: doom foo baz --foo
- Refactor: CLI session state is now kept in a doom-cli-context struct (which
  can be bound to a CLI-local variable with &context in the arglist):

    (defcli! (doom sync) (&context context)
      (print! "Command: " (doom-cli-context-command context)))

  These contexts are persisted across sessions (when restarted). This is
  necessary to support seamless script restarting (i.e. execve
  emulation) in post-3.0.
- Feat: Doom's CLI framework now understands "--". Everything after it will be
  treated as regular arguments, instead of sub-commands or options.
- Refactor!: the semantics of &rest for CLIs has changed. It used to be "all
  extra literal, non-option arguments". It now means *all* unprocessed
  arguments, and its use will suppress "unrecognized option" errors, and
  tells the framework not to process any further subcommands. Use &args
  if you just want "all literal arguments following this command".
- Feat: add new auxiliary keywords for CLI arglists: &context, &multiple,
  &flags, &args, &stdin, &whole, and &cli.
  - &context SYM: binds the currently running context to SYM (a
    `doom-cli-context` struct). Helpful for introspection or passing
    along state when calling subcommands by hand (with `call!`).
  - &stdin SYM: SYM will be bound to a string containing any input piped
    into the running script, or nil if none. Use
    `doom-cli-context-pipe-p` to detect whether the script has been
    piped into or out of.
  - &multiple OPTIONS...: allows all following OPTIONS to be repeated. E.g. "foo
    -x a -x b -x c" will pass (list ("-x" . "a") ("-x" . "b") ("-x" .
    "c")) as -x's value.
  - &flags OPTIONS...: All options after "&flags" get an implicit --no-* switch
    and cannot accept arguments. Will be set to :yes or :no depending on which flag is
    provided, and nil if the flag isn't provided. Otherwise, a default
    value can be specified in that options' arglist. E.g.

      (defcli! (doom foo) (&flags (foo ("--foo" :no))) ...)

    When called, this command sets FOO to :yes if --foo, :no if --no-foo, and
    defaults to :no otherwise.
  - &args SYM: this replaces what &rest used to be; it binds to SYM a
    list of all unprocessed (non-option) arguments.
  - &rest SYM: now binds SYM to a list of all unprocessed arguments, including
    options. This also suppresses "unrecognized option" errors, but will render
    any sub-commands inaccessible. E.g.

      (defcli! (doom make) (&rest rest) ...)
      ;; These are now inaccessible!
      (defcli! (doom make foo) (&rest rest) ...)
      (defcli! (doom make bar) (&rest rest) ...)
  - &cli SYM: binds SYM to the currently running `doom-cli` struct. Can also be
    obtained via `(doom-cli-get (doom-cli-context-command context))`. Possibly
    useful for introspection.
- feat: add defobsolete! macro for quickly defining obsolete commands.
- feat: add defalias! macro for quickly defining alias commands.
- feat: add defautoload! macro for defining an autoloaded command (won't
  be loaded until it is called for).
- refactor!: rename defcligroup! to defgroup! for consistency.
- fix: CLIs will now recursively inherit plist properties from parent
  defcli-group!'s (but will stack :prefix).
- refactor!: remove obsolete 'doom update':
- refactor!: further generalize 'doom ci'
  - In an effort to generalize 'doom ci' (so other Doom--or
    non-doom--projects can use it), all its subcommands have been
    changed to operate on the current working directory's repo instead
    of $EMACSDIR.
  - Doom-specific CI configuration was moved to .github/ci.el.
  - All 'doom ci' commands will now preload one of \$CURRENT_REPO_ROOT/ci.el or
    \$DOOMDIR/ci.el before executing.
- refactor!: changed 'doom env'
  - 'doom env {-c,--clear}' is now 'doom env {clear,c}'
  - -r/--reject and -a/--allow may now be specified multiple times
- refactor!: rewrote CLI help framework and error handling to be more
  sophisticated and detailed.
- feat: can now initiate $PAGER on output with (exit! :pager) (or use
  :pager? to only invoke pager is output is longer than the terminal is
  tall).
- refactor!: changed semantics+conventions for global bin/doom options
  - Single-character global options are now uppercased, to distinguish them from
    local options:
    - -d (for debug mode) is now -D
    - -y (to suppress prompts) is now -!
    - -l (to load elisp) is now -L
    - -h (short for --help) is now -?
  - Replace --yes/-y switches with --force/-!
  - -L/--load FILE: now silently ignores file errors.
  - Add --strict-load FILE: does the same as -L/--load, but throws an error if
    FILE does not exist/is unreadable.
  - Add -E/--eval FORM: evaluates arbitrary lisp before commands are processed.
  - -L/--load, --strict-load, and -E/--eval can now be used multiple times in
    one command.
  - Add --pager COMMAND to specify an explicit pager. Will also obey
    $DOOMPAGER envvar. Does not obey $PAGER.
- Fix #3746: which was likely caused by the generated post-script overwriting
  the old mid-execution. By salting the postscript filenames (with both an
  overarching session ID and a step counter).
- Docs: document websites, environment variables, and exit codes in
  'doom --help'
- Feat: add imenu support for def{cli,alias,obsolete}!

Ref: #4273
Fix: #3746
Fix: #3844
2022-06-18 23:53:12 +02:00
Henrik Lissner
6c5537b487
fix(emacs-lisp): eval forms from within the current buffer
This fix ensures that functions/macros that are evaluated with +eval/*
et co will remember where they were defined (if possible), so you don't
have to see this in their documentation again:

  FUNCTION is a function without a source file.

Ref: https://github.com/doomemacs/doomemacs/pull/6444#issuecomment-1159457888
2022-06-18 18:19:39 +02:00
Henrik Lissner
9fde385cdc
fix(emacs-lisp): void-function lisp--local-defform-body-p
I was too hasty adding this function in 15432cf. This function wasn't
introduced until Emacs 29.

Amend: 15432cf9d2
2022-06-18 16:57:17 +02:00
Henrik Lissner
15432cf9d2
fix(emacs-lisp): update custom lisp-indent-function
To reflect Emacs 28+ changes to the function it is
replacing (lisp-indent-function).
2022-06-17 21:58:05 +02:00
tecosaur
f0f414ac67
fix(eval): type error in +emacs-lisp-eval
When evaluating from a buffer not visiting any file, file-truename would
error out since the argument it was fed is nil.

Fix: #6181
Close: #6404
Ref: 7290f85cfd
Co-authored-by: Yoav Marco <ymarco@users.noreply.github.com>
2022-06-17 18:36:10 +02:00
Henrik Lissner
97155412a9
fix(emacs-lisp): missing package cookies in imenu 2022-03-21 03:57:03 +01:00
Henrik Lissner
7290f85cfd feat(eval): set load-true-file-name & buffer-file-truename
So they are available in evaluated contexts.
2022-01-27 03:50:52 +01:00
Henrik Lissner
0aad1399cc refactor(file-templates): doom readme templates
Including readme template for categories.
2021-11-21 20:04:28 +01:00
Colin Woodbury
c3d237c3f5 fix(emacs-lisp): quiet doc lints in org src blocks
Opening an Org src block with `SPC m '` creates a minibuffer with no
associated file name, hence the check for `buffer-file-name`.
2021-09-23 11:37:18 +02:00
Henrik Lissner
3bedae38dd dev: transition to 12c long hashes
In bumps, in :pin's, and in our git conventions. We have no rules for
the commit linter for it yet, though.
2021-08-02 22:07:13 -04:00
Henrik Lissner
3ba364ae10 Minor refactoring across the board 2021-05-23 22:09:07 -04:00
Jan Felix Langenbach
acb0399424 Reimplement +emacs-lisp--module-at-point 2021-04-26 00:39:55 +02:00
Henrik Lissner
7e1f5da169 lang/emacs-lisp: respect lexical-binding in eval handler 2021-03-08 10:25:09 -05:00
Nikita Bloshchanevich
e05d804f1f Restore the old buffer when using `ivy-call'
Without `deferred', the file selected in the `counsel-find-file' will
only remain the current buffer afterwards when pressing RET on an item,
not just `ivy-call'.
2021-02-26 22:06:41 +01:00
Nikita Bloshchanevich
65dfdd5c4a [4415] remove FIXME comment
Due to `ivy-call' still causing files to be opened in the
background (which is not a bug in `ivy'),
`+emacs-lisp-lookup-definition' still needs to return `deferred' for
modules. The comment is as such misleading and needs to be removed (it
has been resolved).
2020-12-15 14:28:19 +01:00
Nikita Bloshchanevich
621cb60e75 Workaround: fix goto definition on modules
`+emacs-lisp-lookup-definition' does not work when browsing the directory of a
module, because, due to a possible bug in `counsel', the visited buffer is not
immediately visible after calling `counsel-find-file' (unlike with `find-file').
As such, the backend should return `deferred' for that case.

See abo-abo/swiper#2752. This should be removed once that PR is merged.
2020-12-12 13:21:26 +01:00
Henrik Lissner
d1effe2ddd
Fix keyword highlighting in Emacs 28+
Because they now satisfy special-variable-p.
2020-10-21 22:05:58 -04:00