Commit graph

299 commits

Author SHA1 Message Date
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
d39ec50bb7
fix(emacs-lisp): backport mode-name from 28+
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".
2022-10-29 01:57:43 +02: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
TEC
5ac2a5258b docs: change link format 2022-10-05 01:01:19 +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
36d3a62f6e
fix(emacs-lisp): defconst->defvar for +emacs-lisp-linter-warnings
This wasn't supposed to be a constant, and there's no reason it should
be one.

Amend: afa154db27
2022-09-16 02:06:43 +02:00
Henrik Lissner
20ab9154c2
refactor(emacs-lisp): sharp-quote function symbols 2022-09-16 01:14:24 +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
ad6a3d0f33
refactor: deprecate featurep! for modulep!
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.
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
1abcf913aa
revert: fix(docs): set mode in file-local vars
emacs-straight/org-mode@e22b4eb7aa introduced a breaking change that
made it impossible to rely on .dir-locals.el to change org-mode buffers
in $EMACSDIR to doom-docs-org-mode (without infinite recursion), so we
used file-local variables in 7e400ab.

emacs-straight/org-mode@215de6176b reverted that change, so we can use
.dir-locals.el again, and this is my preference, since it requires less
boilerplate across our hundreds of org files.

Ref: emacs-straight/org-mode@215de6176b
Ref: emacs-straight/org-mode@e22b4eb7aa
Revert: 7e400abdc0
2022-08-07 19:08:07 +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
7e400abdc0
fix(docs): set mode in file-local vars
Due to emacs-straight/org-mode@e22b4eb, a replacement major mode (for
org-mode) can no longer be specified from .dir-locals.el, as it spirals
into infinite recursion. Therefore, a mode: line is needed in all Doom
docs.

Ref: emacs-straight/org-mode@e22b4eb7aa
2022-08-03 02:46:33 +02:00
Henrik Lissner
1255315bfc
refactor(docs): replace nav menus with virtual one
Now that the header is dynamically generated (when doom-docs-mode is
active), a literal header is unnecessary.
2022-08-02 19:37:07 +02:00
Henrik Lissner
e77a45bc22
docs: use lowercase keywords
As per Org's new defaults, which we're adopting elsewhere, so may as
well adopt it here.
2022-08-02 16:23:43 +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
170dadca5a
feat(emacs-lisp): register doomscript as elisp interpreter 2022-06-21 23:42:16 +02:00
Henrik Lissner
d014a7ae8b
docs(emacs-lisp): add fn!/lambda! to ToC & tweak header-args 2022-06-21 23:32:02 +02:00
Henrik Lissner
00c75eddf8
docs(emacs-lisp): add fn! & lambda! demos 2022-06-21 21:29:08 +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
Henrik Lissner
52d0c92fea
bump: :lang emacs-lisp
jorgenschaefer/emacs-buttercup@f5cbf97e10 -> jorgenschaefer/emacs-buttercup@ceedad5efa
purcell/flycheck-package@ecd03f8379 -> purcell/flycheck-package@615c1ed8c6
xuchunyang/elisp-demos@924b07d28e -> xuchunyang/elisp-demos@01c301b516
2022-06-17 21:53:21 +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
d67dcf1940
docs(emacs-lisp): insert :added: properties in demos
To help identify when they (and future functions/macros) were added.
2022-06-17 18:21:23 +02:00
Henrik Lissner
e8c22c770b
docs(emacs-lisp): remove sharp-quoted example for add-hook!
add-hook! is advertised to be able to add multiple hooks using a
function-quoted list of functions, but add-hook! never actually
supported this. Rather than correct the implementation, I'm correcting
the documentation instead, because sharp-quoting lists betrays the
semantics of the sharp-quote. Quoted lists should still work fine
though (as documented in add-hook!'s docstring).

Close: #5843
2022-04-03 14:58:35 +02:00
Henrik Lissner
c05822ab39
bump: :lang
Emacs-Kotlin-Mode-Maintainers/kotlin-mode@876cc27dc1 -> Emacs-Kotlin-Mode-Maintainers/kotlin-mode@3e0c34087b
FStarLang/fstar-mode.el@3afbf04e4e -> FStarLang/fstar-mode.el@c95c2a61a6
Fanael/edit-indirect@7fffd87ac3 -> Fanael/edit-indirect@e3d86416bc
Fuco1/sphinx-mode@b5ac514e21 -> Fuco1/sphinx-mode@9d4075c106
Groovy-Emacs-Modes/groovy-emacs-modes@84f89b68ec -> Groovy-Emacs-Modes/groovy-emacs-modes@bf732d367b
NixOS/nix-mode@8e20de5ba7 -> NixOS/nix-mode@20ee8d8890
OCamlPro/ocp-indent@9e26c0a269 -> OCamlPro/ocp-indent@7c4d434132
ProofGeneral/PG@df19c7ba0e -> ProofGeneral/PG@e1e29acb04
Raku/raku-mode@eaac071f17 -> Raku/raku-mode@977b14a7c1
Sarcasm/irony-mode@5063d6b16d -> Sarcasm/irony-mode@870d1576fb
agda/agda@2816605bfd -> agda/agda@2816605bfd
amake/flutter.el@81c524a43c -> amake/flutter.el@08138f8c95
ananthakumaran/exunit.el@5bb115f327 -> ananthakumaran/exunit.el@0715c2dc2d
ananthakumaran/tide@28137ed904 -> ananthakumaran/tide@b93e555858
asok/projectile-rails@30828afbfa -> asok/projectile-rails@772f4766b5
asok/rake@9c204334b0 -> asok/rake@452ea0caca
brotzeit/rustic@f4b5c288af -> brotzeit/rustic@6eec971387
cdominik/cdlatex@f215b70c5c -> cdominik/cdlatex@8e963c6853
clojure-emacs/cider@36277802a4 -> clojure-emacs/cider@86dd3fee9d
codesuki/add-node-modules-path@7d9be65b3b -> codesuki/add-node-modules-path@63f047fd84
crystal-lang-tools/emacs-crystal-mode@15998140b0 -> crystal-lang-tools/emacs-crystal-mode@96a8058205
cython/cython@5b325c9860 -> cython/cython@fdea2d6bed
diml/utop@c87b8b2817 -> diml/utop@5d72a0ab34
dominikh/go-mode.el@32cbd78c0a -> dominikh/go-mode.el@3273fcece5
elixir-editors/emacs-elixir@6bbc1e5ac4 -> elixir-editors/emacs-elixir@e0d0466d83
emacs-csharp/csharp-mode@9917e1b97d -> emacs-csharp/csharp-mode@856ecbc0a7
emacs-ess/ESS@a7ce81bb76 -> emacs-ess/ESS@39eba28300
emacs-geiser/geiser@c1cc4da1ed -> emacs-geiser/geiser@9507e81a07
emacs-geiser/guile@cfd9116dcb -> emacs-geiser/guile@c641fcc50b
emacs-lsp/lsp-dart@813d3c92db -> emacs-lsp/lsp-dart@fda433671f
emacs-lsp/lsp-haskell@4e62cf897d -> emacs-lsp/lsp-haskell@7cf64944ab
emacs-lsp/lsp-java@ce03cb6574 -> emacs-lsp/lsp-java@0968038b9a
emacs-lsp/lsp-metals@695291761b -> emacs-lsp/lsp-metals@b7f77de694
emacs-lsp/lsp-pyright@d428dbcf18 -> emacs-lsp/lsp-pyright@3598bc7c47
emacs-php/php-mode@535aec8173 -> emacs-php/php-mode@5f26bec865
emacs-php/phpactor.el@272217fbb6 -> emacs-php/phpactor.el@34195f1533
emacs-straight/auctex@3b0a080ae5 -> emacs-straight/auctex@830e40a063
emacs-straight/csv-mode@8da54e8b4e -> emacs-straight/csv-mode@43f6106f0d
emacs-typescript/typescript.el@e824162051 -> emacs-typescript/typescript.el@88f317f0b6
erlang/otp@c1ab4b5424 -> erlang/otp@9ba9f6e60d
ethereum/emacs-solidity@6f7bd1641e -> ethereum/emacs-solidity@20fb77e089
factor/factor@7b451bb813 -> factor/factor@1aeafdb87b
fsharp/emacs-fsharp-mode@c90d762c06 -> fsharp/emacs-fsharp-mode@b3aa4c53fc
fxbois/web-mode@61f057a6ba -> fxbois/web-mode@efa853e5cf
godotengine/emacs-gdscript-mode@b7bfa6a3b2 -> godotengine/emacs-gdscript-mode@4badcf6a0c
greghendershott/racket-mode@a879a8d67b -> greghendershott/racket-mode@af9b760e7b
hakimel/reveal.js@918ee5610a -> hakimel/reveal.js@e281b3234e
haskell/haskell-mode@8402caa341 -> haskell/haskell-mode@cb573c8db5
hhvm/hack-mode@4c1c2b0939 -> hhvm/hack-mode@a522f61c08
technomancy/fennel-mode@47152970a9 -> https://git.sr.ht/~technomancy/fennel-mode@50ef3c6246f3
hvesalai/emacs-sbt-mode@e29464a82b -> hvesalai/emacs-sbt-mode@9fe1e8807c
hylang/hy-mode@5253533ddb -> hylang/hy-mode@df814865a1
idris-hackers/idris-mode@3cc9361b4c -> idris-hackers/idris-mode@65d6db1b75
iyefrat/evil-tex@aa0ddf8e76 -> iyefrat/evil-tex@0fa85c3fc8
jcollard/elm-mode@f2e2d0053f -> jcollard/elm-mode@d4e434fa18
joaotavora/sly@2e00c3bd4b -> joaotavora/sly@4513c382f0
jorgenschaefer/emacs-buttercup@1de6be465c -> jorgenschaefer/emacs-buttercup@f5cbf97e10
joshwnj/json-mode@0e819e519a -> joshwnj/json-mode@eedb456003
jrblevin/markdown-mode@541bd7b48a -> jrblevin/markdown-mode@521658eb32
jschaf/powershell.el@d1b3f95669 -> jschaf/powershell.el@ce1f0ae0b2
jwiegley/emacs-async@5d365ffc6a -> jwiegley/emacs-async@c78bab7506
leanprover/lean-mode@bf32bb9793 -> leanprover/lean-mode@c1c68cc946
ledger/ledger-mode@19b84dc766 -> ledger/ledger-mode@b55384d9cd
necaris/conda.el@7a34e06931 -> necaris/conda.el@9c28d7a853
nonsequitur/inf-ruby@03dd9c9d4e -> nonsequitur/inf-ruby@dbf4386bac
ocaml-ppx/ocamlformat@22a3707da3 -> ocaml-ppx/ocamlformat@9324ea439a
ocaml/dune@4d0a47edd5 -> ocaml/dune@4bc7629a5e
ocaml/merlin@e4791e2298 -> ocaml/merlin@5d59c70659
ocaml/tuareg@00faf47a7c -> ocaml/tuareg@04f5ab6be9
osv/company-web@f0cc9187c9 -> osv/company-web@863fb84b81
pashky/restclient.el@176d9cb655 -> pashky/restclient.el@9e2cfa8652
pezra/rspec-mode@92ef785010 -> pezra/rspec-mode@4215ff1f2d
polymode/polymode@54888d6c15 -> polymode/polymode@2094c92403
seagle0128/grip-mode@9220a560b4 -> seagle0128/grip-mode@6b427143a8
sebasmonia/sharper@08277b6c30 -> sebasmonia/sharper@96edd4a1db
stan-dev/stan-mode@9bb858b9f1 -> stan-dev/stan-mode@150bbbe5fd
swift-emacs/swift-mode@800efe2910 -> swift-emacs/swift-mode@0d1ef0ef18
tpapp/julia-repl@e90b1ed2cc -> tpapp/julia-repl@6c1d63511f
wbolster/emacs-python-pytest@b603c5c7f2 -> wbolster/emacs-python-pytest@ea53891a21
yoshiki/yaml-mode@63b637f846 -> yoshiki/yaml-mode@535273d5a1
ziglang/zig-mode@aba01b6199 -> ziglang/zig-mode@aa20d630b8

- Refactors the :lang rust module to reflect changes upstream, in
  rustic (thanks to #6154).

Close: #6154
Fix: #6070
2022-03-31 21:09:38 +02:00
Henrik Lissner
97155412a9
fix(emacs-lisp): missing package cookies in imenu 2022-03-21 03:57:03 +01:00
Daanturo
f63aad2ff6 tweak(emacs-lisp): local leader for lisp-interaction-mode 2022-02-23 17:47:39 +01:00
Henrik Lissner
7246db457c docs: replace doom-source with doom-repo links
I will later use "source" to refer to module sources, so better we avoid
the terminology for now.
2022-02-01 18:55:27 +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
88844e9cec docs: simplify internal docs links
Fewer links means less confusion.

- Merge doom-issue and doom-commit links into doom-ref (for auto-linking
  Issue/PR/commit references).
- Merge doom-module-source and doom-docs-source links into doom-source.
- Rename doom-report-issue to doom-report.
- Use '!' as the icon for module issues link.
- Remove doom-repo (replaced with "doom:*" in :lang org module).
- Add doomdir and emacsdir links to :lang org module.
2021-11-21 20:04:28 +01:00
Henrik Lissner
20cac97c08 docs(:lang): update READMEs to new format 2021-11-21 20:04:28 +01:00
Henrik Lissner
0aad1399cc refactor(file-templates): doom readme templates
Including readme template for categories.
2021-11-21 20:04:28 +01:00
Henrik Lissner
7034378968 nit: s/#+BEGIN_SRC/#+begin_src, s/elisp/emacs-lisp/
From now on Doom will enforce two conventions for its org files for
consistency's sake:

- Lower-case meta-lines in org files, like #+begin_src, #+name, or
  #+end_quote (only exception are the top-level ones, like #+TITLE and
  #+STARTUP).
- Use 'emacs-lisp' as the lang specifier for elisp blocks rather than
  'elisp'. Emacs doesn't natively recognize the latter.

This will be reflected in our rewritten docs/*.org and module
README.org's.
2021-10-18 12:09:42 +02:00
Henrik Lissner
704957437c revert: Ignore unsafe local variables, but log them
This behavior was too non-standard and invited more confusion than it
helped.

Ref #4070
Revert 5e7864838a
2021-10-06 01:30:45 +02: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
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04: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