Merge branch 'master' into corfu-update-smart-tab
This commit is contained in:
commit
390f5920a2
95 changed files with 928 additions and 1520 deletions
|
@ -5,7 +5,7 @@
|
||||||
[Install](#install) • [Documentation] • [FAQ] • [Screenshots] • [Contribute](#contribute)
|
[Install](#install) • [Documentation] • [FAQ] • [Screenshots] • [Contribute](#contribute)
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
[][Discord]
|
[][Discord]
|
||||||
|
@ -99,7 +99,7 @@ Check out [the FAQ][FAQ] for answers to common questions about the project.
|
||||||
|
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
- Git 2.23+
|
- Git 2.23+
|
||||||
- Emacs 27.1–29.2 (**Recommended: 29.2 +
|
- Emacs 27.1–29.3 (**Recommended: 29.3 +
|
||||||
[native-comp](https://www.emacswiki.org/emacs/GccEmacs)**)
|
[native-comp](https://www.emacswiki.org/emacs/GccEmacs)**)
|
||||||
- [ripgrep] 11.0+
|
- [ripgrep] 11.0+
|
||||||
- GNU `find`
|
- GNU `find`
|
||||||
|
@ -138,8 +138,6 @@ commands you should know about:
|
||||||
+ `doom env` to dump a snapshot of your shell environment to a file that Doom
|
+ `doom env` to dump a snapshot of your shell environment to a file that Doom
|
||||||
will load at startup. This allows Emacs to inherit your `PATH`, among other
|
will load at startup. This allows Emacs to inherit your `PATH`, among other
|
||||||
things.
|
things.
|
||||||
+ `doom build` to recompile all installed packages (use this if you up/downgrade
|
|
||||||
Emacs).
|
|
||||||
|
|
||||||
|
|
||||||
# Roadmap
|
# Roadmap
|
||||||
|
|
12
bin/doom
12
bin/doom
|
@ -89,9 +89,9 @@
|
||||||
(user-error (message "Error: %s" (cadr e))
|
(user-error (message "Error: %s" (cadr e))
|
||||||
(kill-emacs 2)))
|
(kill-emacs 2)))
|
||||||
|
|
||||||
;; UX: Abort if the user is using 'doom' as root, unless ~/.config/emacs is
|
;; UX: Abort if the user is using 'doom' as root, unless $EMACSDIR is owned by
|
||||||
;; owned by root, in which case we assume the user genuinely wants root to be
|
;; root, in which case we can safely assume the user genuinely wants root to
|
||||||
;; their primary user account for Emacs.
|
;; be their primary user account for this session.
|
||||||
(when (equal 0 (user-real-uid))
|
(when (equal 0 (user-real-uid))
|
||||||
(unless (equal 0 (file-attribute-user-id (file-attributes doom-emacs-dir)))
|
(unless (equal 0 (file-attribute-user-id (file-attributes doom-emacs-dir)))
|
||||||
(message
|
(message
|
||||||
|
@ -271,10 +271,8 @@ SEE ALSO:
|
||||||
(defcli-autoload! ((profiles profile)))
|
(defcli-autoload! ((profiles profile)))
|
||||||
(defcli-autoload! ((upgrade up)))
|
(defcli-autoload! ((upgrade up)))
|
||||||
(defcli-autoload! (env))
|
(defcli-autoload! (env))
|
||||||
(defcli-autoload! ((build b purge p rollback)) "packages")
|
(defcli-autoload! ((build b purge p gc rollback)) "packages")
|
||||||
(defcli-autoload! ((install i)))
|
(defcli-autoload! ((install i)))
|
||||||
(defcli-autoload! ((compile c)))
|
|
||||||
(defcli-autoload! (clean) "compile")
|
|
||||||
|
|
||||||
;; TODO Post-3.0 commands
|
;; TODO Post-3.0 commands
|
||||||
;; (load! "gc" dir)
|
;; (load! "gc" dir)
|
||||||
|
@ -282,8 +280,6 @@ SEE ALSO:
|
||||||
;; (load! "nuke" dir)
|
;; (load! "nuke" dir)
|
||||||
;; (load! "package" dir)
|
;; (load! "package" dir)
|
||||||
;; (load! "profile" dir)
|
;; (load! "profile" dir)
|
||||||
;; (defcli-obsolete! ((compile c)) (sync "--compile") "v3.0.0")
|
|
||||||
;; (defcli-obsolete! ((build b)) (sync "--rebuild") "v3.0.0")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
(defcli-group! "Diagnostics"
|
(defcli-group! "Diagnostics"
|
||||||
|
|
|
@ -402,14 +402,13 @@ This command is never needed for changes to =$DOOMDIR/config.el=.
|
||||||
|
|
||||||
** Copy or sync my config to another system?
|
** Copy or sync my config to another system?
|
||||||
*Short answer:* it is safe to sync =$DOOMDIR= across systems, but not
|
*Short answer:* it is safe to sync =$DOOMDIR= across systems, but not
|
||||||
=$EMACSDIR=. Once moved, use ~$ doom sync && doom build~ to ensure everything is
|
=$EMACSDIR=. Once moved, use ~$ doom sync~ to ensure everything is set up
|
||||||
set up correctly.
|
correctly.
|
||||||
|
|
||||||
*Long answer:* packages can contain baked-in absolute paths and non-portable
|
*Long answer:* packages can contain baked-in absolute paths and non-portable
|
||||||
byte-code. It is never a good idea to mirror it across multiple systems, unless
|
byte-code. It is never a good idea to mirror it across multiple systems, unless
|
||||||
they are all the same (same OS, same version of Emacs, same paths). Most issues
|
they are all the same (same OS, same version of Emacs, same paths). Most issues
|
||||||
should be solved by running ~$ doom sync && doom build~ on the other end, once
|
should be solved by running ~$ doom sync~ on the other end, once moved.
|
||||||
moved.
|
|
||||||
|
|
||||||
** Start over, in case something went terribly wrong?
|
** Start over, in case something went terribly wrong?
|
||||||
Delete =$EMACSDIR/.local/straight= and run ~$ doom sync~.
|
Delete =$EMACSDIR/.local/straight= and run ~$ doom sync~.
|
||||||
|
|
|
@ -1,214 +0,0 @@
|
||||||
;;; lisp/cli/commands/byte-compile.el -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Variables
|
|
||||||
|
|
||||||
;; None yet!
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Commands
|
|
||||||
|
|
||||||
(defcli! ((compile c))
|
|
||||||
((recompile-p ("-r" "--recompile"))
|
|
||||||
(core-p ("-c" "--core"))
|
|
||||||
(private-p ("-p" "--private"))
|
|
||||||
(verbose-p ("-v" "--verbose")))
|
|
||||||
"Byte-compiles your config or selected modules.
|
|
||||||
|
|
||||||
compile [TARGETS...]
|
|
||||||
compile :core :user lang/python
|
|
||||||
compile feature lang
|
|
||||||
|
|
||||||
Accepts :core and :user as special arguments, which target Doom's core files
|
|
||||||
and your private config files, respectively. To recompile your packages, use
|
|
||||||
'doom build' instead."
|
|
||||||
(doom-cli-compile
|
|
||||||
(if (or core-p private-p)
|
|
||||||
(append (if core-p (doom-glob doom-emacs-dir "init.el"))
|
|
||||||
(if core-p (list doom-core-dir))
|
|
||||||
(if private-p (list doom-user-dir)))
|
|
||||||
(or (y-or-n-p
|
|
||||||
(concat "WARNING: Changes made to your config after compiling it won't take effect until\n"
|
|
||||||
"this command is rerun or you run 'doom clean'! It will also make error backtraces\n"
|
|
||||||
"much more difficult to decipher.\n\n"
|
|
||||||
"If you intend to use it anyway, remember this or it will come back to bite you!\n\n"
|
|
||||||
"Continue anyway?"))
|
|
||||||
(user-error "Aborted"))
|
|
||||||
(append (doom-glob doom-emacs-dir "init.el")
|
|
||||||
(list doom-core-dir)
|
|
||||||
(seq-filter
|
|
||||||
;; Only compile Doom's modules
|
|
||||||
(doom-rpartial #'file-in-directory-p doom-emacs-dir)
|
|
||||||
;; Omit `doom-user-dir', which is always first
|
|
||||||
(doom-module-load-path))))
|
|
||||||
recompile-p
|
|
||||||
verbose-p))
|
|
||||||
|
|
||||||
(defcli! clean ()
|
|
||||||
"Delete all *.elc files."
|
|
||||||
(doom-compile-clean))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Helpers
|
|
||||||
|
|
||||||
(cl-defun doom-cli-compile (&optional targets recompile-p verbose-p)
|
|
||||||
"Byte compiles your emacs configuration.
|
|
||||||
|
|
||||||
init.el is always byte-compiled by this.
|
|
||||||
|
|
||||||
If TARGETS is specified, as a list of direcotries
|
|
||||||
|
|
||||||
If MODULES is specified (a list of module strings, e.g. \"lang/php\"), those are
|
|
||||||
byte-compiled. Otherwise, all enabled modules are byte-compiled, including Doom
|
|
||||||
core. It always ignores unit tests and files with `no-byte-compile' enabled.
|
|
||||||
|
|
||||||
WARNING: byte-compilation yields marginal gains and makes debugging new issues
|
|
||||||
difficult. It is recommended you don't use it unless you understand the
|
|
||||||
reprecussions.
|
|
||||||
|
|
||||||
Use `doom-compile-clean' or `make clean' to reverse
|
|
||||||
byte-compilation.
|
|
||||||
|
|
||||||
If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
|
||||||
(let* ((default-directory doom-emacs-dir)
|
|
||||||
(targets (nreverse (delete-dups targets)))
|
|
||||||
;; In case it is changed during compile-time
|
|
||||||
(auto-mode-alist auto-mode-alist)
|
|
||||||
kill-emacs-hook kill-buffer-query-functions)
|
|
||||||
|
|
||||||
(let ((after-load-functions
|
|
||||||
(if (null targets)
|
|
||||||
after-load-functions
|
|
||||||
;; Assemble el files we want to compile, and preserve in the order
|
|
||||||
;; they are loaded in, so we don't run into any scary catch-22s
|
|
||||||
;; while byte-compiling, like missing macros.
|
|
||||||
(cons (let ((target-dirs (seq-filter #'file-directory-p targets)))
|
|
||||||
(lambda (path)
|
|
||||||
(and (not (doom-compile--ignore-file-p path))
|
|
||||||
(seq-find (doom-partial #'file-in-directory-p path)
|
|
||||||
target-dirs)
|
|
||||||
(cl-pushnew path targets))))
|
|
||||||
after-load-functions))))
|
|
||||||
(doom-log "Reloading Doom in preparation for byte-compilation")
|
|
||||||
;; But first we must be sure that Doom and your private config have been
|
|
||||||
;; fully loaded. Which usually aren't so in an noninteractive session.
|
|
||||||
(let ((load-prefer-newer t))
|
|
||||||
(require 'doom-start)))
|
|
||||||
|
|
||||||
(if (null targets)
|
|
||||||
(print! (item "No targets to %scompile" (if recompile-p "re" "")))
|
|
||||||
(print! (start "%scompiling your config...")
|
|
||||||
(if recompile-p "Re" "Byte-"))
|
|
||||||
|
|
||||||
(dolist (dir
|
|
||||||
(cl-remove-if-not #'file-directory-p targets)
|
|
||||||
(setq targets (cl-remove-if #'file-directory-p targets)))
|
|
||||||
(prependq! targets
|
|
||||||
(doom-files-in
|
|
||||||
dir :match "\\.el" :filter #'doom-compile--ignore-file-p)))
|
|
||||||
|
|
||||||
(print-group!
|
|
||||||
(require 'use-package)
|
|
||||||
(condition-case-unless-debug e
|
|
||||||
(let* ((total-ok 0)
|
|
||||||
(total-fail 0)
|
|
||||||
(total-noop 0)
|
|
||||||
(byte-compile-verbose nil)
|
|
||||||
(byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local))
|
|
||||||
(byte-compile-dynamic-docstrings t)
|
|
||||||
(use-package-compute-statistics nil)
|
|
||||||
(use-package-defaults use-package-defaults)
|
|
||||||
(use-package-expand-minimally t)
|
|
||||||
(targets (delete-dups targets))
|
|
||||||
(modules (seq-group-by #'doom-module-from-path targets))
|
|
||||||
(total-files (length targets))
|
|
||||||
(total-modules (length modules))
|
|
||||||
(i 0)
|
|
||||||
last-module)
|
|
||||||
;; Prevent packages from being loaded at compile time if they
|
|
||||||
;; don't meet their own predicates.
|
|
||||||
(push (list :no-require t
|
|
||||||
(lambda (_name args)
|
|
||||||
(or (when-let (pred (or (plist-get args :if)
|
|
||||||
(plist-get args :when)))
|
|
||||||
(not (eval pred t)))
|
|
||||||
(when-let (pred (plist-get args :unless))
|
|
||||||
(eval pred t)))))
|
|
||||||
use-package-defaults)
|
|
||||||
(dolist (module-files modules)
|
|
||||||
(cl-incf i)
|
|
||||||
(dolist (target (cdr module-files))
|
|
||||||
(let ((elc-file (byte-compile-dest-file target)))
|
|
||||||
(cl-incf
|
|
||||||
(if (and recompile-p (not (file-newer-than-file-p target elc-file)))
|
|
||||||
total-noop
|
|
||||||
(pcase (if (not (doom-file-cookie-p target "if" t))
|
|
||||||
'no-byte-compile
|
|
||||||
(unless (equal last-module (car module-files))
|
|
||||||
(print! (success "(% 3d/%d) Compiling %s")
|
|
||||||
i total-modules
|
|
||||||
(if-let (m (caar module-files))
|
|
||||||
(format "%s %s module..." m (cdar module-files))
|
|
||||||
(format "%d stand alone elisp files..."
|
|
||||||
(length (cdr module-files))))
|
|
||||||
(caar module-files) (cdar module-files))
|
|
||||||
(setq last-module (car module-files)))
|
|
||||||
(if verbose-p
|
|
||||||
(byte-compile-file target)
|
|
||||||
(quiet! (byte-compile-file target))))
|
|
||||||
(`no-byte-compile
|
|
||||||
(doom-log "(% 3d/%d) Ignored %s" i total-modules target)
|
|
||||||
total-noop)
|
|
||||||
(`nil
|
|
||||||
(print! (error "(% 3d/%d) Failed to compile %s")
|
|
||||||
i total-modules (relpath target))
|
|
||||||
total-fail)
|
|
||||||
(_ total-ok)))))))
|
|
||||||
(print! (class (if (= total-fail 0) 'success 'warn)
|
|
||||||
"%s %d/%d file(s) (%d ignored)")
|
|
||||||
(if recompile-p "Recompiled" "Byte-compiled")
|
|
||||||
total-ok total-files
|
|
||||||
total-noop)
|
|
||||||
(= total-fail 0))
|
|
||||||
((debug error)
|
|
||||||
(print! (error "There were breaking errors.\n\n%s")
|
|
||||||
"Reverting changes...")
|
|
||||||
(signal 'doom-error (list 'byte-compile e))))))))
|
|
||||||
|
|
||||||
(defun doom-compile--ignore-file-p (path)
|
|
||||||
(let ((filename (file-name-nondirectory path)))
|
|
||||||
(or (not (equal (file-name-extension path) "el"))
|
|
||||||
(member filename (list doom-module-packages-file "doctor.el"))
|
|
||||||
(string-prefix-p "." filename)
|
|
||||||
(string-prefix-p "test-" filename)
|
|
||||||
(string-prefix-p "flycheck_" filename)
|
|
||||||
(string-suffix-p ".example.el" filename))))
|
|
||||||
|
|
||||||
(defun doom-compile-clean ()
|
|
||||||
"Delete all the compiled elc files in your Emacs configuration and private
|
|
||||||
module. This does not include your byte-compiled, third party packages.'"
|
|
||||||
(require 'doom-modules)
|
|
||||||
(print! (start "Cleaning .elc files"))
|
|
||||||
(print-group!
|
|
||||||
(cl-loop with default-directory = doom-emacs-dir
|
|
||||||
with success = 0
|
|
||||||
with esc = (if init-file-debug "" "\033[1A")
|
|
||||||
for path
|
|
||||||
in (append (doom-glob doom-emacs-dir "*.elc")
|
|
||||||
(doom-files-in doom-user-dir :match "\\.elc$" :depth 1)
|
|
||||||
(doom-files-in doom-core-dir :match "\\.elc$")
|
|
||||||
(doom-files-in doom-module-load-path :match "\\.elc$" :depth 4))
|
|
||||||
if (file-exists-p path)
|
|
||||||
do (delete-file path)
|
|
||||||
and do (print! (success "\033[KDeleted %s%s") (relpath path) esc)
|
|
||||||
and do (cl-incf success)
|
|
||||||
finally do
|
|
||||||
(print! (if (> success 0)
|
|
||||||
(success "\033[K%d elc files deleted" success)
|
|
||||||
(item "\033[KNo elc files to clean"))))
|
|
||||||
t))
|
|
||||||
|
|
||||||
(provide 'doom-cli-compile)
|
|
||||||
;;; compile.el ends here
|
|
466
lisp/cli/help.el
466
lisp/cli/help.el
|
@ -1,466 +0,0 @@
|
||||||
;;; lisp/cli/help.el -*- lexical-binding: t; -*-
|
|
||||||
;;; Commentary:
|
|
||||||
;;
|
|
||||||
;; This file defines special commands that the Doom CLI will invoke when a
|
|
||||||
;; command is passed with -?, --help, or --version. They can also be aliased to
|
|
||||||
;; a sub-command to make more of its capabilities accessible to users, with:
|
|
||||||
;;
|
|
||||||
;; (defcli-alias! (myscript (help h)) (:help))
|
|
||||||
;;
|
|
||||||
;; You can define your own command-specific help handlers, e.g.
|
|
||||||
;;
|
|
||||||
;; (defcli! (:help myscript subcommand) () ...)
|
|
||||||
;;
|
|
||||||
;; And it will be invoked instead of the generic one.
|
|
||||||
;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Variables
|
|
||||||
|
|
||||||
(defvar doom-help-commands '("%p %c {-?,--help}")
|
|
||||||
"A list of help commands recognized for the running script.
|
|
||||||
|
|
||||||
Recognizes %p (for the prefix) and %c (for the active command).")
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Commands
|
|
||||||
|
|
||||||
(defcli! (:root :help)
|
|
||||||
((localonly? ("-g" "--no-global") "Hide global options")
|
|
||||||
(manpage? ("--manpage") "Generate in manpage format")
|
|
||||||
(commands? ("--commands") "List all known commands")
|
|
||||||
&multiple
|
|
||||||
(sections ("--synopsis" "--subcommands" "--similar" "--envvars"
|
|
||||||
"--postamble")
|
|
||||||
"Show only the specified sections.")
|
|
||||||
&context context
|
|
||||||
&args command)
|
|
||||||
"Show documentation for a Doom CLI command.
|
|
||||||
|
|
||||||
OPTIONS:
|
|
||||||
--synopsis, --subcommands, --similar, --envvars, --postamble
|
|
||||||
TODO"
|
|
||||||
(doom-cli-load-all)
|
|
||||||
(when (doom-cli-context-error context)
|
|
||||||
(terpri))
|
|
||||||
(let* ((command (cons (doom-cli-context-prefix context) command))
|
|
||||||
(cli (doom-cli-get command t))
|
|
||||||
(rcli (doom-cli-get cli))
|
|
||||||
(fallbackcli (cl-loop with targets = (doom-cli--command-expand (butlast command) t)
|
|
||||||
for cmd in (cons command targets)
|
|
||||||
if (doom-cli-get cmd t)
|
|
||||||
return it)))
|
|
||||||
(cond (commands?
|
|
||||||
(let ((cli (or cli (doom-cli-get (doom-cli-context-prefix context)))))
|
|
||||||
(print! "Commands under '%s':\n%s"
|
|
||||||
(doom-cli-command-string cli)
|
|
||||||
(indent (doom-cli-help--render-commands
|
|
||||||
(or (doom-cli-subcommands cli)
|
|
||||||
(user-error "No commands found"))
|
|
||||||
:prefix (doom-cli-command cli)
|
|
||||||
:inline? t
|
|
||||||
:docs? t)))))
|
|
||||||
((null sections)
|
|
||||||
(if (null cli)
|
|
||||||
(signal 'doom-cli-command-not-found-error command)
|
|
||||||
(doom-cli-help--print cli context manpage? localonly?)
|
|
||||||
(exit! :pager?)))
|
|
||||||
((dolist (section sections)
|
|
||||||
(unless (equal section (car sections)) (terpri))
|
|
||||||
(pcase section
|
|
||||||
("--synopsis"
|
|
||||||
(print! "%s" (doom-cli-help--render-synopsis
|
|
||||||
(doom-cli-help--synopsis cli)
|
|
||||||
"Usage: ")))
|
|
||||||
("--subcommands"
|
|
||||||
(print! "%s\n%s" (bold "Available commands:")
|
|
||||||
(indent (doom-cli-help--render-commands
|
|
||||||
(doom-cli-subcommands rcli 1)
|
|
||||||
:prefix command
|
|
||||||
:grouped? t
|
|
||||||
:docs? t)
|
|
||||||
doom-print-indent-increment)))
|
|
||||||
("--similar"
|
|
||||||
(unless command
|
|
||||||
(user-error "No command specified"))
|
|
||||||
(let ((similar (doom-cli-help-similar-commands command 0.4)))
|
|
||||||
(print! "Similar commands:")
|
|
||||||
(if (not similar)
|
|
||||||
(print! (indent (warn "Can't find any!")))
|
|
||||||
(dolist (command (seq-take similar 10))
|
|
||||||
(print! (indent (item "(%d%%) %s"))
|
|
||||||
(* (car command) 100)
|
|
||||||
(doom-cli-command-string (cdr command)))))))
|
|
||||||
("--envvars"
|
|
||||||
(let* ((key "ENVIRONMENT VARIABLES")
|
|
||||||
(clis (if command (doom-cli-find command) (hash-table-values doom-cli--table)))
|
|
||||||
(clis (seq-remove #'doom-cli-alias clis))
|
|
||||||
(clis (seq-filter (fn! (cdr (assoc key (doom-cli-docs %)))) clis))
|
|
||||||
(clis (seq-group-by #'doom-cli-command clis)))
|
|
||||||
(print! "List of environment variables for %s:\n" command)
|
|
||||||
(if (null clis)
|
|
||||||
(print! (indent "None!"))
|
|
||||||
(dolist (group clis)
|
|
||||||
(print! (bold "%s%s:"
|
|
||||||
(doom-cli-command-string (car group))
|
|
||||||
(if (doom-cli-fn (doom-cli-get (car group)))
|
|
||||||
"" " *")))
|
|
||||||
(dolist (cli (cdr group))
|
|
||||||
(print! (indent "%s") (markup (cdr (assoc key (doom-cli-docs cli))))))))))
|
|
||||||
("--postamble"
|
|
||||||
(print! "See %s for documentation."
|
|
||||||
(join (cl-loop with spec =
|
|
||||||
`((?p . ,(doom-cli-context-prefix context))
|
|
||||||
(?c . ,(doom-cli-command-string (cdr (doom-cli-command (or cli fallbackcli))))))
|
|
||||||
for cmd in doom-help-commands
|
|
||||||
for formatted = (trim (format-spec cmd spec))
|
|
||||||
collect (replace-regexp-in-string
|
|
||||||
" +" " " (format "'%s'" formatted)))
|
|
||||||
" or ")))))))))
|
|
||||||
|
|
||||||
(defcli! (:root :version)
|
|
||||||
((simple? ("--simple"))
|
|
||||||
&context context)
|
|
||||||
"Show installed versions of Doom, Doom modules, and Emacs."
|
|
||||||
(doom/version)
|
|
||||||
(unless simple?
|
|
||||||
(terpri)
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert-file-contents (doom-path doom-emacs-dir "LICENSE"))
|
|
||||||
(re-search-forward "^Copyright (c) ")
|
|
||||||
(print! "%s\n" (trim (thing-at-point 'line t)))
|
|
||||||
(print! (p "Doom Emacs uses the MIT license and is provided without warranty "
|
|
||||||
"of any kind. You may redistribute and modify copies if "
|
|
||||||
"given proper attribution. See the LICENSE file for details.")))))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Helpers
|
|
||||||
|
|
||||||
(defun doom-cli-help (cli)
|
|
||||||
"Return an alist of documentation summarizing CLI (a `doom-cli')."
|
|
||||||
(let* ((rcli (doom-cli-get cli))
|
|
||||||
(docs (doom-cli-docs rcli)))
|
|
||||||
`((command . ,(doom-cli-command-string cli))
|
|
||||||
(summary . ,(or (cdr (assoc "SUMMARY" docs)) "TODO"))
|
|
||||||
(description . ,(or (cdr (assoc "MAIN" docs)) "TODO"))
|
|
||||||
(synopsis . ,(doom-cli-help--synopsis cli))
|
|
||||||
(arguments . ,(doom-cli-help--arguments rcli))
|
|
||||||
(options . ,(doom-cli-help--options rcli))
|
|
||||||
(commands . ,(doom-cli-subcommands cli 1))
|
|
||||||
(sections . ,(seq-filter #'cdr (cddr docs))))))
|
|
||||||
|
|
||||||
(defun doom-cli-help-similar-commands (command &optional maxscore)
|
|
||||||
"Return N commands that are similar to COMMAND."
|
|
||||||
(seq-take-while
|
|
||||||
(fn! (>= (car %) (or maxscore 0.0)))
|
|
||||||
(seq-sort-by
|
|
||||||
#'car #'>
|
|
||||||
(cl-loop with prefix = (seq-find #'doom-cli-get (nreverse (doom-cli--command-expand command t)))
|
|
||||||
with input = (doom-cli-command-string (cdr (doom-cli--command command t)))
|
|
||||||
for command in (hash-table-keys doom-cli--table)
|
|
||||||
if (doom-cli-fn (doom-cli-get command))
|
|
||||||
if (equal prefix (seq-take command (length prefix)))
|
|
||||||
collect (cons (doom-cli-help--similarity
|
|
||||||
input (doom-cli-command-string (cdr command)))
|
|
||||||
command)))))
|
|
||||||
|
|
||||||
(defun doom-cli-help--similarity (s1 s2)
|
|
||||||
;; Ratcliff-Obershelp similarity
|
|
||||||
(let* ((s1 (downcase s1))
|
|
||||||
(s2 (downcase s2))
|
|
||||||
(s1len (length s1))
|
|
||||||
(s2len (length s2)))
|
|
||||||
(if (or (zerop s1len)
|
|
||||||
(zerop s2len))
|
|
||||||
0.0
|
|
||||||
(/ (let ((i 0) (j 0) (score 0) jlast)
|
|
||||||
(while (< i s1len)
|
|
||||||
(unless jlast (setq jlast j))
|
|
||||||
(if (and (< j s2len)
|
|
||||||
(= (aref s1 i) (aref s2 j)))
|
|
||||||
(progn (cl-incf score)
|
|
||||||
(cl-incf i)
|
|
||||||
(cl-incf j))
|
|
||||||
(setq m 0)
|
|
||||||
(cl-incf j)
|
|
||||||
(when (>= j s2len)
|
|
||||||
(setq j (or jlast j)
|
|
||||||
jlast nil)
|
|
||||||
(cl-incf i))))
|
|
||||||
(* 2.0 score))
|
|
||||||
(+ (length s1)
|
|
||||||
(length s2))))))
|
|
||||||
|
|
||||||
;;; Help: printers
|
|
||||||
;; TODO Parameterize optional args with `cl-defun'
|
|
||||||
(defun doom-cli-help--print (cli context &optional manpage? noglobal?)
|
|
||||||
"Write CLI's documentation in a manpage-esque format to stdout."
|
|
||||||
(let-alist (doom-cli-help cli)
|
|
||||||
(let* ((alist
|
|
||||||
`(,@(if manpage?
|
|
||||||
`((nil . ,(let* ((title (cadr (member "--load" command-line-args)))
|
|
||||||
(width (floor (/ (- (doom-cli-context-width context)
|
|
||||||
(length title))
|
|
||||||
2.0))))
|
|
||||||
;; FIXME Who am I fooling?
|
|
||||||
(format (format "%%-%ds%%s%%%ds" width width)
|
|
||||||
"DOOM(1)" title "DOOM(1)")))
|
|
||||||
("NAME" . ,(concat .command " - " .summary))
|
|
||||||
("SYNOPSIS" . ,(doom-cli-help--render-synopsis .synopsis nil t))
|
|
||||||
("DESCRIPTION" . ,.description))
|
|
||||||
`((nil . ,(doom-cli-help--render-synopsis .synopsis "Usage: "))
|
|
||||||
(nil . ,(string-join (seq-remove #'string-empty-p (list .summary .description))
|
|
||||||
"\n\n"))))
|
|
||||||
("ARGUMENTS" . ,(doom-cli-help--render-arguments .arguments))
|
|
||||||
("COMMANDS"
|
|
||||||
. ,(doom-cli-help--render-commands
|
|
||||||
.commands :prefix (doom-cli-command cli) :grouped? t :docs? t))
|
|
||||||
("OPTIONS"
|
|
||||||
. ,(doom-cli-help--render-options
|
|
||||||
(if (or (not (doom-cli-fn cli)) noglobal?)
|
|
||||||
`(,(assq 'local .options))
|
|
||||||
.options)
|
|
||||||
cli))))
|
|
||||||
(command (doom-cli-command cli)))
|
|
||||||
(letf! (defun printsection (section)
|
|
||||||
(print! "%s\n"
|
|
||||||
(if (null section)
|
|
||||||
(dark "TODO")
|
|
||||||
(markup
|
|
||||||
(format-spec
|
|
||||||
section `((?p . ,(car command))
|
|
||||||
(?c . ,(doom-cli-command-string (cdr command))))
|
|
||||||
'ignore)))))
|
|
||||||
(pcase-dolist (`(,label . ,contents) alist)
|
|
||||||
(when (and contents (not (string-blank-p contents)))
|
|
||||||
(when label
|
|
||||||
(print! (bold "%s%s") label (if manpage? "" ":")))
|
|
||||||
(print-group! :if label (printsection contents))))
|
|
||||||
(pcase-dolist (`(,label . ,contents) .sections)
|
|
||||||
(when (and contents (not (assoc label alist)))
|
|
||||||
(print! (bold "%s:") label)
|
|
||||||
(print-group! (printsection contents))))))))
|
|
||||||
|
|
||||||
;;; Help: synopsis
|
|
||||||
(defun doom-cli-help--synopsis (cli &optional all-options?)
|
|
||||||
(let* ((rcli (doom-cli-get cli))
|
|
||||||
(opts (doom-cli-help--options rcli))
|
|
||||||
(opts (mapcar #'car (if all-options? (mapcan #'cdr opts) (alist-get 'local opts))))
|
|
||||||
(opts (cl-loop for opt in opts
|
|
||||||
for args = (cdar opt)
|
|
||||||
for switches = (mapcar #'car opt)
|
|
||||||
for multi? = (member "..." args)
|
|
||||||
if args
|
|
||||||
collect (format (if multi? "[%s %s]..." "[%s %s]")
|
|
||||||
(string-join switches "|")
|
|
||||||
(string-join (remove "..." args) "|"))
|
|
||||||
else collect (format "[%s]" (string-join switches "|"))))
|
|
||||||
(args (doom-cli-arguments rcli))
|
|
||||||
(subcommands? (doom-cli-subcommands rcli 1 :predicate? t)))
|
|
||||||
`((command . ,(doom-cli-command cli))
|
|
||||||
(options ,@opts)
|
|
||||||
(required ,@(mapcar (fn! (upcase (format "`%s'" %))) (if subcommands? '(command) (alist-get '&required args))))
|
|
||||||
(optional ,@(mapcar (fn! (upcase (format "[`%s']" %)))(alist-get '&optional args)))
|
|
||||||
(rest ,@(mapcar (fn! (upcase (format "[`%s'...]" %))) (if subcommands? '(args) (alist-get '&args args)))))))
|
|
||||||
|
|
||||||
(defun doom-cli-help--render-synopsis (synopsis &optional prefix)
|
|
||||||
(let-alist synopsis
|
|
||||||
(let ((doom-print-indent 0)
|
|
||||||
(prefix (or prefix ""))
|
|
||||||
(command (doom-cli-command-string .command)))
|
|
||||||
(string-trim-right
|
|
||||||
(format! "%s\n\n"
|
|
||||||
(fill (concat (bold prefix)
|
|
||||||
(format "%s " command)
|
|
||||||
(markup
|
|
||||||
(join (append .options
|
|
||||||
(and .options
|
|
||||||
(or .required
|
|
||||||
.optional
|
|
||||||
.rest)
|
|
||||||
(list (dark "[--]")))
|
|
||||||
.required
|
|
||||||
.optional
|
|
||||||
.rest))))
|
|
||||||
80 (1+ (length (concat prefix command)))))))))
|
|
||||||
|
|
||||||
;;; Help: arguments
|
|
||||||
(defun doom-cli-help--arguments (cli &optional all?)
|
|
||||||
(doom-cli-help--parse-docs (doom-cli-find cli t) "ARGUMENTS"))
|
|
||||||
|
|
||||||
(defun doom-cli-help--render-arguments (arguments)
|
|
||||||
(mapconcat (lambda (arg)
|
|
||||||
(format! "%-20s\n%s"
|
|
||||||
(underscore (car arg))
|
|
||||||
(indent (if (equal (cdr arg) "TODO")
|
|
||||||
(dark (cdr arg))
|
|
||||||
(cdr arg))
|
|
||||||
doom-print-indent-increment)))
|
|
||||||
arguments
|
|
||||||
"\n"))
|
|
||||||
|
|
||||||
;;; Help: commands
|
|
||||||
(cl-defun doom-cli-help--render-commands (commands &key prefix grouped? docs? (inline? t))
|
|
||||||
(with-temp-buffer
|
|
||||||
(let* ((doom-print-indent 0)
|
|
||||||
(commands (seq-group-by (fn! (if grouped? (doom-cli-prop (doom-cli-get % t) :group)))
|
|
||||||
(nreverse commands)))
|
|
||||||
(toplevel (assq nil commands))
|
|
||||||
(rest (remove toplevel commands))
|
|
||||||
(drop (if prefix (length prefix) 0))
|
|
||||||
(minwidth
|
|
||||||
(apply
|
|
||||||
#'max (or (cl-loop for cmd in (apply #'append (mapcar #'cdr commands))
|
|
||||||
for cmd = (seq-drop cmd drop)
|
|
||||||
collect (length (doom-cli-command-string cmd)))
|
|
||||||
(list 15))))
|
|
||||||
(ellipsis (doom-print--style 'dark " […]"))
|
|
||||||
(ellipsislen (- (length ellipsis) (if (eq doom-print-backend 'ansi) 2 4))))
|
|
||||||
(dolist (group (cons toplevel rest))
|
|
||||||
(let ((label (if (car-safe group) (cdr commands))))
|
|
||||||
(when label
|
|
||||||
(insert! ((bold "%s:") (car group)) "\n"))
|
|
||||||
(print-group! :if label
|
|
||||||
(dolist (command (cdr group))
|
|
||||||
(let* ((cli (doom-cli-get command t))
|
|
||||||
(rcli (doom-cli-get command))
|
|
||||||
(summary (doom-cli-short-docs rcli))
|
|
||||||
(subcommands? (doom-cli-subcommands cli 1 :predicate? t)))
|
|
||||||
(insert! ((format "%%-%ds%%s%%s"
|
|
||||||
(+ (- minwidth doom-print-indent)
|
|
||||||
doom-print-indent-increment
|
|
||||||
(if subcommands? ellipsislen 0)))
|
|
||||||
(concat (doom-cli-command-string (seq-drop command drop))
|
|
||||||
(if subcommands? ellipsis))
|
|
||||||
(if inline? " " "\n")
|
|
||||||
(indent (if (and (doom-cli-alias cli)
|
|
||||||
(not (doom-cli-type rcli)))
|
|
||||||
(dark "-> %s" (doom-cli-command-string cli))
|
|
||||||
(when docs?
|
|
||||||
(if summary (markup summary) (dark "TODO"))))))
|
|
||||||
"\n")))
|
|
||||||
(when (cdr rest)
|
|
||||||
(insert "\n")))))
|
|
||||||
(string-trim-right (buffer-string)))))
|
|
||||||
|
|
||||||
;;; Help: options
|
|
||||||
(defun doom-cli-help--options (cli &optional noformatting?)
|
|
||||||
"Return an alist summarizing CLI's options.
|
|
||||||
|
|
||||||
The alist's CAR are lists of formatted switches plus their arguments, e.g.
|
|
||||||
'((\"`--foo'\" \"`BAR'\") ...). Their CDR is their formatted documentation."
|
|
||||||
(let* ((docs (doom-cli-help--parse-docs (doom-cli-find cli t) "OPTIONS"))
|
|
||||||
(docs (mapcar (fn! (cons (split-string (car %) ", ")
|
|
||||||
(cdr %)))
|
|
||||||
docs))
|
|
||||||
(strfmt (if noformatting? "%s" "`%s'"))
|
|
||||||
local-options
|
|
||||||
global-options
|
|
||||||
seen)
|
|
||||||
(dolist (neighbor (nreverse (doom-cli-find cli)))
|
|
||||||
(dolist (option (doom-cli-options neighbor))
|
|
||||||
(when-let* ((switches (cl-loop for sw in (doom-cli-option-switches option)
|
|
||||||
if (and (doom-cli-option-flag-p option)
|
|
||||||
(string-prefix-p "--" sw))
|
|
||||||
collect (format "--[no-]%s" (substring sw 2))
|
|
||||||
else collect sw))
|
|
||||||
(switches (seq-difference switches seen)))
|
|
||||||
(dolist (switch switches) (push switch seen))
|
|
||||||
(push (cons (cl-loop for switch in switches
|
|
||||||
if (doom-cli-option-arguments option)
|
|
||||||
collect (cons (format strfmt switch)
|
|
||||||
(append (doom-cli-help--parse-args it noformatting?)
|
|
||||||
(when (doom-cli-option-multiple-p option)
|
|
||||||
(list "..."))))
|
|
||||||
else collect (list (format strfmt switch)))
|
|
||||||
(string-join
|
|
||||||
(or (delq
|
|
||||||
nil (cons (when-let (docs (doom-cli-option-docs option))
|
|
||||||
(concat docs "."))
|
|
||||||
(cl-loop for (flags . docs) in docs
|
|
||||||
unless (equal (seq-difference flags switches) flags)
|
|
||||||
collect docs)))
|
|
||||||
'("TODO"))
|
|
||||||
"\n\n"))
|
|
||||||
(if (equal (doom-cli-command neighbor)
|
|
||||||
(doom-cli-command cli))
|
|
||||||
local-options
|
|
||||||
global-options)))))
|
|
||||||
`((local . ,(nreverse local-options))
|
|
||||||
(global . ,(nreverse global-options)))))
|
|
||||||
|
|
||||||
(defun doom-cli-help--render-options (options &optional cli)
|
|
||||||
(let ((doom-print-indent 0)
|
|
||||||
(local (assq 'local options))
|
|
||||||
(global (assq 'global options)))
|
|
||||||
(when (or (cdr local) (cdr global))
|
|
||||||
(letf! (defun printopts (opts)
|
|
||||||
(pcase-dolist (`(,switches . ,docs) (cdr opts))
|
|
||||||
(let (multiple?)
|
|
||||||
(insert!
|
|
||||||
("%s%s\n%s"
|
|
||||||
(mapconcat
|
|
||||||
(fn! (when (member "..." (cdr %))
|
|
||||||
(setq multiple? t))
|
|
||||||
(string-trim-right
|
|
||||||
(format "%s %s"
|
|
||||||
(doom-print--cli-markup (car %))
|
|
||||||
(doom-print--cli-markup
|
|
||||||
(string-join (remove "..." (cdr %)) "|")))))
|
|
||||||
switches
|
|
||||||
", ")
|
|
||||||
(if multiple? ", ..." "")
|
|
||||||
(indent (fill (markup docs)) doom-print-indent-increment))
|
|
||||||
"\n\n"))))
|
|
||||||
(with-temp-buffer
|
|
||||||
(if (null (cdr local))
|
|
||||||
(insert (if global "This command has no local options.\n" "") "\n")
|
|
||||||
(printopts local))
|
|
||||||
(when (cdr global)
|
|
||||||
(insert! ((bold "Global options:\n")))
|
|
||||||
(print-group! (printopts global)))
|
|
||||||
(string-trim-right (buffer-string)))))))
|
|
||||||
|
|
||||||
;;; Help: internal
|
|
||||||
(defun doom-cli-help--parse-args (args &optional noformatting?)
|
|
||||||
(cl-loop for arg in args
|
|
||||||
if (listp arg)
|
|
||||||
collect (string-join (doom-cli-help--parse-args arg noformatting?) "|")
|
|
||||||
else if (symbolp arg)
|
|
||||||
collect (format (if noformatting? "%s" "`%s'") (upcase (symbol-name arg)))
|
|
||||||
else collect arg))
|
|
||||||
|
|
||||||
(defun doom-cli-help--parse-docs (cli-list section-name)
|
|
||||||
(cl-check-type section-name string)
|
|
||||||
(let (alist)
|
|
||||||
(dolist (cli cli-list (nreverse alist))
|
|
||||||
(when-let (section (cdr (assoc section-name (doom-cli-docs cli))))
|
|
||||||
(with-temp-buffer
|
|
||||||
(save-excursion (insert section))
|
|
||||||
(let ((lead (current-indentation))
|
|
||||||
(buffer (current-buffer)))
|
|
||||||
(while (not (eobp))
|
|
||||||
(let ((heading (string-trim (buffer-substring (point-at-bol) (point-at-eol))))
|
|
||||||
(beg (point-at-bol 2))
|
|
||||||
end)
|
|
||||||
(forward-line 1)
|
|
||||||
(while (and (not (eobp))
|
|
||||||
(/= (current-indentation) lead)
|
|
||||||
(forward-line 1)))
|
|
||||||
(setf (alist-get heading alist nil nil #'equal)
|
|
||||||
(string-join
|
|
||||||
(delq
|
|
||||||
nil (list (alist-get heading alist nil nil #'equal)
|
|
||||||
(let ((end (point)))
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert-buffer-substring buffer beg end)
|
|
||||||
(goto-char (point-min))
|
|
||||||
(indent-rigidly (point-min) (point-max) (- (current-indentation)))
|
|
||||||
(string-trim-right (buffer-string))))))
|
|
||||||
"\n\n"))))))))))
|
|
||||||
|
|
||||||
(provide 'doom-cli-help)
|
|
||||||
;;; help.el ends here
|
|
|
@ -55,20 +55,19 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g.
|
||||||
(setq doom-user-dir (expand-file-name "doom/" xdg-config-dir)))))
|
(setq doom-user-dir (expand-file-name "doom/" xdg-config-dir)))))
|
||||||
|
|
||||||
(if (file-directory-p doom-user-dir)
|
(if (file-directory-p doom-user-dir)
|
||||||
(print! (item "Skipping %s (already exists)") (relpath doom-user-dir))
|
(print! (item "Skipping %s (already exists)") (path doom-user-dir))
|
||||||
(make-directory doom-user-dir 'parents)
|
(make-directory doom-user-dir 'parents)
|
||||||
(print! (success "Created %s") (relpath doom-user-dir)))
|
(print! (success "Created %s") (path doom-user-dir)))
|
||||||
|
|
||||||
;; Create init.el, config.el & packages.el
|
;; Create init.el, config.el & packages.el
|
||||||
(print-group!
|
(print-group!
|
||||||
(mapc (lambda (file)
|
(mapc (lambda (file)
|
||||||
(cl-destructuring-bind (filename . template) file
|
(cl-destructuring-bind (filename . template) file
|
||||||
(if (file-exists-p! filename doom-user-dir)
|
(setq filename (doom-path doom-user-dir filename))
|
||||||
(print! (item "Skipping %s (already exists)")
|
(if (file-exists-p filename)
|
||||||
(path filename))
|
(print! (item "Skipping %s (already exists)...") (path filename))
|
||||||
(print! (item "Creating %s%s") (relpath doom-user-dir) filename)
|
(print! (item "Creating %s...") (path filename))
|
||||||
(with-temp-file (doom-path doom-user-dir filename)
|
(with-temp-file filename (insert-file-contents template))
|
||||||
(insert-file-contents template))
|
|
||||||
(print! (success "Done!")))))
|
(print! (success "Done!")))))
|
||||||
(let ((template-dir (doom-path doom-emacs-dir "templates")))
|
(let ((template-dir (doom-path doom-emacs-dir "templates")))
|
||||||
`((,doom-module-init-file
|
`((,doom-module-init-file
|
||||||
|
@ -96,7 +95,7 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g.
|
||||||
(if (eq install? :no)
|
(if (eq install? :no)
|
||||||
(print! (warn "Not installing plugins, as requested"))
|
(print! (warn "Not installing plugins, as requested"))
|
||||||
(print! "Installing plugins")
|
(print! "Installing plugins")
|
||||||
(doom-packages-install))
|
(doom-packages-ensure))
|
||||||
|
|
||||||
(print! "Regenerating autoloads files")
|
(print! "Regenerating autoloads files")
|
||||||
(doom-profile-generate)
|
(doom-profile-generate)
|
||||||
|
|
|
@ -13,28 +13,12 @@
|
||||||
;;
|
;;
|
||||||
;;; Commands
|
;;; Commands
|
||||||
|
|
||||||
(defcli! (:before (build b purge p)) (&context context)
|
(defcli-obsolete! ((build b)) (sync "--rebuild") "v3.0.0")
|
||||||
(require 'comp nil t)
|
|
||||||
(doom-initialize-core-packages))
|
|
||||||
|
|
||||||
;; DEPRECATED Replace with "doom sync --rebuild"
|
(defcli-obsolete! ((purge p)) (gc) "v3.0.0")
|
||||||
(defcli! ((build b))
|
|
||||||
((rebuild-p ("-r") "Only rebuild packages that need rebuilding")
|
|
||||||
(jobs ("-j" "--jobs" num) "How many CPUs to use for native compilation"))
|
|
||||||
"Byte-compiles & symlinks installed packages.
|
|
||||||
|
|
||||||
This ensures that all needed files are symlinked from their package repo and
|
|
||||||
their elisp files are byte-compiled. This is especially necessary if you upgrade
|
|
||||||
Emacs (as byte-code is generally not forward-compatible)."
|
|
||||||
:benchmark t
|
|
||||||
(when jobs
|
|
||||||
(setq native-comp-async-jobs-number (truncate jobs)))
|
|
||||||
(when (doom-packages-build (not rebuild-p))
|
|
||||||
(doom-profile-generate))
|
|
||||||
t)
|
|
||||||
|
|
||||||
;; TODO Rename to "doom gc" and move to its own file
|
;; TODO Rename to "doom gc" and move to its own file
|
||||||
(defcli! ((purge p))
|
(defcli! (gc)
|
||||||
((nobuilds-p ("-b" "--no-builds") "Don't purge unneeded (built) packages")
|
((nobuilds-p ("-b" "--no-builds") "Don't purge unneeded (built) packages")
|
||||||
(noelpa-p ("-p" "--no-elpa") "Don't purge ELPA packages")
|
(noelpa-p ("-p" "--no-elpa") "Don't purge ELPA packages")
|
||||||
(norepos-p ("-r" "--no-repos") "Don't purge unused straight repos")
|
(norepos-p ("-r" "--no-repos") "Don't purge unused straight repos")
|
||||||
|
@ -50,6 +34,8 @@ possible.
|
||||||
It is a good idea to occasionally run this doom purge -g to ensure your package
|
It is a good idea to occasionally run this doom purge -g to ensure your package
|
||||||
list remains lean."
|
list remains lean."
|
||||||
:benchmark t
|
:benchmark t
|
||||||
|
(require 'comp nil t)
|
||||||
|
(doom-initialize-core-packages)
|
||||||
(straight-check-all)
|
(straight-check-all)
|
||||||
(when (doom-packages-purge
|
(when (doom-packages-purge
|
||||||
(not noelpa-p)
|
(not noelpa-p)
|
||||||
|
@ -242,154 +228,147 @@ list remains lean."
|
||||||
|
|
||||||
(defun doom-packages--write-missing-eln-errors ()
|
(defun doom-packages--write-missing-eln-errors ()
|
||||||
"Write .error files for any expected .eln files that are missing."
|
"Write .error files for any expected .eln files that are missing."
|
||||||
(when (featurep 'native-compile)
|
(cl-loop for file in doom-packages--eln-output-expected
|
||||||
(cl-loop for file in doom-packages--eln-output-expected
|
for eln-name = (doom-packages--eln-file-name file)
|
||||||
for eln-name = (doom-packages--eln-file-name file)
|
for eln-file = (doom-packages--eln-output-file eln-name)
|
||||||
for eln-file = (doom-packages--eln-output-file eln-name)
|
for error-file = (doom-packages--eln-error-file eln-name)
|
||||||
for error-file = (doom-packages--eln-error-file eln-name)
|
for error-dir = (file-name-directory error-file)
|
||||||
for error-dir = (file-name-directory error-file)
|
unless (or (file-exists-p eln-file)
|
||||||
unless (or (file-exists-p eln-file)
|
(file-newer-than-file-p error-file file)
|
||||||
(file-newer-than-file-p error-file file)
|
(not (file-writable-p error-dir)))
|
||||||
(not (file-writable-p error-dir)))
|
do (make-directory error-dir 'parents)
|
||||||
do (make-directory error-dir 'parents)
|
(write-region "" nil error-file)
|
||||||
(write-region "" nil error-file)
|
(doom-log "Wrote %s" error-file))
|
||||||
(doom-log "Wrote %s" error-file))
|
(setq doom-packages--eln-output-expected nil))
|
||||||
(setq doom-packages--eln-output-expected nil)))
|
|
||||||
|
|
||||||
(defun doom-packages--compile-site-files ()
|
(defun doom-packages--compile-site-files ()
|
||||||
"Queue async compilation for all non-doom Elisp files."
|
"Queue async compilation for all non-doom Elisp files."
|
||||||
(when (featurep 'native-compile)
|
(cl-loop with paths = (cl-loop for path in load-path
|
||||||
(cl-loop with paths = (cl-loop for path in load-path
|
unless (file-in-directory-p path doom-local-dir)
|
||||||
unless (file-in-directory-p path doom-local-dir)
|
collect path)
|
||||||
collect path)
|
for file in (doom-files-in paths :match "\\.el\\(?:\\.gz\\)?$")
|
||||||
for file in (doom-files-in paths :match "\\.el\\(?:\\.gz\\)?$")
|
if (and (file-exists-p (byte-compile-dest-file file))
|
||||||
if (and (file-exists-p (byte-compile-dest-file file))
|
(not (doom-packages--find-eln-file (doom-packages--eln-file-name file)))
|
||||||
(not (doom-packages--find-eln-file (doom-packages--eln-file-name file)))
|
(not (cl-some (fn! (string-match-p % file))
|
||||||
(not (cl-some (fn! (string-match-p % file))
|
native-comp-deferred-compilation-deny-list))) do
|
||||||
native-comp-deferred-compilation-deny-list))) do
|
(doom-log "Compiling %s" file)
|
||||||
(doom-log "Compiling %s" file)
|
(native-compile-async file)))
|
||||||
(native-compile-async file))))
|
|
||||||
|
|
||||||
(defun doom-packages-install ()
|
(defun doom-packages-ensure (&optional force-p)
|
||||||
"Installs missing packages.
|
"Ensure packages are installed, built"
|
||||||
|
|
||||||
This function will install any primary package (i.e. a package with a `package!'
|
|
||||||
declaration) or dependency thereof that hasn't already been."
|
|
||||||
(doom-initialize-packages)
|
(doom-initialize-packages)
|
||||||
(print! (start "Installing packages..."))
|
(if (not (file-directory-p (straight--repos-dir)))
|
||||||
(let ((pinned (doom-package-pinned-list)))
|
(print! (start "Installing all packages for the first time (this may take a while)..."))
|
||||||
(print-group!
|
(if force-p
|
||||||
(add-hook 'native-comp-async-cu-done-functions #'doom-packages--native-compile-done-h)
|
(print! (start "Rebuilding all packages (this may take a while)..."))
|
||||||
(if-let (built
|
(print! (start "Ensuring packages are installed and built..."))))
|
||||||
(doom-packages--with-recipes (doom-package-recipe-list)
|
|
||||||
(recipe package type local-repo)
|
|
||||||
(unless (file-directory-p (straight--repos-dir local-repo))
|
|
||||||
(doom-packages--cli-recipes-update))
|
|
||||||
(condition-case-unless-debug e
|
|
||||||
(let ((straight-use-package-pre-build-functions
|
|
||||||
(cons (lambda (pkg &rest _)
|
|
||||||
(when-let (commit (cdr (assoc pkg pinned)))
|
|
||||||
(print! (item "Checked out %s: %s") pkg commit)))
|
|
||||||
straight-use-package-pre-build-functions)))
|
|
||||||
(straight-use-package (intern package))
|
|
||||||
;; HACK Line encoding issues can plague repos with dirty
|
|
||||||
;; worktree prompts when updating packages or "Local
|
|
||||||
;; variables entry is missing the suffix" errors when
|
|
||||||
;; installing them (see hlissner/doom-emacs#2637), so
|
|
||||||
;; have git handle conversion by force.
|
|
||||||
(when (and doom--system-windows-p (stringp local-repo))
|
|
||||||
(let ((default-directory (straight--repos-dir local-repo)))
|
|
||||||
(when (file-in-directory-p default-directory straight-base-dir)
|
|
||||||
(straight--process-run "git" "config" "core.autocrlf" "true")))))
|
|
||||||
(error
|
|
||||||
(signal 'doom-package-error (list package e))))))
|
|
||||||
(progn
|
|
||||||
(when (featurep 'native-compile)
|
|
||||||
(doom-packages--compile-site-files)
|
|
||||||
(doom-packages--wait-for-native-compile-jobs)
|
|
||||||
(doom-packages--write-missing-eln-errors))
|
|
||||||
(print! (success "\033[KInstalled %d packages") (length built)))
|
|
||||||
(print! (item "No packages need to be installed"))
|
|
||||||
nil))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun doom-packages-build (&optional force-p)
|
|
||||||
"(Re)build all packages."
|
|
||||||
(doom-initialize-packages)
|
|
||||||
(print! (start "(Re)building %spackages...") (if force-p "all " ""))
|
|
||||||
(print-group!
|
(print-group!
|
||||||
(let ((straight-check-for-modifications
|
(let ((straight-check-for-modifications
|
||||||
(when (file-directory-p (straight--modified-dir))
|
(when (file-directory-p (straight--modified-dir))
|
||||||
'(find-when-checking)))
|
'(find-when-checking)))
|
||||||
(straight--allow-find
|
(straight--allow-find
|
||||||
(and straight-check-for-modifications
|
(and straight-check-for-modifications
|
||||||
(executable-find straight-find-executable)
|
(executable-find straight-find-executable)
|
||||||
t))
|
t))
|
||||||
(straight--packages-not-to-rebuild
|
(straight--packages-not-to-rebuild
|
||||||
(or straight--packages-not-to-rebuild (make-hash-table :test #'equal)))
|
(or straight--packages-not-to-rebuild (make-hash-table :test #'equal)))
|
||||||
(straight--packages-to-rebuild
|
(straight--packages-to-rebuild
|
||||||
(or (if force-p :all straight--packages-to-rebuild)
|
(or (if force-p :all straight--packages-to-rebuild)
|
||||||
(make-hash-table :test #'equal)))
|
(make-hash-table :test #'equal)))
|
||||||
(recipes (doom-package-recipe-list)))
|
(recipes (doom-package-recipe-list))
|
||||||
(add-hook 'native-comp-async-cu-done-functions #'doom-packages--native-compile-done-h)
|
(pinned (doom-package-pinned-list)))
|
||||||
(unless force-p
|
(add-hook 'native-comp-async-cu-done-functions #'doom-packages--native-compile-done-h)
|
||||||
(straight--make-build-cache-available))
|
(straight--make-build-cache-available)
|
||||||
(if-let (built
|
(if-let (built
|
||||||
(doom-packages--with-recipes recipes (package local-repo recipe)
|
(doom-packages--with-recipes recipes (package local-repo recipe)
|
||||||
(unless force-p
|
(let ((repo-dir (straight--repos-dir (or local-repo package)))
|
||||||
;; Ensure packages with outdated files/bytecode are rebuilt
|
(build-dir (straight--build-dir package)))
|
||||||
(let* ((build-dir (straight--build-dir package))
|
(unless force-p
|
||||||
(repo-dir (straight--repos-dir local-repo))
|
;; Ensure packages with outdated files/bytecode are rebuilt
|
||||||
(build (if (plist-member recipe :build)
|
(let* ((build (if (plist-member recipe :build)
|
||||||
(plist-get recipe :build)
|
(plist-get recipe :build)
|
||||||
t))
|
t))
|
||||||
(want-byte-compile
|
(want-byte-compile
|
||||||
(or (eq build t)
|
(or (eq build t)
|
||||||
(memq 'compile build)))
|
(memq 'compile build)))
|
||||||
(want-native-compile
|
(want-native-compile
|
||||||
(or (eq build t)
|
(or (eq build t)
|
||||||
(memq 'native-compile build))))
|
(memq 'native-compile build))))
|
||||||
(and (eq (car-safe build) :not)
|
(and (eq (car-safe build) :not)
|
||||||
(setq want-byte-compile (not want-byte-compile)
|
(setq want-byte-compile (not want-byte-compile)
|
||||||
want-native-compile (not want-native-compile)))
|
want-native-compile (not want-native-compile)))
|
||||||
(unless (featurep 'native-compile)
|
(unless (featurep 'native-compile)
|
||||||
(setq want-native-compile nil))
|
(setq want-native-compile nil))
|
||||||
(and (or want-byte-compile want-native-compile)
|
(and (or want-byte-compile want-native-compile)
|
||||||
(or (file-newer-than-file-p repo-dir build-dir)
|
(or (file-newer-than-file-p repo-dir build-dir)
|
||||||
(file-exists-p (straight--modified-dir (or local-repo package)))
|
(file-exists-p (straight--modified-dir (or local-repo package)))
|
||||||
(cl-loop with outdated = nil
|
(cl-loop with outdated = nil
|
||||||
for file in (doom-files-in build-dir :match "\\.el$" :full t)
|
for file in (doom-files-in build-dir :match "\\.el$" :full t)
|
||||||
if (or (if want-byte-compile (doom-packages--elc-file-outdated-p file))
|
if (or (if want-byte-compile (doom-packages--elc-file-outdated-p file))
|
||||||
(if want-native-compile (doom-packages--eln-file-outdated-p file)))
|
(if want-native-compile (doom-packages--eln-file-outdated-p file)))
|
||||||
do (setq outdated t)
|
do (setq outdated t)
|
||||||
(when want-native-compile
|
(when want-native-compile
|
||||||
(push file doom-packages--eln-output-expected))
|
(push file doom-packages--eln-output-expected))
|
||||||
finally return outdated))
|
finally return outdated))
|
||||||
(puthash package t straight--packages-to-rebuild))))
|
(puthash package t straight--packages-to-rebuild))))
|
||||||
(straight-use-package (intern package))))
|
(unless (file-directory-p repo-dir)
|
||||||
(progn
|
(doom-packages--cli-recipes-update))
|
||||||
(when (featurep 'native-compile)
|
(condition-case-unless-debug e
|
||||||
(doom-packages--compile-site-files)
|
(let ((straight-vc-git-post-clone-hook
|
||||||
(doom-packages--wait-for-native-compile-jobs)
|
(cons (lambda! (&key commit)
|
||||||
(doom-packages--write-missing-eln-errors))
|
(print-group!
|
||||||
;; HACK Every time you save a file in a package that straight tracks,
|
(if-let (pin (cdr (assoc package pinned)))
|
||||||
;; it is recorded in ~/.emacs.d/.local/straight/modified/.
|
(print! (item "Pinned to %s") pin)
|
||||||
;; Typically, straight will clean these up after rebuilding, but
|
(when commit
|
||||||
;; Doom's use-case circumnavigates that, leaving these files
|
(print! (item "Checked out %s") commit)))))
|
||||||
;; there and causing a rebuild of those packages each time `doom
|
straight-vc-git-post-clone-hook)))
|
||||||
;; sync' or similar is run, so we clean it up ourselves:
|
(straight-use-package (intern package))
|
||||||
(delete-directory (straight--modified-dir) 'recursive)
|
(when (file-in-directory-p repo-dir straight-base-dir)
|
||||||
(print! (success "\033[KRebuilt %d package(s)") (length built)))
|
;; HACK: Straight can sometimes fail to clone a repo,
|
||||||
(print! (item "No packages need rebuilding"))
|
;; leaving behind an empty directory which, in
|
||||||
nil))))
|
;; future invocations, it will assume indicates a
|
||||||
|
;; successful clone (causing load errors later).
|
||||||
|
(let ((try 0))
|
||||||
|
(while (not (file-directory-p (doom-path repo-dir ".git")))
|
||||||
|
(when (= try 3)
|
||||||
|
(error "Failed to clone package"))
|
||||||
|
(print! (warn "Failed to clone %S, trying again (attempt #%d)...") package (1+ try))
|
||||||
|
(delete-directory repo-dir t)
|
||||||
|
(delete-directory build-dir t)
|
||||||
|
(straight-use-package (intern package))
|
||||||
|
(cl-incf try)))
|
||||||
|
;; HACK: Line encoding issues can plague repos with
|
||||||
|
;; dirty worktree prompts when updating packages or
|
||||||
|
;; "Local variables entry is missing the suffix"
|
||||||
|
;; errors when installing them (see #2637), so have
|
||||||
|
;; git handle conversion by force.
|
||||||
|
(when doom--system-windows-p
|
||||||
|
(let ((default-directory repo-dir))
|
||||||
|
(straight--process-run "git" "config" "core.autocrlf" "true")))))
|
||||||
|
(error
|
||||||
|
(signal 'doom-package-error (list package e)))))))
|
||||||
|
(progn
|
||||||
|
(when (featurep 'native-compile)
|
||||||
|
(doom-packages--compile-site-files)
|
||||||
|
(doom-packages--wait-for-native-compile-jobs)
|
||||||
|
(doom-packages--write-missing-eln-errors))
|
||||||
|
;; HACK: Every time you save a file in a package that straight
|
||||||
|
;; tracks, it is recorded in ~/.emacs.d/.local/straight/modified/.
|
||||||
|
;; Typically, straight will clean these up after rebuilding, but
|
||||||
|
;; Doom's use-case circumnavigates that, leaving these files there
|
||||||
|
;; and causing a rebuild of those packages each time `doom sync'
|
||||||
|
;; or similar is run, so we clean it up ourselves:
|
||||||
|
(delete-directory (straight--modified-dir) 'recursive)
|
||||||
|
(print! (success "\033[KBuilt %d package(s)") (length built)))
|
||||||
|
(print! (item "No packages need attention"))
|
||||||
|
nil))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(defun doom-packages-update ()
|
(defun doom-packages-update (&optional pinned-only-p)
|
||||||
"Updates packages."
|
"Updates packages."
|
||||||
(doom-initialize-packages)
|
(doom-initialize-packages)
|
||||||
(doom-packages--barf-if-incomplete)
|
(doom-packages--barf-if-incomplete)
|
||||||
(doom-packages--cli-recipes-update)
|
|
||||||
(let* ((repo-dir (straight--repos-dir))
|
(let* ((repo-dir (straight--repos-dir))
|
||||||
(pinned (doom-package-pinned-list))
|
(pinned (doom-package-pinned-list))
|
||||||
(recipes (doom-package-recipe-list))
|
(recipes (doom-package-recipe-list))
|
||||||
|
@ -397,9 +376,10 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
(repos-to-rebuild (make-hash-table :test 'equal))
|
(repos-to-rebuild (make-hash-table :test 'equal))
|
||||||
(total (length recipes))
|
(total (length recipes))
|
||||||
(esc (unless init-file-debug "\033[1A"))
|
(esc (unless init-file-debug "\033[1A"))
|
||||||
(i 0)
|
(i 0))
|
||||||
errors)
|
(if pinned-only-p
|
||||||
(print! (start "Updating packages (this may take a while)..."))
|
(print! (start "Updating pinned packages..."))
|
||||||
|
(print! (start "Updating all packages (this may take a while)...")))
|
||||||
(doom-packages--with-recipes recipes (recipe package type local-repo)
|
(doom-packages--with-recipes recipes (recipe package type local-repo)
|
||||||
(cl-incf i)
|
(cl-incf i)
|
||||||
(print-group!
|
(print-group!
|
||||||
|
@ -412,11 +392,13 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
(cl-return))
|
(cl-return))
|
||||||
(let ((default-directory (straight--repos-dir local-repo)))
|
(let ((default-directory (straight--repos-dir local-repo)))
|
||||||
(unless (file-in-directory-p default-directory repo-dir)
|
(unless (file-in-directory-p default-directory repo-dir)
|
||||||
(print! (warn "(%d/%d) Skipping %s because it is local") i total package)
|
(print! (warn "(%d/%d) Skipping %s because it is out-of-tree...") i total package)
|
||||||
(cl-return))
|
(cl-return))
|
||||||
(when (eq type 'git)
|
(when (eq type 'git)
|
||||||
(unless (file-exists-p ".git")
|
(unless (file-exists-p ".git")
|
||||||
(error "%S is not a valid repository" package)))
|
(error "%S is not a valid repository" package)))
|
||||||
|
(when (and pinned-only-p (not (assoc local-repo pinned)))
|
||||||
|
(cl-return))
|
||||||
(condition-case-unless-debug e
|
(condition-case-unless-debug e
|
||||||
(let ((ref (straight-vc-get-commit type local-repo))
|
(let ((ref (straight-vc-get-commit type local-repo))
|
||||||
(target-ref
|
(target-ref
|
||||||
|
@ -430,13 +412,6 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
(doom-packages--straight-with (straight-vc-fetch-from-remote recipe)
|
(doom-packages--straight-with (straight-vc-fetch-from-remote recipe)
|
||||||
(when .it
|
(when .it
|
||||||
(straight-merge-package package)
|
(straight-merge-package package)
|
||||||
;; (condition-case e
|
|
||||||
;; (straight-merge-package package)
|
|
||||||
;; (wrong-type-argument
|
|
||||||
;; (if (not (equal (cdr e) '(arrayp nil)))
|
|
||||||
;; (signal (car e) (cdr e))
|
|
||||||
;; (delete-directory (straight--build-dir local-repo) t)
|
|
||||||
;; (straight-use-package (intern package)))))
|
|
||||||
(setq target-ref (straight-vc-get-commit type local-repo))
|
(setq target-ref (straight-vc-get-commit type local-repo))
|
||||||
(setq output (doom-packages--commit-log-between ref target-ref)
|
(setq output (doom-packages--commit-log-between ref target-ref)
|
||||||
commits (length (split-string output "\n" t)))
|
commits (length (split-string output "\n" t)))
|
||||||
|
@ -464,7 +439,7 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
(straight-vc-git-default-clone-depth 'full))
|
(straight-vc-git-default-clone-depth 'full))
|
||||||
(delete-directory repo 'recursive)
|
(delete-directory repo 'recursive)
|
||||||
(print-group!
|
(print-group!
|
||||||
(straight-use-package (intern package) nil 'no-build))
|
(straight-use-package (intern package) nil 'no-build))
|
||||||
(prog1 (file-directory-p repo)
|
(prog1 (file-directory-p repo)
|
||||||
(or (not (eq type 'git))
|
(or (not (eq type 'git))
|
||||||
(setq output (doom-packages--commit-log-between ref target-ref)
|
(setq output (doom-packages--commit-log-between ref target-ref)
|
||||||
|
@ -520,13 +495,14 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
(princ "\033[K")
|
(princ "\033[K")
|
||||||
(if (hash-table-empty-p packages-to-rebuild)
|
(if (hash-table-empty-p packages-to-rebuild)
|
||||||
(ignore (print! (success "All %d packages are up-to-date") total))
|
(ignore (print! (success "All %d packages are up-to-date") total))
|
||||||
|
(doom-packages--cli-recipes-update)
|
||||||
(straight--transaction-finalize)
|
(straight--transaction-finalize)
|
||||||
(let ((default-directory (straight--build-dir)))
|
(let ((default-directory (straight--build-dir)))
|
||||||
(mapc (doom-rpartial #'delete-directory 'recursive)
|
(mapc (doom-rpartial #'delete-directory 'recursive)
|
||||||
(hash-table-keys packages-to-rebuild)))
|
(hash-table-keys packages-to-rebuild)))
|
||||||
(print! (success "Updated %d package(s)")
|
(print! (success "Updated %d package(s)")
|
||||||
(hash-table-count packages-to-rebuild))
|
(hash-table-count packages-to-rebuild))
|
||||||
(doom-packages-build)
|
(doom-packages-ensure)
|
||||||
t))))
|
t))))
|
||||||
|
|
||||||
|
|
||||||
|
@ -821,5 +797,31 @@ However, in batch mode, print to stdout instead of stderr."
|
||||||
"/dev/null")))
|
"/dev/null")))
|
||||||
(apply fn args)))
|
(apply fn args)))
|
||||||
|
|
||||||
|
;; If the repo failed to clone correctly (usually due to a connection failure),
|
||||||
|
;; straight proceeds as normal until a later call produces a garbage result
|
||||||
|
;; (typically, when it fails to fetch the remote branch of the empty directory).
|
||||||
|
;; This causes Straight to throw an otherwise cryptic type error when it tries
|
||||||
|
;; to sanitize the result for its log buffer.
|
||||||
|
;;
|
||||||
|
;; This error is a common source of user confusion and false positive bug
|
||||||
|
;; reports, so this advice catches them to regurgitates a more cogent
|
||||||
|
;; explanation.
|
||||||
|
(defadvice! doom-cli--straight-throw-error-on-no-branch-a (fn &rest args)
|
||||||
|
:around #'straight--process-log
|
||||||
|
(letf! ((defun shell-quote-argument (&rest args)
|
||||||
|
(unless (car args)
|
||||||
|
(error "Package was not properly cloned due to a connection failure, please try again later"))
|
||||||
|
(apply shell-quote-argument args)))
|
||||||
|
(apply fn args)))
|
||||||
|
|
||||||
|
(defadvice! doom-cli--straight-regurgitate-empty-string-error-a (fn &rest args)
|
||||||
|
:around #'straight-vc-git-local-repo-name
|
||||||
|
(condition-case-unless-debug e
|
||||||
|
(apply fn args)
|
||||||
|
(wrong-type-argument
|
||||||
|
(if (eq (cadr e) 'stringp)
|
||||||
|
(error "Package was not properly cloned due to a connection failure, please try again later")
|
||||||
|
(signal (car e) (cdr e))))))
|
||||||
|
|
||||||
(provide 'doom-cli-packages)
|
(provide 'doom-cli-packages)
|
||||||
;;; packages.el ends here
|
;;; packages.el ends here
|
||||||
|
|
|
@ -14,18 +14,21 @@
|
||||||
(defvar doom-before-sync-hook ()
|
(defvar doom-before-sync-hook ()
|
||||||
"Hooks run before 'doom sync' synchronizes the user's config with Doom.")
|
"Hooks run before 'doom sync' synchronizes the user's config with Doom.")
|
||||||
|
|
||||||
|
(defvar doom-cli-sync-info-file (file-name-concat doom-profile-data-dir "sync"))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Commands
|
;;; Commands
|
||||||
|
|
||||||
(defcli-alias! (:before (sync s)) (:before build))
|
|
||||||
|
|
||||||
(defcli! ((sync s))
|
(defcli! ((sync s))
|
||||||
((noenvvar? ("-e") "Don't regenerate the envvar file")
|
((noenvvar? ("-e") "Don't regenerate the envvar file")
|
||||||
(noelc? ("-c") "Don't recompile config")
|
(update? ("-u") "Update all installed packages after syncing")
|
||||||
(update? ("-u") "Update installed packages after syncing")
|
(noupdate? ("-U") "Don't update any packages")
|
||||||
(purge? ("-p") "Purge orphaned package repos & regraft them")
|
(purge? ("--gc") "Purge orphaned package repos & regraft them")
|
||||||
(jobs ("-j" "--jobs" num) "How many CPUs to use for native compilation"))
|
(jobs ("-j" "--jobs" num) "How many threads to use for native compilation")
|
||||||
|
(rebuild? ("-b" "--rebuild") "Rebuild all installed packages, unconditionally")
|
||||||
|
(nobuild? ("-B") "Don't rebuild packages when hostname or Emacs version has changed")
|
||||||
|
&context context)
|
||||||
"Synchronize your config with Doom Emacs.
|
"Synchronize your config with Doom Emacs.
|
||||||
|
|
||||||
This is the equivalent of running autoremove, install, autoloads, then
|
This is the equivalent of running autoremove, install, autoloads, then
|
||||||
|
@ -33,8 +36,10 @@ recompile. Run this whenever you:
|
||||||
|
|
||||||
1. Modify your `doom!' block,
|
1. Modify your `doom!' block,
|
||||||
2. Add or remove `package!' blocks to your config,
|
2. Add or remove `package!' blocks to your config,
|
||||||
3. Add or remove autoloaded functions in module autoloaded files.
|
3. Add or remove autoloaded functions in module autoloaded files,
|
||||||
4. Update Doom outside of Doom (e.g. with git)
|
4. Update Doom outside of Doom (e.g. with git),
|
||||||
|
5. Move your Doom config (either $EMACSDIR or $DOOMDIR) to a new location.
|
||||||
|
6. When you up (or down) grade Emacs itself.
|
||||||
|
|
||||||
It will ensure that unneeded packages are removed, all needed packages are
|
It will ensure that unneeded packages are removed, all needed packages are
|
||||||
installed, autoloads files are up-to-date and no byte-compiled files have gone
|
installed, autoloads files are up-to-date and no byte-compiled files have gone
|
||||||
|
@ -47,26 +52,49 @@ OPTIONS:
|
||||||
:benchmark t
|
:benchmark t
|
||||||
(when (doom-profiles-bootloadable-p)
|
(when (doom-profiles-bootloadable-p)
|
||||||
(call! '(profiles sync "--reload")))
|
(call! '(profiles sync "--reload")))
|
||||||
(run-hooks 'doom-before-sync-hook)
|
|
||||||
(add-hook 'kill-emacs-hook #'doom-sync--abort-warning-h)
|
|
||||||
(when jobs
|
(when jobs
|
||||||
(setq native-comp-async-jobs-number (truncate jobs)))
|
(setq native-comp-async-jobs-number (truncate jobs)))
|
||||||
(print! (start "Synchronizing %S profile..." )
|
(run-hooks 'doom-before-sync-hook)
|
||||||
(or (car doom-profile) "default"))
|
(add-hook 'kill-emacs-hook #'doom-sync--abort-warning-h)
|
||||||
|
(print! (item "Using Emacs %s @ %s") emacs-version (path invocation-directory invocation-name))
|
||||||
|
(print! (start "Synchronizing %S profile..." ) (or (car doom-profile) "default"))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(print-group!
|
(print-group!
|
||||||
(when (and (not noenvvar?)
|
;; If the user has up/downgraded Emacs since last sync, or copied their
|
||||||
(file-exists-p doom-env-file))
|
;; config to a different system, then their packages need to be
|
||||||
(call! '(env)))
|
;; recompiled. This is necessary because Emacs byte-code is not
|
||||||
(doom-packages-install)
|
;; necessarily back/forward compatible across major versions, and many
|
||||||
(doom-packages-build)
|
;; packages bake in hardcoded data at compile-time.
|
||||||
(when update?
|
(pcase-let ((`(,old-version . ,old-host) (doom-file-read doom-cli-sync-info-file :by 'read :noerror t))
|
||||||
(doom-packages-update))
|
(to-rebuild nil))
|
||||||
(doom-packages-purge purge? purge? purge? purge? purge?)
|
(when (and old-version (not (equal old-version emacs-version)))
|
||||||
(when (doom-profile-generate)
|
(print! (warn "Emacs version has changed since last sync (from %s to %s)") old-version emacs-version)
|
||||||
(print! (item "Restart Emacs or use 'M-x doom/reload' for changes to take effect"))
|
(setq to-rebuild t))
|
||||||
(run-hooks 'doom-after-sync-hook))
|
(when (and old-host (not (equal old-host (system-name))))
|
||||||
t)
|
(print! (warn "Your system has changed since last sync"))
|
||||||
|
(setq to-rebuild t))
|
||||||
|
(when (and to-rebuild (not (doom-cli-context-suppress-prompts-p context)))
|
||||||
|
(cond (nobuild?
|
||||||
|
(print! (warn "Packages must be rebuilt, but -B has prevented it. Skipping...")))
|
||||||
|
((doom-cli-context-get context 'upgrading)
|
||||||
|
(print! (warn "Packages will be rebuilt"))
|
||||||
|
(setq rebuild? t))
|
||||||
|
((y-or-n-p (format! " %s" "Installed packages must be rebuilt. Do so now?"))
|
||||||
|
(setq rebuild? t))
|
||||||
|
((exit! 0)))))
|
||||||
|
(when (and (not noenvvar?)
|
||||||
|
(file-exists-p doom-env-file))
|
||||||
|
(call! '(env)))
|
||||||
|
(doom-packages-ensure rebuild?)
|
||||||
|
(unless noupdate? (doom-packages-update (not update?)))
|
||||||
|
(doom-packages-purge purge? purge? purge? purge? purge?)
|
||||||
|
(when (doom-profile-generate)
|
||||||
|
(print! (item "Restart Emacs or use 'M-x doom/reload' for changes to take effect"))
|
||||||
|
(run-hooks 'doom-after-sync-hook))
|
||||||
|
(when (or rebuild? (not (file-exists-p doom-cli-sync-info-file)))
|
||||||
|
(with-temp-file doom-cli-sync-info-file
|
||||||
|
(prin1 (cons emacs-version (system-name)) (current-buffer))))
|
||||||
|
t)
|
||||||
(remove-hook 'kill-emacs-hook #'doom-sync--abort-warning-h)))
|
(remove-hook 'kill-emacs-hook #'doom-sync--abort-warning-h)))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(load! "packages")
|
(load! "packages")
|
||||||
(load! "compile")
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -22,6 +21,7 @@
|
||||||
(defcli! ((upgrade up))
|
(defcli! ((upgrade up))
|
||||||
((packages? ("-p" "--packages") "Only upgrade packages, not Doom")
|
((packages? ("-p" "--packages") "Only upgrade packages, not Doom")
|
||||||
(jobs ("-j" "--jobs" num) "How many CPUs to use for native compilation")
|
(jobs ("-j" "--jobs" num) "How many CPUs to use for native compilation")
|
||||||
|
(nobuild? ("-B") "Don't rebuild packages when hostname or Emacs version has changed")
|
||||||
&context context)
|
&context context)
|
||||||
"Updates Doom and packages.
|
"Updates Doom and packages.
|
||||||
|
|
||||||
|
@ -30,10 +30,11 @@ following shell commands:
|
||||||
|
|
||||||
cd ~/.emacs.d
|
cd ~/.emacs.d
|
||||||
git pull --rebase
|
git pull --rebase
|
||||||
doom clean
|
|
||||||
doom sync -u"
|
doom sync -u"
|
||||||
(let* ((force? (doom-cli-context-suppress-prompts-p context))
|
(let* ((force? (doom-cli-context-suppress-prompts-p context))
|
||||||
(sync-cmd (append '("sync" "-u") (if jobs `("-j" ,num)))))
|
(sync-cmd (append '("sync" "-u")
|
||||||
|
(if nobuild? '("-B"))
|
||||||
|
(if jobs `("-j" ,jobs)))))
|
||||||
(cond
|
(cond
|
||||||
(packages?
|
(packages?
|
||||||
;; HACK It's messy to use straight to upgrade straight, due to the
|
;; HACK It's messy to use straight to upgrade straight, due to the
|
||||||
|
@ -54,7 +55,9 @@ following shell commands:
|
||||||
;; Reload Doom's CLI & libraries, in case there were any upstream changes.
|
;; Reload Doom's CLI & libraries, in case there were any upstream changes.
|
||||||
;; Major changes will still break, however
|
;; Major changes will still break, however
|
||||||
(print! (item "Reloading Doom Emacs"))
|
(print! (item "Reloading Doom Emacs"))
|
||||||
|
(doom-cli-context-put context 'upgrading t)
|
||||||
(exit! "doom" "upgrade" "-p"
|
(exit! "doom" "upgrade" "-p"
|
||||||
|
(if nobuild? "-B")
|
||||||
(if force? "--force")
|
(if force? "--force")
|
||||||
(if jobs (format "--jobs=%d" jobs))))
|
(if jobs (format "--jobs=%d" jobs))))
|
||||||
|
|
||||||
|
@ -96,6 +99,8 @@ following shell commands:
|
||||||
(sh! "git" "reset" "--hard" (format "origin/%s" branch))
|
(sh! "git" "reset" "--hard" (format "origin/%s" branch))
|
||||||
(sh! "git" "clean" "-ffd")))
|
(sh! "git" "clean" "-ffd")))
|
||||||
|
|
||||||
|
;; In case of leftover state from a partial/incomplete 'doom upgrade'
|
||||||
|
(sh! "git" "branch" "-D" target-remote)
|
||||||
(sh! "git" "remote" "remove" doom-upgrade-remote)
|
(sh! "git" "remote" "remove" doom-upgrade-remote)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(let (result)
|
(let (result)
|
||||||
|
@ -136,7 +141,6 @@ following shell commands:
|
||||||
(ignore (print! (error "Aborted")))
|
(ignore (print! (error "Aborted")))
|
||||||
(print! (start "Upgrading Doom Emacs..."))
|
(print! (start "Upgrading Doom Emacs..."))
|
||||||
(print-group!
|
(print-group!
|
||||||
(doom-compile-clean)
|
|
||||||
(doom-cli-context-put context 'straight-recipe (doom-upgrade--get-straight-recipe))
|
(doom-cli-context-put context 'straight-recipe (doom-upgrade--get-straight-recipe))
|
||||||
(or (and (zerop (car (sh! "git" "reset" "--hard" target-remote)))
|
(or (and (zerop (car (sh! "git" "reset" "--hard" target-remote)))
|
||||||
(equal (cdr (sh! "git" "rev-parse" "HEAD")) new-rev))
|
(equal (cdr (sh! "git" "rev-parse" "HEAD")) new-rev))
|
||||||
|
|
|
@ -1783,7 +1783,7 @@ See `defcli!' for information about COMMANDSPEC.
|
||||||
TARGET is simply a command list.
|
TARGET is simply a command list.
|
||||||
WHEN specifies what version this command was rendered obsolete."
|
WHEN specifies what version this command was rendered obsolete."
|
||||||
`(let ((ncommand (doom-cli-command-normalize (backquote ,target) doom-cli--group-plist)))
|
`(let ((ncommand (doom-cli-command-normalize (backquote ,target) doom-cli--group-plist)))
|
||||||
(defcli! ,commandspec (&context context &cli cli &rest args)
|
(defcli! ,commandspec (&context _context &cli cli &rest args)
|
||||||
:docs (format "An obsolete alias for '%s'." (doom-cli-command-string ncommand))
|
:docs (format "An obsolete alias for '%s'." (doom-cli-command-string ncommand))
|
||||||
:hide t
|
:hide t
|
||||||
(print! (warn "'%s' was deprecated in %s")
|
(print! (warn "'%s' was deprecated in %s")
|
||||||
|
|
|
@ -250,8 +250,7 @@ tell you about it. Very annoying. This prevents that."
|
||||||
auto-mode-alist
|
auto-mode-alist
|
||||||
'(("/LICENSE\\'" . text-mode)
|
'(("/LICENSE\\'" . text-mode)
|
||||||
("\\.log\\'" . text-mode)
|
("\\.log\\'" . text-mode)
|
||||||
("rc\\'" . conf-mode)
|
("rc\\'" . conf-mode)))
|
||||||
("\\.\\(?:hex\\|nes\\)\\'" . hexl-mode)))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -15,6 +15,12 @@
|
||||||
"An alternative leader prefix key, used for Insert and Emacs states, and for
|
"An alternative leader prefix key, used for Insert and Emacs states, and for
|
||||||
non-evil users.")
|
non-evil users.")
|
||||||
|
|
||||||
|
(defvar doom-leader-key-states '(normal visual motion)
|
||||||
|
"which evil modes to activate the leader key for")
|
||||||
|
|
||||||
|
(defvar doom-leader-alt-key-states '(emacs insert)
|
||||||
|
"which evil modes to activate the alternative leader key for")
|
||||||
|
|
||||||
(defvar doom-localleader-key "SPC m"
|
(defvar doom-localleader-key "SPC m"
|
||||||
"The localleader prefix key, for major-mode specific commands.")
|
"The localleader prefix key, for major-mode specific commands.")
|
||||||
|
|
||||||
|
@ -212,8 +218,8 @@ localleader prefix."
|
||||||
((equal doom-leader-alt-key "C-x")
|
((equal doom-leader-alt-key "C-x")
|
||||||
(set-keymap-parent doom-leader-map ctl-x-map)))
|
(set-keymap-parent doom-leader-map ctl-x-map)))
|
||||||
(define-key map (kbd doom-leader-alt-key) 'doom/leader))
|
(define-key map (kbd doom-leader-alt-key) 'doom/leader))
|
||||||
(evil-define-key* '(normal visual motion) map (kbd doom-leader-key) 'doom/leader)
|
(evil-define-key* doom-leader-key-states map (kbd doom-leader-key) 'doom/leader)
|
||||||
(evil-define-key* '(emacs insert) map (kbd doom-leader-alt-key) 'doom/leader))
|
(evil-define-key* doom-leader-alt-key-states map (kbd doom-leader-alt-key) 'doom/leader))
|
||||||
(general-override-mode +1))))
|
(general-override-mode +1))))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -936,7 +936,7 @@ VARIABLES is a list of variable settings of the form (VAR VALUE),
|
||||||
where VAR is the name of the variable (a string) and VALUE
|
where VAR is the name of the variable (a string) and VALUE
|
||||||
is its value (also a string).
|
is its value (also a string).
|
||||||
|
|
||||||
The previous values will be be restored upon exit."
|
The previous values will be restored upon exit."
|
||||||
(declare (indent 1) (debug (sexp body)))
|
(declare (indent 1) (debug (sexp body)))
|
||||||
(unless (consp variables)
|
(unless (consp variables)
|
||||||
(error "Invalid VARIABLES: %s" variables))
|
(error "Invalid VARIABLES: %s" variables))
|
||||||
|
|
|
@ -368,7 +368,8 @@ Defaults to the profile at `doom-profile-default'."
|
||||||
;; FIX: Make sure this only runs at startup to protect us Emacs' interpreter
|
;; FIX: Make sure this only runs at startup to protect us Emacs' interpreter
|
||||||
;; re-evaluating this file when lazy-loading dynamic docstrings from the
|
;; re-evaluating this file when lazy-loading dynamic docstrings from the
|
||||||
;; byte-compiled init file.
|
;; byte-compiled init file.
|
||||||
`((when (doom-context-p 'init)
|
`((when (or (doom-context-p 'init)
|
||||||
|
(doom-context-p 'reload))
|
||||||
,@(cl-loop for var in doom-autoloads-cached-vars
|
,@(cl-loop for var in doom-autoloads-cached-vars
|
||||||
if (boundp var)
|
if (boundp var)
|
||||||
collect `(set-default ',var ',(symbol-value var)))
|
collect `(set-default ',var ',(symbol-value var)))
|
||||||
|
|
|
@ -23,6 +23,10 @@ debian, and derivatives). On most it's 'fd'.")
|
||||||
;;
|
;;
|
||||||
;;; Packages
|
;;; Packages
|
||||||
|
|
||||||
|
(after! project
|
||||||
|
(setq project-list-file (file-name-concat doom-data-dir "projects")))
|
||||||
|
|
||||||
|
;; DEPRECATED: Will be replaced with project.el
|
||||||
(use-package! projectile
|
(use-package! projectile
|
||||||
:commands (projectile-project-root
|
:commands (projectile-project-root
|
||||||
projectile-project-name
|
projectile-project-name
|
||||||
|
|
|
@ -143,14 +143,8 @@
|
||||||
(setq selection-coding-system 'utf-8))
|
(setq selection-coding-system 'utf-8))
|
||||||
|
|
||||||
|
|
||||||
;;; Support for more file extensions
|
;;; Support for Doom-specific file extensions
|
||||||
;; Add support for additional file extensions.
|
(add-to-list 'auto-mode-alist '("/\\.doom\\(?:rc\\|project\\|module\\|profile\\)\\'" . emacs-lisp-mode))
|
||||||
(dolist (entry '(("/\\.doom\\(?:rc\\|project\\|module\\|profile\\)\\'" . emacs-lisp-mode)
|
|
||||||
("/LICENSE\\'" . text-mode)
|
|
||||||
("\\.log\\'" . text-mode)
|
|
||||||
("rc\\'" . conf-mode)
|
|
||||||
("\\.\\(?:hex\\|nes\\)\\'" . hexl-mode)))
|
|
||||||
(push entry auto-mode-alist))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
121
lisp/doom-ui.el
121
lisp/doom-ui.el
|
@ -95,7 +95,6 @@ want to change your symbol font, use `doom-symbol-font'.")
|
||||||
(inhibit-redisplay t))
|
(inhibit-redisplay t))
|
||||||
(run-hooks 'doom-switch-buffer-hook)))
|
(run-hooks 'doom-switch-buffer-hook)))
|
||||||
|
|
||||||
(defvar doom--last-frame nil)
|
|
||||||
(defun doom-run-switch-window-or-frame-hooks-h (&optional _)
|
(defun doom-run-switch-window-or-frame-hooks-h (&optional _)
|
||||||
(let ((gc-cons-threshold most-positive-fixnum)
|
(let ((gc-cons-threshold most-positive-fixnum)
|
||||||
(inhibit-redisplay t))
|
(inhibit-redisplay t))
|
||||||
|
@ -498,65 +497,69 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
(cons 'custom-theme-directory
|
(cons 'custom-theme-directory
|
||||||
(delq 'custom-theme-directory custom-theme-load-path)))
|
(delq 'custom-theme-directory custom-theme-load-path)))
|
||||||
|
|
||||||
(defun doom-init-fonts-h (&optional _reload)
|
(defun doom-init-fonts-h (&optional reload)
|
||||||
"Loads `doom-font', `doom-serif-font', and `doom-variable-pitch-font'."
|
"Loads `doom-font', `doom-serif-font', and `doom-variable-pitch-font'."
|
||||||
(let ((this-frame (selected-frame)))
|
(let ((initialized-frames (unless reload (get 'doom-font 'initialized-frames))))
|
||||||
(dolist (map `((default . ,doom-font)
|
(dolist (frame (if reload (frame-list) (list (selected-frame))))
|
||||||
(fixed-pitch . ,doom-font)
|
(unless (member frame initialized-frames)
|
||||||
(fixed-pitch-serif . ,doom-serif-font)
|
(dolist (map `((default . ,doom-font)
|
||||||
(variable-pitch . ,doom-variable-pitch-font)))
|
(fixed-pitch . ,doom-font)
|
||||||
(condition-case e
|
(fixed-pitch-serif . ,doom-serif-font)
|
||||||
(when-let* ((face (car map))
|
(variable-pitch . ,doom-variable-pitch-font)))
|
||||||
(font (cdr map)))
|
(condition-case e
|
||||||
(dolist (frame (frame-list))
|
(when-let* ((face (car map))
|
||||||
(when (display-multi-font-p frame)
|
(font (cdr map)))
|
||||||
(set-face-attribute face frame
|
(when (display-multi-font-p frame)
|
||||||
:width 'normal :weight 'normal
|
(set-face-attribute face frame
|
||||||
:slant 'normal :font font)))
|
:width 'normal :weight 'normal
|
||||||
(custom-push-theme
|
:slant 'normal :font font))
|
||||||
'theme-face face 'user 'set
|
(custom-push-theme
|
||||||
(let* ((base-specs (cadr (assq 'user (get face 'theme-face))))
|
'theme-face face 'user 'set
|
||||||
(base-specs (or base-specs '((t nil))))
|
(let* ((base-specs (cadr (assq 'user (get face 'theme-face))))
|
||||||
(attrs '(:family :foundry :slant :weight :height :width))
|
(base-specs (or base-specs '((t nil))))
|
||||||
(new-specs nil))
|
(attrs '(:family :foundry :slant :weight :height :width))
|
||||||
(dolist (spec base-specs)
|
(new-specs nil))
|
||||||
;; Each SPEC has the form (DISPLAY ATTRIBUTE-PLIST)
|
(dolist (spec base-specs)
|
||||||
(let ((display (car spec))
|
(let ((display (car spec))
|
||||||
(plist (copy-tree (nth 1 spec))))
|
(plist (copy-tree (nth 1 spec))))
|
||||||
;; Alter only DISPLAY conditions matching this frame.
|
(when (or (memq display '(t default))
|
||||||
(when (or (memq display '(t default))
|
(face-spec-set-match-display display frame))
|
||||||
(face-spec-set-match-display display this-frame))
|
(dolist (attr attrs)
|
||||||
(dolist (attr attrs)
|
(setq plist (plist-put plist attr (face-attribute face attr)))))
|
||||||
(setq plist (plist-put plist attr (face-attribute face attr)))))
|
(push (list display plist) new-specs)))
|
||||||
(push (list display plist) new-specs)))
|
(nreverse new-specs)))
|
||||||
(nreverse new-specs)))
|
(put face 'face-modified nil))
|
||||||
(put face 'face-modified nil))
|
('error
|
||||||
('error
|
(ignore-errors (doom--reset-inhibited-vars-h))
|
||||||
(ignore-errors (doom--reset-inhibited-vars-h))
|
(if (string-prefix-p "Font not available" (error-message-string e))
|
||||||
(if (string-prefix-p "Font not available" (error-message-string e))
|
(signal 'doom-font-error (list (font-get (cdr map) :family)))
|
||||||
(signal 'doom-font-error (list (font-get (cdr map) :family)))
|
(signal (car e) (cdr e))))))
|
||||||
(signal (car e) (cdr e)))))))
|
(put 'doom-font 'initialized-frames
|
||||||
(when (fboundp 'set-fontset-font)
|
(cons frame (cl-delete-if-not #'frame-live-p initialized-frames))))))
|
||||||
(let* ((fn (doom-rpartial #'member (font-family-list)))
|
;; Only do this once per session (or on `doom/reload-fonts'); superfluous
|
||||||
(symbol-font (or doom-symbol-font
|
;; `set-fontset-font' calls may segfault in some contexts.
|
||||||
(cl-find-if fn doom-symbol-fallback-font-families)))
|
(when (or reload (not (get 'doom-font 'initialized)))
|
||||||
(emoji-font (or doom-emoji-font
|
(when (fboundp 'set-fontset-font) ; unavailable in emacs-nox
|
||||||
(cl-find-if fn doom-emoji-fallback-font-families))))
|
(let* ((fn (doom-rpartial #'member (font-family-list)))
|
||||||
(when symbol-font
|
(symbol-font (or doom-symbol-font
|
||||||
(dolist (script '(symbol mathematical))
|
(cl-find-if fn doom-symbol-fallback-font-families)))
|
||||||
(set-fontset-font t script symbol-font)))
|
(emoji-font (or doom-emoji-font
|
||||||
(when emoji-font
|
(cl-find-if fn doom-emoji-fallback-font-families))))
|
||||||
;; DEPRECATED: make unconditional when we drop 27 support
|
(when symbol-font
|
||||||
(when (version<= "28.1" emacs-version)
|
(dolist (script '(symbol mathematical))
|
||||||
(set-fontset-font t 'emoji emoji-font))
|
(set-fontset-font t script symbol-font)))
|
||||||
;; some characters in the Emacs symbol script are often covered by emoji
|
(when emoji-font
|
||||||
;; fonts
|
;; DEPRECATED: make unconditional when we drop 27 support
|
||||||
(set-fontset-font t 'symbol emoji-font nil 'append)))
|
(when (version<= "28.1" emacs-version)
|
||||||
;; Nerd Fonts use these Private Use Areas
|
(set-fontset-font t 'emoji emoji-font))
|
||||||
(dolist (range '((#xe000 . #xf8ff) (#xf0000 . #xfffff)))
|
;; some characters in the Emacs symbol script are often covered by
|
||||||
(set-fontset-font t range "Symbols Nerd Font Mono")))
|
;; emoji fonts
|
||||||
;; Users should inject their own font logic in `after-setting-font-hook'
|
(set-fontset-font t 'symbol emoji-font nil 'append)))
|
||||||
(run-hooks 'after-setting-font-hook))
|
;; Nerd Fonts use these Private Use Areas
|
||||||
|
(dolist (range '((#xe000 . #xf8ff) (#xf0000 . #xfffff)))
|
||||||
|
(set-fontset-font t range "Symbols Nerd Font Mono")))
|
||||||
|
(run-hooks 'after-setting-font-hook))
|
||||||
|
(put 'doom-font 'initialized t))
|
||||||
|
|
||||||
(defun doom-init-theme-h (&rest _)
|
(defun doom-init-theme-h (&rest _)
|
||||||
"Load the theme specified by `doom-theme' in FRAME."
|
"Load the theme specified by `doom-theme' in FRAME."
|
||||||
|
|
163
lisp/doom.el
163
lisp/doom.el
|
@ -201,7 +201,7 @@
|
||||||
"Current version of Doom Emacs core.")
|
"Current version of Doom Emacs core.")
|
||||||
|
|
||||||
;; DEPRECATED: Remove these when the modules are moved out of core.
|
;; DEPRECATED: Remove these when the modules are moved out of core.
|
||||||
(defconst doom-modules-version "24.03.0-pre"
|
(defconst doom-modules-version "24.04.0-pre"
|
||||||
"Current version of Doom Emacs.")
|
"Current version of Doom Emacs.")
|
||||||
|
|
||||||
(defvar doom-init-time nil
|
(defvar doom-init-time nil
|
||||||
|
@ -352,12 +352,12 @@ users).")
|
||||||
;;; Startup optimizations
|
;;; Startup optimizations
|
||||||
|
|
||||||
;; Here are Doom's hackiest (and least offensive) startup optimizations. They
|
;; Here are Doom's hackiest (and least offensive) startup optimizations. They
|
||||||
;; exploit implementation details and unintended side-effects, and will change
|
;; exploit implementation details and unintended side-effects in Emacs' startup
|
||||||
;; often between major Emacs releases. However, I disable them if this is a
|
;; process, and will change often between major Emacs releases. However, I
|
||||||
;; daemon session (where startup time matters less).
|
;; disable them if this is a daemon session (where startup time matters less).
|
||||||
;;
|
;;
|
||||||
;; Most of these have been tested on Linux and on fairly fast machines (with
|
;; Most of these have been tested on Linux and on fairly fast machines (with
|
||||||
;; SSDs), so your mileage may vary depending on your hardware.
|
;; SSDs), so your mileage may vary depending on hardware and `window-system'.
|
||||||
(unless (daemonp)
|
(unless (daemonp)
|
||||||
;; PERF: `file-name-handler-alist' is consulted on each call to `require',
|
;; PERF: `file-name-handler-alist' is consulted on each call to `require',
|
||||||
;; `load', or various file/io functions (like `expand-file-name' or
|
;; `load', or various file/io functions (like `expand-file-name' or
|
||||||
|
@ -366,14 +366,13 @@ users).")
|
||||||
(let ((old-value (default-toplevel-value 'file-name-handler-alist)))
|
(let ((old-value (default-toplevel-value 'file-name-handler-alist)))
|
||||||
(set-default-toplevel-value
|
(set-default-toplevel-value
|
||||||
'file-name-handler-alist
|
'file-name-handler-alist
|
||||||
;; HACK: If the bundled elisp for this Emacs install isn't byte-compiled
|
;; HACK: The libraries bundled with Emacs can either be compiled,
|
||||||
;; (but is compressed), then leave the gzip file handler there so Emacs
|
;; compressed, or neither. We use calc-loaddefs.el as a heuristic to
|
||||||
;; won't forget how to read read them.
|
;; guess what state all these libraries are in. If they're compressed, we
|
||||||
;;
|
;; need to leave the gzip file handler in `file-name-handler-alist' so
|
||||||
;; calc-loaddefs.el is our heuristic for this because it is built-in to
|
;; Emacs knows how to load them. If they're compiled or neither, we can
|
||||||
;; all supported versions of Emacs, and calc.el explicitly loads it
|
;; omit the gzip handler altogether (at least during startup) for a boost
|
||||||
;; uncompiled. This ensures that the only other, possible fallback would
|
;; in startup and package load time.
|
||||||
;; be calc-loaddefs.el.gz.
|
|
||||||
(if (eval-when-compile
|
(if (eval-when-compile
|
||||||
(locate-file-internal "calc-loaddefs.el" load-path))
|
(locate-file-internal "calc-loaddefs.el" load-path))
|
||||||
nil
|
nil
|
||||||
|
@ -395,55 +394,46 @@ users).")
|
||||||
(unless noninteractive
|
(unless noninteractive
|
||||||
;; PERF: Resizing the Emacs frame (to accommodate fonts that are smaller or
|
;; PERF: Resizing the Emacs frame (to accommodate fonts that are smaller or
|
||||||
;; larger than the system font) appears to impact startup time
|
;; larger than the system font) appears to impact startup time
|
||||||
;; dramatically. The larger the delta in font size, the greater the delay.
|
;; dramatically. The larger the delta, the greater the delay. Even trivial
|
||||||
;; Even trivial deltas can yield a ~1000ms loss, though it varies wildly
|
;; deltas can yield up to a ~1000ms loss, depending on font size and
|
||||||
;; depending on font size.
|
;; `window-system'. PGTK seems least affected and NS/MAC the most.
|
||||||
(setq frame-inhibit-implied-resize t)
|
(setq frame-inhibit-implied-resize t)
|
||||||
|
|
||||||
;; PERF,UX: Reduce *Message* noise at startup. An empty scratch buffer (or
|
;; PERF: A fair bit of startup time goes into initializing the splash and
|
||||||
;; the dashboard) is more than enough, and faster to display.
|
;; scratch buffers in the typical Emacs session (b/c they activate a
|
||||||
|
;; non-trivial major mode, generate the splash buffer, and trigger
|
||||||
|
;; premature frame redraws by writing to *Messages*). These hacks prevent
|
||||||
|
;; most of this work from happening for some decent savings in startup
|
||||||
|
;; time. Our dashboard and `doom/open-scratch-buffer' provide a faster
|
||||||
|
;; (and more useful) alternative anyway.
|
||||||
(setq inhibit-startup-screen t
|
(setq inhibit-startup-screen t
|
||||||
inhibit-startup-echo-area-message user-login-name)
|
inhibit-startup-echo-area-message user-login-name
|
||||||
;; PERF,UX: Remove "For information about GNU Emacs..." message at startup.
|
initial-major-mode 'fundamental-mode
|
||||||
;; It's redundant with our dashboard and incurs a premature redraw.
|
initial-scratch-message nil)
|
||||||
|
;; PERF,UX: Prevent "For information about GNU Emacs..." line in *Messages*.
|
||||||
(advice-add #'display-startup-echo-area-message :override #'ignore)
|
(advice-add #'display-startup-echo-area-message :override #'ignore)
|
||||||
;; PERF: Suppress the vanilla startup screen completely. We've disabled it
|
;; PERF: Suppress the vanilla startup screen completely. We've disabled it
|
||||||
;; with `inhibit-startup-screen', but it would still initialize anyway.
|
;; with `inhibit-startup-screen', but it would still initialize anyway.
|
||||||
;; This involves some file IO and/or bitmap work (depending on the frame
|
;; This involves file IO and/or bitmap work (depending on the frame type)
|
||||||
;; type) that we can no-op for a free 50-100ms boost in startup time.
|
;; that we can no-op for a free 50-100ms saving in startup time.
|
||||||
(advice-add #'display-startup-screen :override #'ignore)
|
(advice-add #'display-startup-screen :override #'ignore)
|
||||||
|
|
||||||
;; PERF: Shave seconds off startup time by starting the scratch buffer in
|
|
||||||
;; `fundamental-mode', rather than, say, `org-mode' or `text-mode', which
|
|
||||||
;; pull in a ton of packages. This buffer is created whether or not we're
|
|
||||||
;; in an interactive session. Plus, `doom/open-scratch-buffer' provides a
|
|
||||||
;; better scratch buffer, so keep the initial one blank.
|
|
||||||
(setq initial-major-mode 'fundamental-mode
|
|
||||||
initial-scratch-message nil)
|
|
||||||
|
|
||||||
(unless initial-window-system
|
(unless initial-window-system
|
||||||
;; PERF: Inexplicably, `tty-run-terminal-initialization' can sometimes
|
;; PERF: `tty-run-terminal-initialization' can take 2-3s when starting up
|
||||||
;; take 2-3s when starting up Emacs in the terminal. Whatever slows it
|
;; TTY Emacs (non-daemon sessions), depending on your TERM, TERMINFO,
|
||||||
;; down at startup doesn't appear to affect it if it's called a little
|
;; and TERMCAP, but this work isn't very useful on modern systems (the
|
||||||
;; later in the startup process, so that's what I do.
|
;; type I expect Doom's users to be using). The function seems less
|
||||||
;; REVIEW: This optimization is not well understood. Investigate it!
|
;; expensive if run later in the startup process, so I defer it.
|
||||||
|
;; REVIEW: This may no longer be needed in 29+. Needs testing!
|
||||||
(define-advice tty-run-terminal-initialization (:override (&rest _) defer)
|
(define-advice tty-run-terminal-initialization (:override (&rest _) defer)
|
||||||
(advice-remove #'tty-run-terminal-initialization #'tty-run-terminal-initialization@defer)
|
(advice-remove #'tty-run-terminal-initialization #'tty-run-terminal-initialization@defer)
|
||||||
(add-hook 'window-setup-hook
|
(add-hook 'window-setup-hook
|
||||||
(doom-partial #'tty-run-terminal-initialization
|
(doom-partial #'tty-run-terminal-initialization
|
||||||
(selected-frame) nil t))))
|
(selected-frame) nil t))))
|
||||||
|
|
||||||
;; PERF,UX: Site files tend to use `load-file', which emits "Loading X..."
|
;; PERF: `load-suffixes' and `load-file-rep-suffixes' are consulted on each
|
||||||
;; messages in the echo area. Writing to the echo-area triggers a
|
;; `require' and `load'. Doom won't load any modules this early, so omit
|
||||||
;; redisplay, which can be expensive during startup. This may also cause
|
;; .so for a tiny startup boost. Is later restored in doom-start.
|
||||||
;; an flash of white when creating the first frame. Needs to be undo
|
|
||||||
;; later, though.
|
|
||||||
(define-advice load-file (:override (file) silence)
|
|
||||||
(load file nil 'nomessage))
|
|
||||||
|
|
||||||
;; PERF: `load-suffixes' and `load-file-rep-suffixes' are consulted on
|
|
||||||
;; each `require' and `load'. Doom won't load any modules this early, so
|
|
||||||
;; omit .so for a tiny startup boost. Is later restored in doom-start.
|
|
||||||
(put 'load-suffixes 'initial-value (default-toplevel-value 'load-suffixes))
|
(put 'load-suffixes 'initial-value (default-toplevel-value 'load-suffixes))
|
||||||
(put 'load-file-rep-suffixes 'initial-value (default-toplevel-value 'load-file-rep-suffixes))
|
(put 'load-file-rep-suffixes 'initial-value (default-toplevel-value 'load-file-rep-suffixes))
|
||||||
(set-default-toplevel-value 'load-suffixes '(".elc" ".el"))
|
(set-default-toplevel-value 'load-suffixes '(".elc" ".el"))
|
||||||
|
@ -455,35 +445,34 @@ users).")
|
||||||
(setq load-suffixes (get 'load-suffixes 'initial-value)
|
(setq load-suffixes (get 'load-suffixes 'initial-value)
|
||||||
load-file-rep-suffixes (get 'load-file-rep-suffixes 'initial-value))))
|
load-file-rep-suffixes (get 'load-file-rep-suffixes 'initial-value))))
|
||||||
|
|
||||||
;; PERF: Doom uses `defcustom' to indicate variables that users are
|
;; PERF: Doom uses `defcustom' merely to announce variables that users may
|
||||||
;; expected to reconfigure. Trouble is it fires off initializers meant
|
;; reconfigure. Trouble is it fires off initializers meant to accommodate
|
||||||
;; to accommodate any user attempts to configure them before they were
|
;; any user attempts to configure them *before* they are defined, which
|
||||||
;; defined. This is unnecessary work before $DOOMDIR/init.el is loaded,
|
;; isn't possible since the user's first opportunity to modify them comes
|
||||||
;; so I disable them until it is.
|
;; long after they're defined (in $DOOMDIR/init.el), so this is
|
||||||
|
;; unnecessary work. To spare Emacs the startup time, I disable this
|
||||||
|
;; behavior until $DOOMDIR is loaded.
|
||||||
(setq custom-dont-initialize t)
|
(setq custom-dont-initialize t)
|
||||||
(add-hook! 'doom-before-init-hook
|
(add-hook! 'doom-before-init-hook
|
||||||
(defun doom--reset-custom-dont-initialize-h ()
|
(defun doom--reset-custom-dont-initialize-h ()
|
||||||
(setq custom-dont-initialize nil)))
|
(setq custom-dont-initialize nil)))
|
||||||
|
|
||||||
;; PERF: Doom disables the UI elements by default, so that there's less
|
;; PERF: The mode-line procs a couple dozen times during startup, before the
|
||||||
;; for the frame to initialize. However, the toolbar is still populated
|
;; user can even see the first mode-line. This is normally fast, but we
|
||||||
;; regardless, so I lazy load it until tool-bar-mode is actually used.
|
;; can't predict what the user (or packages) will put into the mode-line.
|
||||||
(advice-add #'tool-bar-setup :override #'ignore)
|
;; Also, mode-line packages have a bad habit of throwing performance to
|
||||||
|
;; the wind, so best we just disable the mode-line until we can see one.
|
||||||
;; PERF: The mode-line procs a couple dozen times during startup. This is
|
|
||||||
;; normally quite fast, but disabling the default mode-line and reducing
|
|
||||||
;; the update delay timer seems to stave off ~30-50ms.
|
|
||||||
(put 'mode-line-format 'initial-value (default-toplevel-value 'mode-line-format))
|
(put 'mode-line-format 'initial-value (default-toplevel-value 'mode-line-format))
|
||||||
(setq-default mode-line-format nil)
|
(setq-default mode-line-format nil)
|
||||||
(dolist (buf (buffer-list))
|
(dolist (buf (buffer-list))
|
||||||
(with-current-buffer buf (setq mode-line-format nil)))
|
(with-current-buffer buf (setq mode-line-format nil)))
|
||||||
;; PERF,UX: Premature redisplays can substantially affect startup times
|
;; PERF,UX: Premature redisplays/redraws can substantially affect startup
|
||||||
;; and/or produce ugly flashes of unstyled Emacs.
|
;; times and/or flash a white/unstyled Emacs frame during startup, so I
|
||||||
|
;; try real hard to suppress them until we're sure the session is ready.
|
||||||
(setq-default inhibit-redisplay t
|
(setq-default inhibit-redisplay t
|
||||||
inhibit-message t)
|
inhibit-message t)
|
||||||
;; COMPAT: Then reset with advice, because `startup--load-user-init-file'
|
;; COMPAT: If the above vars aren't reset, Emacs could appear frozen or
|
||||||
;; will never be interrupted by errors. And if these settings are left
|
;; garbled after startup (or in case of an startup error).
|
||||||
;; set, Emacs could appear frozen or garbled.
|
|
||||||
(defun doom--reset-inhibited-vars-h ()
|
(defun doom--reset-inhibited-vars-h ()
|
||||||
(setq-default inhibit-redisplay nil
|
(setq-default inhibit-redisplay nil
|
||||||
;; Inhibiting `message' only prevents redraws and
|
;; Inhibiting `message' only prevents redraws and
|
||||||
|
@ -491,35 +480,43 @@ users).")
|
||||||
(redraw-frame))
|
(redraw-frame))
|
||||||
(add-hook 'after-init-hook #'doom--reset-inhibited-vars-h)
|
(add-hook 'after-init-hook #'doom--reset-inhibited-vars-h)
|
||||||
|
|
||||||
;; PERF,UX: An annoying aspect of site-lisp files is that they're often
|
;; PERF: Doom disables the UI elements by default, so that there's less for
|
||||||
;; noisy (they emit load messages or other output to stdout). These
|
;; the frame to initialize. However, `tool-bar-setup' is still called and
|
||||||
;; queue unnecessary redraws at startup, cost startup time, and pollute
|
;; it does some non-trivial work to set up the toolbar before we can
|
||||||
;; the logs. I get around it by suppressing it until we can load it
|
;; disable it. To side-step this work, I disable the function and call it
|
||||||
;; manually, later (in the `startup--load-user-init-file' advice below).
|
;; later (see `startup--load-user-init-file@undo-hacks').
|
||||||
|
(advice-add #'tool-bar-setup :override #'ignore)
|
||||||
|
|
||||||
|
;; PERF,UX: site-lisp files are often obnoxiously noisy (emitting load
|
||||||
|
;; messages or other output to *Messages* or stdout). These queue
|
||||||
|
;; unnecessary redraws at startup which impact startup time depending on
|
||||||
|
;; window system. It also pollutes the logs. By suppressing it now, I can
|
||||||
|
;; load it myself, later, in a more controlled way (see
|
||||||
|
;; `startup--load-user-init-file@undo-hacks').
|
||||||
(put 'site-run-file 'initial-value site-run-file)
|
(put 'site-run-file 'initial-value site-run-file)
|
||||||
(setq site-run-file nil)
|
(setq site-run-file nil)
|
||||||
|
|
||||||
(define-advice startup--load-user-init-file (:around (fn &rest args) undo-inhibit-vars)
|
(define-advice startup--load-user-init-file (:around (fn &rest args) undo-hacks)
|
||||||
(let (--init--)
|
"Undo Doom's startup optimizations to prep for the user's session."
|
||||||
|
(let (init)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
;; COMPAT: Onces startup is sufficiently complete, undo some
|
|
||||||
;; optimizations to reduce the scope of potential edge cases.
|
|
||||||
(advice-remove #'load-file #'load-file@silence)
|
|
||||||
(advice-remove #'tool-bar-setup #'ignore)
|
|
||||||
(add-transient-hook! 'tool-bar-mode (tool-bar-setup))
|
|
||||||
(when (setq site-run-file (get 'site-run-file 'initial-value))
|
(when (setq site-run-file (get 'site-run-file 'initial-value))
|
||||||
(let ((inhibit-startup-screen inhibit-startup-screen))
|
(let ((inhibit-startup-screen inhibit-startup-screen))
|
||||||
(letf! (defun load (file &optional noerror _nomessage &rest args)
|
(letf! ((defun load-file (file) (load file nil 'nomessage))
|
||||||
(apply load file noerror t args))
|
(defun load (file &optional noerror _nomessage &rest args)
|
||||||
|
(apply load file noerror t args)))
|
||||||
(load site-run-file t t))))
|
(load site-run-file t t))))
|
||||||
;; Then startup as normal.
|
(apply fn args) ; start up as normal
|
||||||
(apply fn args)
|
(setq init t))
|
||||||
(setq --init-- t))
|
(when (or (not init) init-file-had-error)
|
||||||
(when (or (not --init--) init-file-had-error)
|
|
||||||
;; If we don't undo our inhibit-{message,redisplay} and there's an
|
;; If we don't undo our inhibit-{message,redisplay} and there's an
|
||||||
;; error, we'll see nothing but a blank Emacs frame.
|
;; error, we'll see nothing but a blank Emacs frame.
|
||||||
(doom--reset-inhibited-vars-h))
|
(doom--reset-inhibited-vars-h))
|
||||||
|
;; COMPAT: Once startup is sufficiently complete, undo our earlier
|
||||||
|
;; optimizations to reduce the scope of potential edge cases.
|
||||||
|
(advice-remove #'tool-bar-setup #'ignore)
|
||||||
|
(add-transient-hook! 'tool-bar-mode (tool-bar-setup))
|
||||||
(unless (default-toplevel-value 'mode-line-format)
|
(unless (default-toplevel-value 'mode-line-format)
|
||||||
(setq-default mode-line-format (get 'mode-line-format 'initial-value))))))
|
(setq-default mode-line-format (get 'mode-line-format 'initial-value))))))
|
||||||
|
|
||||||
|
|
|
@ -484,27 +484,67 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation."
|
||||||
file))))
|
file))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/sudo-find-file (file)
|
(defun doom/sudo-find-file (file &optional arg)
|
||||||
"Open FILE as root."
|
"Open FILE as root.
|
||||||
(interactive "FOpen file as root: ")
|
|
||||||
(find-file (doom--sudo-file-path (expand-file-name file))))
|
This will prompt you to save the current buffer, unless prefix ARG is given, in
|
||||||
|
which case it will save it without prompting."
|
||||||
|
(interactive
|
||||||
|
(list (read-file-name "Open file as root: ")
|
||||||
|
current-prefix-arg))
|
||||||
|
;; HACK: Teach `save-place' to treat the new "remote" buffer as if it were
|
||||||
|
;; visiting the same local file (because it is), and preserve the cursor
|
||||||
|
;; position as usual.
|
||||||
|
(letf! ((defun remote-local-name (path)
|
||||||
|
(if path (or (file-remote-p path 'localname) path)))
|
||||||
|
(defmacro with-local-name (&rest body)
|
||||||
|
`(when save-place-mode
|
||||||
|
(let ((buffer-file-name (remote-local-name buffer-file-name))
|
||||||
|
(default-directory (remote-local-name default-directory)))
|
||||||
|
,@body))))
|
||||||
|
(let ((window-start (window-start))
|
||||||
|
(buffer (current-buffer)))
|
||||||
|
(when (and buffer-file-name (file-equal-p buffer-file-name file))
|
||||||
|
(when (buffer-modified-p)
|
||||||
|
(save-some-buffers arg (lambda () (eq (current-buffer) buffer))))
|
||||||
|
(with-local-name (save-place-to-alist)))
|
||||||
|
(prog1
|
||||||
|
;; HACK: Disable auto-save in temporary tramp buffers because it could
|
||||||
|
;; trigger processes that hang silently in the background, making
|
||||||
|
;; those buffers inoperable for the rest of that session (Tramp
|
||||||
|
;; caches them).
|
||||||
|
(let ((auto-save-default nil)
|
||||||
|
;; REVIEW: use only these when we drop 28 support
|
||||||
|
(remote-file-name-inhibit-auto-save t)
|
||||||
|
(remote-file-name-inhibit-auto-save-visited t)
|
||||||
|
;; Prevent redundant work
|
||||||
|
save-place-mode)
|
||||||
|
(find-file (doom--sudo-file-path (expand-file-name file))))
|
||||||
|
;; Record of the cursor's old position if it isn't at BOB (indicating
|
||||||
|
;; this buffer was already open), in case the user wishes to go to it.
|
||||||
|
(unless (bobp)
|
||||||
|
(doom-set-jump-h)
|
||||||
|
;; save-place-find-file-hook requires point be a BOB to do its thang.
|
||||||
|
(goto-char (point-min)))
|
||||||
|
(with-local-name (save-place-find-file-hook))
|
||||||
|
(set-window-start nil window-start)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/sudo-this-file ()
|
(defun doom/sudo-this-file ()
|
||||||
"Open the current file as root."
|
"Open the current file as root."
|
||||||
(interactive)
|
(interactive)
|
||||||
(find-file
|
(doom/sudo-find-file
|
||||||
(doom--sudo-file-path
|
(or (buffer-file-name (buffer-base-buffer))
|
||||||
(or buffer-file-name
|
(when (or (derived-mode-p 'dired-mode)
|
||||||
(when (or (derived-mode-p 'dired-mode)
|
(derived-mode-p 'wdired-mode))
|
||||||
(derived-mode-p 'wdired-mode))
|
default-directory)
|
||||||
default-directory)))))
|
(user-error "Cannot determine the file path of the current buffer"))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/sudo-save-buffer ()
|
(defun doom/sudo-save-buffer ()
|
||||||
"Save this file as root."
|
"Save this file as root."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((file (doom--sudo-file-path buffer-file-name)))
|
(let ((file (doom--sudo-file-path (buffer-file-name (buffer-base-buffer)))))
|
||||||
(if-let (buffer (find-file-noselect file))
|
(if-let (buffer (find-file-noselect file))
|
||||||
(let ((origin (current-buffer)))
|
(let ((origin (current-buffer)))
|
||||||
(copy-to-buffer buffer (point-min) (point-max))
|
(copy-to-buffer buffer (point-min) (point-max))
|
||||||
|
@ -521,9 +561,17 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation."
|
||||||
(defun doom/remove-recent-file (file)
|
(defun doom/remove-recent-file (file)
|
||||||
"Remove FILE from your recently-opened-files list."
|
"Remove FILE from your recently-opened-files list."
|
||||||
(interactive
|
(interactive
|
||||||
(list (completing-read "Remove recent file: " recentf-list
|
(list (completing-read "Remove recent file: "
|
||||||
|
(lambda (string predicate action)
|
||||||
|
(if (eq action 'metadata)
|
||||||
|
'(metadata
|
||||||
|
(display-sort-function . identity)
|
||||||
|
(cycle-sort-function . identity)
|
||||||
|
(category . file))
|
||||||
|
(complete-with-action
|
||||||
|
action recentf-list string predicate)))
|
||||||
nil t)))
|
nil t)))
|
||||||
(setq recentf-list (delete file recentf-list))
|
(setq recentf-list (delete (recentf-expand-file-name file) recentf-list))
|
||||||
(recentf-save-list)
|
(recentf-save-list)
|
||||||
(message "Removed %S from `recentf-list'" (abbreviate-file-name file)))
|
(message "Removed %S from `recentf-list'" (abbreviate-file-name file)))
|
||||||
|
|
||||||
|
@ -593,7 +641,12 @@ see), and if nil, defaults to `find-sibling-rules'."
|
||||||
(nconc
|
(nconc
|
||||||
results
|
results
|
||||||
(mapcar #'expand-file-name
|
(mapcar #'expand-file-name
|
||||||
(file-expand-wildcards expansion nil t)))))))))
|
;; `file-expand-wildcards' has a new REGEXP
|
||||||
|
;; argument in 29+ that is needed here. This swap
|
||||||
|
;; makes it behave as if REGEXP == t.
|
||||||
|
(letf! (defun wildcard-to-regexp (wildcard)
|
||||||
|
(concat "\\`" wildcard "\\'"))
|
||||||
|
(file-expand-wildcards expansion nil))))))))))
|
||||||
;; Delete the file itself (in case it matched), and remove
|
;; Delete the file itself (in case it matched), and remove
|
||||||
;; duplicates, in case we have several expansions and some match
|
;; duplicates, in case we have several expansions and some match
|
||||||
;; the same subsets of files.
|
;; the same subsets of files.
|
||||||
|
|
|
@ -84,7 +84,8 @@ and `format!' into colored output, where COLOR is any car of this list (or
|
||||||
(doom-print--indent
|
(doom-print--indent
|
||||||
(if args (apply #'format str args) str)
|
(if args (apply #'format str args) str)
|
||||||
"> ")))
|
"> ")))
|
||||||
(path . abbreviate-file-name)
|
(path . (lambda (&rest segments)
|
||||||
|
(abbreviate-file-name (apply #'doom-path segments))))
|
||||||
(symbol . symbol-name)
|
(symbol . symbol-name)
|
||||||
(relpath . (lambda (str &optional dir)
|
(relpath . (lambda (str &optional dir)
|
||||||
(if (or (not str)
|
(if (or (not str)
|
||||||
|
|
|
@ -2,8 +2,13 @@
|
||||||
;;; lisp/packages.el
|
;;; lisp/packages.el
|
||||||
|
|
||||||
;; doom.el
|
;; doom.el
|
||||||
(package! auto-minor-mode :pin "17cfa1b54800fdef2975c0c0531dad34846a5065")
|
(package! auto-minor-mode
|
||||||
(package! gcmh :pin "0089f9c3a6d4e9a310d0791cf6fa8f35642ecfd9")
|
:pin "17cfa1b54800fdef2975c0c0531dad34846a5065")
|
||||||
|
(package! compat
|
||||||
|
:recipe (:host github :repo "emacs-compat/compat")
|
||||||
|
:pin "8d4e8a366681def88751f5e9975738ecd3180deb")
|
||||||
|
(package! gcmh
|
||||||
|
:pin "0089f9c3a6d4e9a310d0791cf6fa8f35642ecfd9")
|
||||||
|
|
||||||
;; doom-packages.el
|
;; doom-packages.el
|
||||||
(package! straight
|
(package! straight
|
||||||
|
@ -13,10 +18,10 @@
|
||||||
:branch ,straight-repository-branch
|
:branch ,straight-repository-branch
|
||||||
:local-repo "straight.el"
|
:local-repo "straight.el"
|
||||||
:files ("straight*.el"))
|
:files ("straight*.el"))
|
||||||
:pin "b3760f5829dba37e855add7323304561eb57a3d4")
|
:pin "b1062df10ba4c10ff7a3c61b9e124b3242b11bb2")
|
||||||
|
|
||||||
;; doom-ui.el
|
;; doom-ui.el
|
||||||
(package! nerd-icons :pin "c6a4acf19454b415cba1c43daf4bfca8fccdd9ba")
|
(package! nerd-icons :pin "8095215a503d8048739de8b4ea4066598edb8cbb")
|
||||||
(package! hide-mode-line :pin "bc5d293576c5e08c29e694078b96a5ed85631942")
|
(package! hide-mode-line :pin "bc5d293576c5e08c29e694078b96a5ed85631942")
|
||||||
(package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307")
|
(package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307")
|
||||||
(package! rainbow-delimiters :pin "f40ece58df8b2f0fb6c8576b527755a552a5e763")
|
(package! rainbow-delimiters :pin "f40ece58df8b2f0fb6c8576b527755a552a5e763")
|
||||||
|
@ -24,10 +29,10 @@
|
||||||
|
|
||||||
;; doom-editor.el
|
;; doom-editor.el
|
||||||
(package! better-jumper :pin "47622213783ece37d5337dc28d33b530540fc319")
|
(package! better-jumper :pin "47622213783ece37d5337dc28d33b530540fc319")
|
||||||
(package! dtrt-indent :pin "0230ec503283b895bd3df6c1e30b35a01aa0b9af")
|
(package! dtrt-indent :pin "5d1b44f9a1a484ca229cc14f8062609a10ef4891")
|
||||||
(package! helpful :pin "a32a5b3d959a7fccf09a71d97b3d7c888ac31c69")
|
(package! helpful :pin "a32a5b3d959a7fccf09a71d97b3d7c888ac31c69")
|
||||||
(package! pcre2el :pin "018531ba0cf8e2b28d1108136a0e031b6a45f1c1")
|
(package! pcre2el :pin "380723b2701cceb75c266440fb8db918f3340d50")
|
||||||
(package! smartparens :pin "0778a8a84064cf2bc3a9857bd0e7a4619cc1e5c3")
|
(package! smartparens :pin "ddc6233ea6fc2da7a3a8e44face465c15631b02b")
|
||||||
(package! ws-butler
|
(package! ws-butler
|
||||||
;; Use my fork of ws-butler, which has a few choice improvements and
|
;; Use my fork of ws-butler, which has a few choice improvements and
|
||||||
;; optimizations (the original has been abandoned).
|
;; optimizations (the original has been abandoned).
|
||||||
|
@ -35,13 +40,9 @@
|
||||||
:pin "572a10c11b6cb88293de48acbb59a059d36f9ba5")
|
:pin "572a10c11b6cb88293de48acbb59a059d36f9ba5")
|
||||||
|
|
||||||
;; doom-projects.el
|
;; doom-projects.el
|
||||||
(package! projectile :pin "e45f0b0cc43fdc066e7971ff3ed3bf4c78015ed0")
|
(package! projectile :pin "0163b335a18af0f077a474d4dc6b36e22b5e3274")
|
||||||
(package! project :pin "10a6b691e36ff897fb2a4b48896e08818afa77b0")
|
(package! project :pin "b6989856abe9411872bdff5c8aa190bef4d86409")
|
||||||
|
|
||||||
;; doom-keybinds.el
|
;; doom-keybinds.el
|
||||||
(package! general :pin "bda777cd303db217fd2fbf2087eff40ec4aafda1")
|
(package! general :pin "ced143c30de8e20f5a3761a465e684a1dc48471e")
|
||||||
(package! which-key :pin "4d20bc852545a2e602f59084a630f888542052b1")
|
(package! which-key :pin "96911a1d3faf8426a33241f4821319e98421f380")
|
||||||
|
|
||||||
(package! compat
|
|
||||||
:recipe (:host github :repo "emacs-compat/compat")
|
|
||||||
:pin "eb8fbfa5582a8e5880e2eaa66d15d498bca6a45a")
|
|
||||||
|
|
|
@ -8,16 +8,12 @@
|
||||||
:config
|
:config
|
||||||
(set-yas-minor-mode! 'emacs-everywhere-mode)
|
(set-yas-minor-mode! 'emacs-everywhere-mode)
|
||||||
|
|
||||||
;; HACK Inhibit MAJOR-MODE-local-vars-hook in emacs-everywhere buffers,
|
;; HACK: Inhibit MAJOR-MODE-local-vars-hook in emacs-everywhere buffers,
|
||||||
;; because Doom commonly starts servers and other extraneous services on
|
;; because Doom commonly starts servers and other extraneous services on
|
||||||
;; this hook, which will rarely work well in emacs-everywhere's temporary
|
;; this hook, which will rarely work well in emacs-everywhere's temporary
|
||||||
;; buffers anyway.
|
;; buffers anyway.
|
||||||
(setq-hook! 'emacs-everywhere-init-hooks doom-inhibit-local-var-hooks t)
|
(setq-hook! 'emacs-everywhere-init-hooks doom-inhibit-local-var-hooks t)
|
||||||
|
|
||||||
;; REVIEW: Fixes tecosaur/emacs-everywhere#75. Remove when dealt with
|
|
||||||
;; upstream.
|
|
||||||
(define-key emacs-everywhere-mode-map "\C-c\C-c" #'emacs-everywhere-finish)
|
|
||||||
|
|
||||||
(after! doom-modeline
|
(after! doom-modeline
|
||||||
(doom-modeline-def-segment emacs-everywhere
|
(doom-modeline-def-segment emacs-everywhere
|
||||||
(concat
|
(concat
|
||||||
|
@ -36,7 +32,7 @@
|
||||||
(doom-modeline-def-modeline 'emacs-everywhere
|
(doom-modeline-def-modeline 'emacs-everywhere
|
||||||
'(bar modals emacs-everywhere buffer-position
|
'(bar modals emacs-everywhere buffer-position
|
||||||
word-count parrot selection-info)
|
word-count parrot selection-info)
|
||||||
'(input-method major-mode checker
|
'(input-method major-mode check
|
||||||
#(" " 0 1 ; "Exit to app" icon + a little padding
|
#(" " 0 1 ; "Exit to app" icon + a little padding
|
||||||
(rear-nonsticky t
|
(rear-nonsticky t
|
||||||
display (raise -0.25)
|
display (raise -0.25)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; app/everywhere/packages.el
|
;;; app/everywhere/packages.el
|
||||||
|
|
||||||
(package! emacs-everywhere :pin "fbeff19825336777dccaefedf3f376dd622cd294")
|
(package! emacs-everywhere :pin "bc91164151ab012ff884af92321557f9b37eeed1")
|
||||||
|
|
|
@ -51,16 +51,19 @@
|
||||||
:hook (flycheck-mode . +syntax-init-popups-h)
|
:hook (flycheck-mode . +syntax-init-popups-h)
|
||||||
:config
|
:config
|
||||||
(setq flycheck-popup-tip-error-prefix "X ")
|
(setq flycheck-popup-tip-error-prefix "X ")
|
||||||
(after! evil
|
|
||||||
;; Don't display popups while in insert or replace mode, as it can affect
|
;; HACK: Only display the flycheck popup if we're in normal mode (for evil
|
||||||
;; the cursor's position or cause disruptive input delays.
|
;; users) or if no selection or completion is active. This popup can
|
||||||
(add-hook! '(evil-insert-state-entry-hook evil-replace-state-entry-hook)
|
;; interfere with the active evil mode, clear active regions, and other
|
||||||
#'flycheck-popup-tip-delete-popup)
|
;; funny business (see #7242).
|
||||||
(defadvice! +syntax--disable-flycheck-popup-tip-maybe-a (&rest _)
|
(defadvice! +syntax--disable-flycheck-popup-tip-maybe-a (&rest _)
|
||||||
:before-while #'flycheck-popup-tip-show-popup
|
:before-while #'flycheck-popup-tip-show-popup
|
||||||
(if evil-local-mode
|
(if (and (bound-and-true-p evil-local-mode)
|
||||||
(eq evil-state 'normal)
|
(not (evil-emacs-state-p)))
|
||||||
(not (bound-and-true-p company-backend))))))
|
(evil-normal-state-p)
|
||||||
|
(and (not (region-active-p))
|
||||||
|
(not (bound-and-true-p company-backend))
|
||||||
|
(not (ignore-errors (>= corfu--index 0)))))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! flycheck-posframe
|
(use-package! flycheck-posframe
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; completion/company/packages.el
|
;;; completion/company/packages.el
|
||||||
|
|
||||||
(package! company :pin "02903bd7088d65a87df0ae0f0d0a7118de147b69")
|
(package! company :pin "b0a522ac5bf8ba3d2f4f22e3aa846a4f82978a16")
|
||||||
(package! company-dict :pin "cd7b8394f6014c57897f65d335d6b2bd65dab1f4")
|
(package! company-dict :pin "cd7b8394f6014c57897f65d335d6b2bd65dab1f4")
|
||||||
(when (modulep! +childframe)
|
(when (modulep! +childframe)
|
||||||
(package! company-box :pin "b6f53e26adf948aca55c3ff6c22c21a6a6614253"))
|
(package! company-box :pin "c4f2e243fba03c11e46b1600b124e036f2be7691"))
|
||||||
|
|
|
@ -212,6 +212,14 @@ A few variables may be set to change behavior of this module:
|
||||||
Whether to prefer navigating org tables over cycling candidates when pressing
|
Whether to prefer navigating org tables over cycling candidates when pressing
|
||||||
[[kbd:][TAB]] and [[kbd:][S-TAB]].
|
[[kbd:][TAB]] and [[kbd:][S-TAB]].
|
||||||
|
|
||||||
|
** Turning off auto-completion
|
||||||
|
To disable idle (as-you-type) completion, unset ~corfu-auto~:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;;; in $DOOMDIR/config.el
|
||||||
|
(after! corfu
|
||||||
|
(setq corfu-auto nil))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Adding CAPFs to a mode
|
** Adding CAPFs to a mode
|
||||||
To add other CAPFs on a mode-per-mode basis, put either of the following in your
|
To add other CAPFs on a mode-per-mode basis, put either of the following in your
|
||||||
~config.el~:
|
~config.el~:
|
||||||
|
@ -242,7 +250,7 @@ all CAPFs are interactive to be called this way, in which case you can use
|
||||||
* Troubleshooting
|
* Troubleshooting
|
||||||
[[doom-report:][Report an issue?]]
|
[[doom-report:][Report an issue?]]
|
||||||
|
|
||||||
** Performance issues with ~cape-dabbrev~
|
** Troubleshooting ~cape-dabbrev~
|
||||||
|
|
||||||
If you have performance issues with ~cape-dabbrev~, the first thing I recommend
|
If you have performance issues with ~cape-dabbrev~, the first thing I recommend
|
||||||
doing is to look at the list of buffers Dabbrev is scanning:
|
doing is to look at the list of buffers Dabbrev is scanning:
|
||||||
|
@ -255,6 +263,22 @@ doing is to look at the list of buffers Dabbrev is scanning:
|
||||||
... and modify ~dabbrev-ignored-buffer-regexps~ or ~dabbrev-ignored-buffer-modes~
|
... and modify ~dabbrev-ignored-buffer-regexps~ or ~dabbrev-ignored-buffer-modes~
|
||||||
accordingly.
|
accordingly.
|
||||||
|
|
||||||
|
If you see garbage completion candidates, you can use the following command to
|
||||||
|
debug the issue:
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;;;###autoload
|
||||||
|
(defun search-in-dabbrev-buffers (search-string)
|
||||||
|
"Search for SEARCH-STRING in all buffers returned by `dabbrev--select-buffers'."
|
||||||
|
(interactive "sSearch string: ")
|
||||||
|
(let ((buffers (dabbrev--select-buffers)))
|
||||||
|
(multi-occur buffers search-string)))
|
||||||
|
|
||||||
|
;; Example usage:
|
||||||
|
;; Why are these weird characters appearing in my completions?
|
||||||
|
(search-in-dabbrev-buffers "\342\200\231")
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Fixing TAB Keybindings
|
** Fixing TAB Keybindings
|
||||||
|
|
||||||
If you encounter an issue where your ~TAB~ keybindings are not responding in Doom
|
If you encounter an issue where your ~TAB~ keybindings are not responding in Doom
|
||||||
|
|
|
@ -40,7 +40,8 @@ TAB/S-TAB.")
|
||||||
('aggressive
|
('aggressive
|
||||||
(not (or (bound-and-true-p mct--active)
|
(not (or (bound-and-true-p mct--active)
|
||||||
(bound-and-true-p vertico--input)
|
(bound-and-true-p vertico--input)
|
||||||
(eq (current-local-map) read-passwd-map)
|
(and (featurep 'auth-source)
|
||||||
|
(eq (current-local-map) read-passwd-map))
|
||||||
(and (featurep 'helm-core) (helm--alive-p))
|
(and (featurep 'helm-core) (helm--alive-p))
|
||||||
(and (featurep 'ido) (ido-active))
|
(and (featurep 'ido) (ido-active))
|
||||||
(where-is-internal 'minibuffer-complete
|
(where-is-internal 'minibuffer-complete
|
||||||
|
@ -53,7 +54,7 @@ TAB/S-TAB.")
|
||||||
(corfu-mode +1))))
|
(corfu-mode +1))))
|
||||||
:config
|
:config
|
||||||
(setq corfu-auto t
|
(setq corfu-auto t
|
||||||
corfu-auto-delay 0.1
|
corfu-auto-delay 0.18
|
||||||
corfu-auto-prefix 2
|
corfu-auto-prefix 2
|
||||||
global-corfu-modes '((not
|
global-corfu-modes '((not
|
||||||
erc-mode
|
erc-mode
|
||||||
|
@ -67,8 +68,10 @@ TAB/S-TAB.")
|
||||||
corfu-count 16
|
corfu-count 16
|
||||||
corfu-max-width 120
|
corfu-max-width 120
|
||||||
corfu-on-exact-match nil
|
corfu-on-exact-match nil
|
||||||
corfu-quit-at-boundary (if (modulep! +orderless) 'separator t)
|
corfu-quit-at-boundary (if (or (modulep! :completion vertico)
|
||||||
corfu-quit-no-match (if (modulep! +orderless) 'separator t)
|
(modulep! +orderless))
|
||||||
|
'separator t)
|
||||||
|
corfu-quit-no-match corfu-quit-at-boundary
|
||||||
tab-always-indent 'complete)
|
tab-always-indent 'complete)
|
||||||
(add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles)))
|
(add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles)))
|
||||||
(add-to-list 'corfu-auto-commands #'lispy-colon)
|
(add-to-list 'corfu-auto-commands #'lispy-colon)
|
||||||
|
@ -112,10 +115,10 @@ TAB/S-TAB.")
|
||||||
(use-package! cape
|
(use-package! cape
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(add-hook! prog-mode
|
(add-hook! 'prog-mode-hook
|
||||||
(defun +corfu-add-cape-file-h ()
|
(defun +corfu-add-cape-file-h ()
|
||||||
(add-hook 'completion-at-point-functions #'cape-file -10 t)))
|
(add-hook 'completion-at-point-functions #'cape-file -10 t)))
|
||||||
(add-hook! (org-mode markdown-mode)
|
(add-hook! '(org-mode-hook markdown-mode-hook)
|
||||||
(defun +corfu-add-cape-elisp-block-h ()
|
(defun +corfu-add-cape-elisp-block-h ()
|
||||||
(add-hook 'completion-at-point-functions #'cape-elisp-block 0 t)))
|
(add-hook 'completion-at-point-functions #'cape-elisp-block 0 t)))
|
||||||
;; Enable Dabbrev completion basically everywhere as a fallback.
|
;; Enable Dabbrev completion basically everywhere as a fallback.
|
||||||
|
@ -124,17 +127,23 @@ TAB/S-TAB.")
|
||||||
;; Set up `cape-dabbrev' options.
|
;; Set up `cape-dabbrev' options.
|
||||||
(defun +dabbrev-friend-buffer-p (other-buffer)
|
(defun +dabbrev-friend-buffer-p (other-buffer)
|
||||||
(< (buffer-size other-buffer) +corfu-buffer-scanning-size-limit))
|
(< (buffer-size other-buffer) +corfu-buffer-scanning-size-limit))
|
||||||
(add-hook! (prog-mode text-mode conf-mode comint-mode minibuffer-setup
|
(add-hook! '(prog-mode-hook
|
||||||
eshell-mode)
|
text-mode-hook
|
||||||
|
conf-mode-hook
|
||||||
|
comint-mode-hook
|
||||||
|
minibuffer-setup-hook
|
||||||
|
eshell-mode-hook)
|
||||||
(defun +corfu-add-cape-dabbrev-h ()
|
(defun +corfu-add-cape-dabbrev-h ()
|
||||||
(add-hook 'completion-at-point-functions #'cape-dabbrev 20 t)))
|
(add-hook 'completion-at-point-functions #'cape-dabbrev 20 t)))
|
||||||
(after! dabbrev
|
(after! dabbrev
|
||||||
(setq dabbrev-friend-buffer-function #'+dabbrev-friend-buffer-p
|
(setq dabbrev-friend-buffer-function #'+dabbrev-friend-buffer-p
|
||||||
dabbrev-ignored-buffer-regexps
|
dabbrev-ignored-buffer-regexps
|
||||||
'("^ "
|
'("\\` "
|
||||||
"\\(TAGS\\|tags\\|ETAGS\\|etags\\|GTAGS\\|GRTAGS\\|GPATH\\)\\(<[0-9]+>\\)?")
|
"\\(TAGS\\|tags\\|ETAGS\\|etags\\|GTAGS\\|GRTAGS\\|GPATH\\)\\(<[0-9]+>\\)?")
|
||||||
dabbrev-upcase-means-case-search t)
|
dabbrev-upcase-means-case-search t)
|
||||||
(add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode)))
|
(add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode)
|
||||||
|
(add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode)
|
||||||
|
(add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode)))
|
||||||
|
|
||||||
;; Make these capfs composable.
|
;; Make these capfs composable.
|
||||||
(advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible)
|
(advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible)
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; completion/corfu/packages.el
|
;;; completion/corfu/packages.el
|
||||||
|
|
||||||
(package! corfu :pin "c1e7b6190b00158e67347b4db0a8f7964e5d2f8b")
|
(package! corfu :pin "35cd5a0f3cba89766072e3e933d1fe2ee02f2289")
|
||||||
(package! cape :pin "a397a0c92de38277b7f835fa999fac400a764908")
|
(package! cape :pin "e01e4430234850263d326ad4521849cd46e64059")
|
||||||
(when (modulep! +icons)
|
(when (modulep! +icons)
|
||||||
(package! nerd-icons-corfu :pin "7077bb76fefc15aed967476406a19dc5c2500b3c"))
|
(package! nerd-icons-corfu :pin "7077bb76fefc15aed967476406a19dc5c2500b3c"))
|
||||||
(when (modulep! +orderless)
|
(when (and (not (modulep! :completion vertico))
|
||||||
(package! orderless :pin "b24748093b00b37c3a572c4909f61c08fa27504f"))
|
(modulep! +orderless))
|
||||||
|
;; enabling +orderless without vertico should be fairly niche enough that to
|
||||||
|
;; save contributor headaches we should only pin vertico's orderless and leave
|
||||||
|
;; this one unpinned
|
||||||
|
(package! orderless))
|
||||||
(when (modulep! :os tty)
|
(when (modulep! :os tty)
|
||||||
(package! corfu-terminal :pin "501548c3d51f926c687e8cd838c5865ec45d03cc"))
|
(package! corfu-terminal :pin "501548c3d51f926c687e8cd838c5865ec45d03cc"))
|
||||||
(when (modulep! :editor snippets)
|
(when (modulep! :editor snippets)
|
||||||
|
|
|
@ -43,7 +43,9 @@ Can be negative.")
|
||||||
;; symbol at point.
|
;; symbol at point.
|
||||||
helm-imenu-execute-action-at-once-if-one nil
|
helm-imenu-execute-action-at-once-if-one nil
|
||||||
;; Disable special behavior for left/right, M-left/right keys.
|
;; Disable special behavior for left/right, M-left/right keys.
|
||||||
helm-ff-lynx-style-map nil)
|
helm-ff-lynx-style-map nil
|
||||||
|
;; Don't commandeer the entire frame for helm commands.
|
||||||
|
helm-always-two-windows nil)
|
||||||
|
|
||||||
(map! [remap apropos] #'helm-apropos
|
(map! [remap apropos] #'helm-apropos
|
||||||
[remap find-library] #'helm-locate-library
|
[remap find-library] #'helm-locate-library
|
||||||
|
@ -188,7 +190,13 @@ Can be negative.")
|
||||||
|
|
||||||
|
|
||||||
(use-package! helm-descbinds
|
(use-package! helm-descbinds
|
||||||
:hook (helm-mode . helm-descbinds-mode))
|
:hook (helm-mode . helm-descbinds-mode)
|
||||||
|
:config
|
||||||
|
;; HACK: Upstream claims that the two packages are incompatible, but changing
|
||||||
|
;; `prefix-help-command' seems to smooth the incompatibility over. More
|
||||||
|
;; testing is needed...
|
||||||
|
(setq helm-descbinds-disable-which-key nil
|
||||||
|
prefix-help-command #'helm-descbinds))
|
||||||
|
|
||||||
|
|
||||||
(use-package! helm-icons
|
(use-package! helm-icons
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; completion/helm/packages.el
|
;;; completion/helm/packages.el
|
||||||
|
|
||||||
(package! helm :pin "f34ea6b702648e5c7535a704bdb6c4d7afb4b3b8")
|
(package! helm :pin "28f62344fed0d8be0bcef5aa8a018ba58198ba0c")
|
||||||
(package! helm-company :pin "4622b82353220ee6cc33468f710fa5b6b253b7f1")
|
(package! helm-company :pin "4622b82353220ee6cc33468f710fa5b6b253b7f1")
|
||||||
(package! helm-c-yasnippet :pin "c5880e740da101fde7a995e94a7b16c330e57583")
|
(package! helm-c-yasnippet :pin "c5880e740da101fde7a995e94a7b16c330e57583")
|
||||||
(package! helm-descbinds :pin "b72515982396b6e336ad7beb6767e95a80fca192")
|
(package! helm-descbinds :pin "ca03f02da4e54a1d0a2d5498b86e1639aa808d8c")
|
||||||
(package! helm-describe-modes :pin "11fb36af119b784539d31c6160002de1957408aa")
|
(package! helm-describe-modes :pin "11fb36af119b784539d31c6160002de1957408aa")
|
||||||
(package! helm-projectile :pin "e2e38825c975269a4971df25e79b2ae98929624e")
|
(package! helm-projectile :pin "e2e38825c975269a4971df25e79b2ae98929624e")
|
||||||
(package! helm-rg :pin "ee0a3c09da0c843715344919400ab0a0190cc9dc")
|
(package! helm-rg :pin "ee0a3c09da0c843715344919400ab0a0190cc9dc")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; completion/ivy/packages.el
|
;;; completion/ivy/packages.el
|
||||||
|
|
||||||
(package! swiper :pin "8c30f4cab5948aa8d942a3b2bbf5fb6a94d9441d")
|
(package! swiper :pin "1f88e5499046d166d22bf733a3877aec3b424947")
|
||||||
(package! ivy)
|
(package! ivy)
|
||||||
(package! ivy-hydra)
|
(package! ivy-hydra)
|
||||||
(package! ivy-avy)
|
(package! ivy-avy)
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
(package! wgrep :pin "208b9d01cfffa71037527e3a324684b3ce45ddc4")
|
(package! wgrep :pin "208b9d01cfffa71037527e3a324684b3ce45ddc4")
|
||||||
|
|
||||||
(if (modulep! +prescient)
|
(if (modulep! +prescient)
|
||||||
(package! ivy-prescient :pin "4b875be52e75f7b81e68a16b62cfbb2f2584042c")
|
(package! ivy-prescient :pin "c39bf07c56b427bf41aafd7d20eaef5cf3c312b5")
|
||||||
(when (modulep! +fuzzy)
|
(when (modulep! +fuzzy)
|
||||||
(package! flx :pin "4b1346eb9a8a76ee9c9dede69738c63ad97ac5b6")))
|
(package! flx :pin "4b1346eb9a8a76ee9c9dede69738c63ad97ac5b6")))
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,9 @@ orderless."
|
||||||
((string= "!" pattern) `(orderless-literal . ""))
|
((string= "!" pattern) `(orderless-literal . ""))
|
||||||
;; Without literal
|
;; Without literal
|
||||||
((string-prefix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 1)))
|
((string-prefix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 1)))
|
||||||
|
;; Annotation
|
||||||
|
((string-prefix-p "&" pattern) `(orderless-annotation . ,(substring pattern 1)))
|
||||||
|
((string-suffix-p "&" pattern) `(orderless-annotation . ,(substring pattern 0 -1)))
|
||||||
;; Character folding
|
;; Character folding
|
||||||
((string-prefix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 1)))
|
((string-prefix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 1)))
|
||||||
((string-suffix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 0 -1)))
|
((string-suffix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 0 -1)))
|
||||||
|
@ -157,13 +160,16 @@ orderless."
|
||||||
(consult-customize
|
(consult-customize
|
||||||
consult-ripgrep consult-git-grep consult-grep
|
consult-ripgrep consult-git-grep consult-grep
|
||||||
consult-bookmark consult-recent-file
|
consult-bookmark consult-recent-file
|
||||||
+default/search-project +default/search-other-project
|
|
||||||
+default/search-project-for-symbol-at-point
|
|
||||||
+default/search-cwd +default/search-other-cwd
|
|
||||||
+default/search-notes-for-symbol-at-point
|
|
||||||
+default/search-emacsd
|
|
||||||
consult--source-recent-file consult--source-project-recent-file consult--source-bookmark
|
consult--source-recent-file consult--source-project-recent-file consult--source-bookmark
|
||||||
:preview-key "C-SPC")
|
:preview-key "C-SPC")
|
||||||
|
(when (modulep! :config default)
|
||||||
|
(consult-customize
|
||||||
|
+default/search-project +default/search-other-project
|
||||||
|
+default/search-project-for-symbol-at-point
|
||||||
|
+default/search-cwd +default/search-other-cwd
|
||||||
|
+default/search-notes-for-symbol-at-point
|
||||||
|
+default/search-emacsd
|
||||||
|
:preview-key "C-SPC"))
|
||||||
(consult-customize
|
(consult-customize
|
||||||
consult-theme
|
consult-theme
|
||||||
:preview-key (list "C-SPC" :debounce 0.5 'any))
|
:preview-key (list "C-SPC" :debounce 0.5 'any))
|
||||||
|
@ -195,13 +201,20 @@ orderless."
|
||||||
|
|
||||||
|
|
||||||
(use-package! consult-dir
|
(use-package! consult-dir
|
||||||
:bind (([remap list-directory] . consult-dir)
|
:defer t
|
||||||
|
:init
|
||||||
|
(map! [remap list-directory] #'consult-dir
|
||||||
|
(:after vertico
|
||||||
:map vertico-map
|
:map vertico-map
|
||||||
("C-x C-d" . consult-dir)
|
"C-x C-d" #'consult-dir
|
||||||
("C-x C-j" . consult-dir-jump-file))
|
"C-x C-j" #'consult-dir-jump-file))
|
||||||
:config
|
:config
|
||||||
|
;; DEPRECATED: Remove when Doom core replaces projectile with project.el
|
||||||
|
(setq consult-dir-project-list-function #'consult-dir-projectile-dirs)
|
||||||
|
|
||||||
(when (modulep! :tools docker)
|
(when (modulep! :tools docker)
|
||||||
;; TODO Replace with `tramp-container--completion-function' when we drop support for <29
|
;; TODO: Replace with `tramp-container--completion-function' when we drop
|
||||||
|
;; support for <29
|
||||||
(defun +vertico--consult-dir-container-hosts (host)
|
(defun +vertico--consult-dir-container-hosts (host)
|
||||||
"Get a list of hosts from HOST."
|
"Get a list of hosts from HOST."
|
||||||
(cl-loop for line in (cdr
|
(cl-loop for line in (cdr
|
||||||
|
@ -209,10 +222,7 @@ orderless."
|
||||||
(apply #'process-lines +vertico-consult-dir-container-executable
|
(apply #'process-lines +vertico-consult-dir-container-executable
|
||||||
(append +vertico-consult-dir-container-args (list "ps")))))
|
(append +vertico-consult-dir-container-args (list "ps")))))
|
||||||
for cand = (split-string line "[[:space:]]+" t)
|
for cand = (split-string line "[[:space:]]+" t)
|
||||||
collect (let ((user (unless (string-empty-p (car cand))
|
collect (format "/%s:%s:/" host (car (last cand)))))
|
||||||
(concat (car cand) "@")))
|
|
||||||
(hostname (car (last cand))))
|
|
||||||
(format "/%s:%s%s:/" host user hostname))))
|
|
||||||
|
|
||||||
(defun +vertico--consult-dir-podman-hosts ()
|
(defun +vertico--consult-dir-podman-hosts ()
|
||||||
(let ((+vertico-consult-dir-container-executable "podman"))
|
(let ((+vertico-consult-dir-container-executable "podman"))
|
||||||
|
@ -229,7 +239,7 @@ orderless."
|
||||||
:face consult-file
|
:face consult-file
|
||||||
:history file-name-history
|
:history file-name-history
|
||||||
:items ,#'+vertico--consult-dir-podman-hosts)
|
:items ,#'+vertico--consult-dir-podman-hosts)
|
||||||
"Podman candiadate source for `consult-dir'.")
|
"Podman candidate source for `consult-dir'.")
|
||||||
|
|
||||||
(defvar +vertico--consult-dir-source-tramp-docker
|
(defvar +vertico--consult-dir-source-tramp-docker
|
||||||
`(:name "Docker"
|
`(:name "Docker"
|
||||||
|
@ -238,7 +248,7 @@ orderless."
|
||||||
:face consult-file
|
:face consult-file
|
||||||
:history file-name-history
|
:history file-name-history
|
||||||
:items ,#'+vertico--consult-dir-docker-hosts)
|
:items ,#'+vertico--consult-dir-docker-hosts)
|
||||||
"Docker candiadate source for `consult-dir'.")
|
"Docker candidate source for `consult-dir'.")
|
||||||
|
|
||||||
(add-to-list 'consult-dir-sources '+vertico--consult-dir-source-tramp-podman t)
|
(add-to-list 'consult-dir-sources '+vertico--consult-dir-source-tramp-podman t)
|
||||||
(add-to-list 'consult-dir-sources '+vertico--consult-dir-source-tramp-docker t))
|
(add-to-list 'consult-dir-sources '+vertico--consult-dir-source-tramp-docker t))
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; completion/vertico/packages.el
|
;;; completion/vertico/packages.el
|
||||||
|
|
||||||
(package! vertico :pin "68cbd47589446e9674921bae0b98ff8fbe28be23")
|
(package! vertico :pin "68e51fda552a2f91caab69e83564bc91275b09b1")
|
||||||
|
|
||||||
(package! orderless :pin "dc7a781acf2e58ac7d20d1b522be0cde5213e057")
|
(package! orderless :pin "ac4aeb66f331f4c4a430d5556071e33177304c37")
|
||||||
|
|
||||||
(package! consult :pin "b48ff6bf0527baeb6bfd07c6da9d303ff0b79c3d")
|
(package! consult :pin "c87b0bf06de0c3cb60bc8d257c770cb981ddcd19")
|
||||||
(package! consult-dir :pin "3f5f4b71ebe819392cb090cda71bd39a93bd830a")
|
(package! consult-dir :pin "3f5f4b71ebe819392cb090cda71bd39a93bd830a")
|
||||||
(when (and (modulep! :checkers syntax)
|
(when (and (modulep! :checkers syntax)
|
||||||
(not (modulep! :checkers syntax +flymake)))
|
(not (modulep! :checkers syntax +flymake)))
|
||||||
(package! consult-flycheck :pin "754f5497d827f7d58009256a21af614cc44378a3"))
|
(package! consult-flycheck :pin "754f5497d827f7d58009256a21af614cc44378a3"))
|
||||||
(package! embark :pin "c93abadc8220c0caa6fea805f7a736c346d47e7e")
|
(package! embark :pin "d3c9d1b4c890cf365846cc2b418f37341999e79f")
|
||||||
(package! embark-consult :pin "c93abadc8220c0caa6fea805f7a736c346d47e7e")
|
(package! embark-consult :pin "d3c9d1b4c890cf365846cc2b418f37341999e79f")
|
||||||
|
|
||||||
(package! marginalia :pin "f6fe86b989a177355ab3ff7e97a384e10a7b0bb1")
|
(package! marginalia :pin "3275d1f85cb020280979a050054b843f7563aea2")
|
||||||
|
|
||||||
(package! wgrep :pin "208b9d01cfffa71037527e3a324684b3ce45ddc4")
|
(package! wgrep :pin "208b9d01cfffa71037527e3a324684b3ce45ddc4")
|
||||||
|
|
||||||
|
|
|
@ -434,8 +434,11 @@
|
||||||
;;; <leader> c --- code
|
;;; <leader> c --- code
|
||||||
(:prefix-map ("c" . "code")
|
(:prefix-map ("c" . "code")
|
||||||
(:when (and (modulep! :tools lsp) (not (modulep! :tools lsp +eglot)))
|
(:when (and (modulep! :tools lsp) (not (modulep! :tools lsp +eglot)))
|
||||||
:desc "LSP Execute code action" "a" #'lsp-execute-code-action
|
:desc "LSP Execute code action" "a" #'lsp-execute-code-action
|
||||||
:desc "LSP Organize imports" "o" #'lsp-organize-imports
|
:desc "LSP Organize imports" "o" #'lsp-organize-imports
|
||||||
|
:desc "LSP" "l" #'+default/lsp-command-map
|
||||||
|
:desc "LSP Rename" "r" #'lsp-rename
|
||||||
|
:desc "Symbols" "S" #'lsp-treemacs-symbols
|
||||||
(:when (modulep! :completion ivy)
|
(:when (modulep! :completion ivy)
|
||||||
:desc "Jump to symbol in current workspace" "j" #'lsp-ivy-workspace-symbol
|
:desc "Jump to symbol in current workspace" "j" #'lsp-ivy-workspace-symbol
|
||||||
:desc "Jump to symbol in any workspace" "J" #'lsp-ivy-global-workspace-symbol)
|
:desc "Jump to symbol in any workspace" "J" #'lsp-ivy-global-workspace-symbol)
|
||||||
|
@ -449,10 +452,7 @@
|
||||||
:desc "Errors list" "X" #'lsp-treemacs-errors-list
|
:desc "Errors list" "X" #'lsp-treemacs-errors-list
|
||||||
:desc "Incoming call hierarchy" "y" #'lsp-treemacs-call-hierarchy
|
:desc "Incoming call hierarchy" "y" #'lsp-treemacs-call-hierarchy
|
||||||
:desc "Outgoing call hierarchy" "Y" (cmd!! #'lsp-treemacs-call-hierarchy t)
|
:desc "Outgoing call hierarchy" "Y" (cmd!! #'lsp-treemacs-call-hierarchy t)
|
||||||
:desc "References tree" "R" (cmd!! #'lsp-treemacs-references t)
|
:desc "References tree" "R" (cmd!! #'lsp-treemacs-references t)))
|
||||||
:desc "Symbols" "S" #'lsp-treemacs-symbols
|
|
||||||
:desc "LSP" "l" #'+default/lsp-command-map
|
|
||||||
:desc "LSP Rename" "r" #'lsp-rename))
|
|
||||||
(:when (modulep! :tools lsp +eglot)
|
(:when (modulep! :tools lsp +eglot)
|
||||||
:desc "LSP Execute code action" "a" #'eglot-code-actions
|
:desc "LSP Execute code action" "a" #'eglot-code-actions
|
||||||
:desc "LSP Rename" "r" #'eglot-rename
|
:desc "LSP Rename" "r" #'eglot-rename
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; editor/evil/packages.el
|
;;; editor/evil/packages.el
|
||||||
|
|
||||||
(package! evil :pin "5995f6f21f662484440ed67a28ce59e365feb9ad")
|
(package! evil :pin "0251080640e0da6f0eec2b7d8dd70e9c9b9915d7")
|
||||||
(package! evil-args :pin "2671071a4a57eaee7cc8c27b9e4b6fc60fd2ccd3")
|
(package! evil-args :pin "a8151556f63c9d45d0c44c8a7ef9e5a542f3cdc7")
|
||||||
(package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9")
|
(package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9")
|
||||||
(package! evil-embrace :pin "3081d37811b6a3dfaaf01d578c7ab7a746c6064d")
|
(package! evil-embrace :pin "3081d37811b6a3dfaaf01d578c7ab7a746c6064d")
|
||||||
(package! evil-escape
|
(package! evil-escape
|
||||||
|
@ -11,10 +11,10 @@
|
||||||
(package! evil-exchange :pin "5f0a2d41434c17c6fb02e4f744043775de1c63a2")
|
(package! evil-exchange :pin "5f0a2d41434c17c6fb02e4f744043775de1c63a2")
|
||||||
(package! evil-indent-plus :pin "f392696e4813f1d3a92c7eeed333248914ba6dae")
|
(package! evil-indent-plus :pin "f392696e4813f1d3a92c7eeed333248914ba6dae")
|
||||||
(package! evil-lion :pin "1e838a53b8f18a3c8bdf3e952186abc2ee9cb98e")
|
(package! evil-lion :pin "1e838a53b8f18a3c8bdf3e952186abc2ee9cb98e")
|
||||||
(package! evil-nerd-commenter :pin "3b197a2b559b06a7cf39978704b196f53dac802a")
|
(package! evil-nerd-commenter :pin "ae52c5070a48793e2c24474c9c8dbf20175d18a0")
|
||||||
(package! evil-numbers :pin "7a1b62afc12da2b582bf84d722e7b10ca8b97065")
|
(package! evil-numbers :pin "7a1b62afc12da2b582bf84d722e7b10ca8b97065")
|
||||||
(package! evil-snipe :pin "c2108d3932fcd2f75ac3e48250d6badd668f5b4f")
|
(package! evil-snipe :pin "c2108d3932fcd2f75ac3e48250d6badd668f5b4f")
|
||||||
(package! evil-surround :pin "c7116cdc774b1e259eaf3e9e7a318a6c99c2da17")
|
(package! evil-surround :pin "da05c60b0621cf33161bb4335153f75ff5c29d91")
|
||||||
(package! evil-textobj-anyblock
|
(package! evil-textobj-anyblock
|
||||||
:recipe (:host github
|
:recipe (:host github
|
||||||
:repo "willghatch/evil-textobj-anyblock"
|
:repo "willghatch/evil-textobj-anyblock"
|
||||||
|
@ -35,4 +35,4 @@
|
||||||
(package! neotree)
|
(package! neotree)
|
||||||
(autoload 'neotree-make-executor "neotree" nil nil 'macro))
|
(autoload 'neotree-make-executor "neotree" nil nil 'macro))
|
||||||
|
|
||||||
(package! evil-collection :pin "8c84f9bc89fe56e71b56519f886085ddcbc671cf"))
|
(package! evil-collection :pin "ca977acb83c0dd01fc57dbc6f3d3111e89f4ec9d"))
|
||||||
|
|
|
@ -78,6 +78,18 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
||||||
((+fold--hideshow-fold-p) (+fold-from-eol (hs-toggle-hiding)))
|
((+fold--hideshow-fold-p) (+fold-from-eol (hs-toggle-hiding)))
|
||||||
((+fold--ts-fold-p) (ts-fold-toggle)))))
|
((+fold--ts-fold-p) (ts-fold-toggle)))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +fold/open-rec ()
|
||||||
|
"Recursively open the folded region at point.
|
||||||
|
|
||||||
|
Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
||||||
|
(interactive)
|
||||||
|
(save-excursion
|
||||||
|
(cond ((+fold--vimish-fold-p) (vimish-fold-unfold))
|
||||||
|
((+fold--outline-fold-p) (outline-show-subtree))
|
||||||
|
((+fold--hideshow-fold-p) (+fold-from-eol (hs-show-block)))
|
||||||
|
((+fold--ts-fold-p) (ts-fold-open)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +fold/open ()
|
(defun +fold/open ()
|
||||||
"Open the folded region at point.
|
"Open the folded region at point.
|
||||||
|
@ -87,7 +99,7 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(cond ((+fold--vimish-fold-p) (vimish-fold-unfold))
|
(cond ((+fold--vimish-fold-p) (vimish-fold-unfold))
|
||||||
((+fold--outline-fold-p)
|
((+fold--outline-fold-p)
|
||||||
(outline-show-children)
|
(outline-show-branches)
|
||||||
(outline-show-entry))
|
(outline-show-entry))
|
||||||
((+fold--hideshow-fold-p) (+fold-from-eol (hs-show-block)))
|
((+fold--hideshow-fold-p) (+fold-from-eol (hs-show-block)))
|
||||||
((+fold--ts-fold-p) (ts-fold-open)))))
|
((+fold--ts-fold-p) (ts-fold-open)))))
|
||||||
|
@ -111,7 +123,7 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
||||||
(list (if current-prefix-arg (prefix-numeric-value current-prefix-arg))))
|
(list (if current-prefix-arg (prefix-numeric-value current-prefix-arg))))
|
||||||
(cond ((+fold--ts-fold-p)
|
(cond ((+fold--ts-fold-p)
|
||||||
(ts-fold-open-all))
|
(ts-fold-open-all))
|
||||||
((featurep 'vimish-fold)
|
((and (featurep 'vimish-fold) (+fold--vimish-fold-p))
|
||||||
(vimish-fold-unfold-all))
|
(vimish-fold-unfold-all))
|
||||||
((save-excursion
|
((save-excursion
|
||||||
(+fold--ensure-hideshow-mode)
|
(+fold--ensure-hideshow-mode)
|
||||||
|
@ -138,8 +150,12 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
||||||
(+fold--ensure-hideshow-mode)
|
(+fold--ensure-hideshow-mode)
|
||||||
(hs-life-goes-on
|
(hs-life-goes-on
|
||||||
(if (integerp level)
|
(if (integerp level)
|
||||||
(hs-hide-level-recursive (1- level) (point-min) (point-max))
|
(progn
|
||||||
(hs-hide-all)))))))
|
(outline--show-headings-up-to-level (1+ level))
|
||||||
|
(hs-hide-level-recursive (1- level) (point-min) (point-max)))
|
||||||
|
(hs-hide-all)
|
||||||
|
(when (fboundp 'outline-hide-sublevels)
|
||||||
|
(outline-show-only-headings))))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +fold/next (count)
|
(defun +fold/next (count)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
[remap evil-toggle-fold] #'+fold/toggle
|
[remap evil-toggle-fold] #'+fold/toggle
|
||||||
[remap evil-close-fold] #'+fold/close
|
[remap evil-close-fold] #'+fold/close
|
||||||
[remap evil-open-fold] #'+fold/open
|
[remap evil-open-fold] #'+fold/open
|
||||||
[remap evil-open-fold-rec] #'+fold/open
|
[remap evil-open-fold-rec] #'+fold/open-rec
|
||||||
[remap evil-close-folds] #'+fold/close-all
|
[remap evil-close-folds] #'+fold/close-all
|
||||||
[remap evil-open-folds] #'+fold/open-all)
|
[remap evil-open-folds] #'+fold/open-all)
|
||||||
(after! evil
|
(after! evil
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; editor/snippets/packages.el
|
;;; editor/snippets/packages.el
|
||||||
|
|
||||||
(package! yasnippet :pin "297546f0853a6a51f5b05e954d0c6aea8caa5ec2")
|
(package! yasnippet :pin "eb5ba2664c3a68ae4a53bb38b85418dd131b208f")
|
||||||
(package! auto-yasnippet :pin "6a9e406d0d7f9dfd6dff7647f358cb05a0b1637e")
|
(package! auto-yasnippet :pin "6a9e406d0d7f9dfd6dff7647f358cb05a0b1637e")
|
||||||
(package! doom-snippets
|
(package! doom-snippets
|
||||||
:recipe (:host github
|
:recipe (:host github
|
||||||
:repo "doomemacs/snippets"
|
:repo "doomemacs/snippets"
|
||||||
:files (:defaults "*"))
|
:files (:defaults "*"))
|
||||||
:pin "f022984ee1318a4015d5d081b3c3dab5a60dc6ff")
|
:pin "c1384cc7975ee7ca7d551eb56c104d768440c3cb")
|
||||||
|
|
|
@ -28,10 +28,13 @@
|
||||||
"k" #'log-view-msg-prev))
|
"k" #'log-view-msg-prev))
|
||||||
|
|
||||||
|
|
||||||
(after! vc-annotate
|
(after! vc
|
||||||
(set-popup-rules!
|
(set-popup-rules!
|
||||||
'(("^\\*vc-diff" :select nil) ; *vc-diff*
|
'(("^\\*vc-diff" :select nil :size '+popup-shrink-to-fit)
|
||||||
("^\\*vc-change" :select t))) ; *vc-change-log*
|
("^\\*vc-change-log" :select t))))
|
||||||
|
|
||||||
|
|
||||||
|
(after! vc-annotate
|
||||||
(set-evil-initial-state! 'vc-annotate-mode 'normal)
|
(set-evil-initial-state! 'vc-annotate-mode 'normal)
|
||||||
|
|
||||||
;; Clean up after itself
|
;; Clean up after itself
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
(package! smerge-mode :built-in t)
|
(package! smerge-mode :built-in t)
|
||||||
|
|
||||||
(package! browse-at-remote :pin "76aa27dfd469fcae75ed7031bb73830831aaccbf")
|
(package! browse-at-remote :pin "76aa27dfd469fcae75ed7031bb73830831aaccbf")
|
||||||
(package! git-commit :pin "b68e0a3c3388af8daac662f25ccfd3e980590e12")
|
(package! git-commit :pin "b5637d665c1e5bd5b76ffb072dbac387f37a5f63")
|
||||||
(package! git-timemachine
|
(package! git-timemachine
|
||||||
;; The original lives on codeberg.org; which has uptime issues.
|
;; The original lives on codeberg.org; which has uptime issues.
|
||||||
:recipe (:host github :repo "emacsmirror/git-timemachine")
|
:recipe (:host github :repo "emacsmirror/git-timemachine")
|
||||||
:pin "ac933e5cd29583c131401f3bd991d98129c316df")
|
:pin "5ed73c3831cf6da10ba941e6abba708a86853e8f")
|
||||||
(package! git-modes :pin "3cc94974c09c43462dfbfbe20396a414352dbb92")
|
(package! git-modes :pin "3cc94974c09c43462dfbfbe20396a414352dbb92")
|
||||||
|
|
|
@ -33,8 +33,11 @@ default/fallback account."
|
||||||
:enter-func
|
:enter-func
|
||||||
(lambda () (mu4e-message "Switched to %s" label))
|
(lambda () (mu4e-message "Switched to %s" label))
|
||||||
:leave-func
|
:leave-func
|
||||||
(lambda () (progn (setq +mu4e-personal-addresses nil)
|
(lambda ()
|
||||||
(mu4e-clear-caches)))
|
(setq +mu4e-personal-addresses nil)
|
||||||
|
;; REVIEW: `mu4e-clear-caches' was removed in 1.12.2, but
|
||||||
|
;; may still be useful to users on older versions.
|
||||||
|
(if (fboundp 'mu4e-clear-caches) (mu4e-clear-caches)))
|
||||||
:match-func
|
:match-func
|
||||||
(lambda (msg)
|
(lambda (msg)
|
||||||
(when msg
|
(when msg
|
||||||
|
|
|
@ -75,6 +75,7 @@ is non-nil."
|
||||||
(setq mu4e-get-mail-command "offlineimap -o -q")))
|
(setq mu4e-get-mail-command "offlineimap -o -q")))
|
||||||
|
|
||||||
(setq mu4e-update-interval nil
|
(setq mu4e-update-interval nil
|
||||||
|
mu4e-notification-support t
|
||||||
mu4e-sent-messages-behavior 'sent
|
mu4e-sent-messages-behavior 'sent
|
||||||
mu4e-hide-index-messages t
|
mu4e-hide-index-messages t
|
||||||
;; configuration for sending mail
|
;; configuration for sending mail
|
||||||
|
@ -671,77 +672,3 @@ See `+mu4e-msg-gmail-p' and `mu4e-sent-messages-behavior'.")
|
||||||
(`refile (mu4e-action-retag-message msg "-\\Inbox"))
|
(`refile (mu4e-action-retag-message msg "-\\Inbox"))
|
||||||
(`flag (mu4e-action-retag-message msg "+\\Starred"))
|
(`flag (mu4e-action-retag-message msg "+\\Starred"))
|
||||||
(`unflag (mu4e-action-retag-message msg "-\\Starred"))))))))
|
(`unflag (mu4e-action-retag-message msg "-\\Starred"))))))))
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Alerts
|
|
||||||
|
|
||||||
(use-package! mu4e-alert
|
|
||||||
:after mu4e
|
|
||||||
:config
|
|
||||||
(setq doom-modeline-mu4e t)
|
|
||||||
|
|
||||||
(mu4e-alert-enable-mode-line-display)
|
|
||||||
(mu4e-alert-enable-notifications)
|
|
||||||
|
|
||||||
(when (version<= "1.6" mu4e-mu-version)
|
|
||||||
(defadvice! +mu4e-alert-filter-repeated-mails-fixed-a (mails)
|
|
||||||
"Filters the MAILS that have been seen already\nUses :message-id not :docid."
|
|
||||||
:override #'mu4e-alert-filter-repeated-mails
|
|
||||||
(cl-remove-if (lambda (mail)
|
|
||||||
(prog1 (and (not mu4e-alert-notify-repeated-mails)
|
|
||||||
(ht-get mu4e-alert-repeated-mails
|
|
||||||
(plist-get mail :message-id)))
|
|
||||||
(ht-set! mu4e-alert-repeated-mails
|
|
||||||
(plist-get mail :message-id)
|
|
||||||
t)))
|
|
||||||
mails)))
|
|
||||||
|
|
||||||
(when (featurep :system 'linux)
|
|
||||||
(mu4e-alert-set-default-style 'libnotify)
|
|
||||||
|
|
||||||
(defvar +mu4e-alert-bell-cmd '("paplay" . "/usr/share/sounds/freedesktop/stereo/message.oga")
|
|
||||||
"Cons list with command to play a sound, and the sound file to play.
|
|
||||||
Disabled when set to nil.")
|
|
||||||
|
|
||||||
(setq mu4e-alert-email-notification-types '(subjects))
|
|
||||||
(defun +mu4e-alert-grouped-mail-notification-formatter-with-bell (mail-group _all-mails)
|
|
||||||
"Default function to format MAIL-GROUP for notification.
|
|
||||||
ALL-MAILS are the all the unread emails"
|
|
||||||
(when +mu4e-alert-bell-cmd
|
|
||||||
(start-process "mu4e-alert-bell" nil (car +mu4e-alert-bell-cmd) (cdr +mu4e-alert-bell-cmd)))
|
|
||||||
(if (> (length mail-group) 1)
|
|
||||||
(let* ((mail-count (length mail-group))
|
|
||||||
(first-mail (car mail-group))
|
|
||||||
(title-prefix (format "You have %d unread emails"
|
|
||||||
mail-count))
|
|
||||||
(field-value (mu4e-alert--get-group first-mail))
|
|
||||||
(title-suffix (format (pcase mu4e-alert-group-by
|
|
||||||
(`:from "from %s:")
|
|
||||||
(`:to "to %s:")
|
|
||||||
(`:maildir "in %s:")
|
|
||||||
(`:priority "with %s priority:")
|
|
||||||
(`:flags "with %s flags:"))
|
|
||||||
field-value))
|
|
||||||
(title (format "%s %s" title-prefix title-suffix)))
|
|
||||||
(list :title title
|
|
||||||
:body (s-join "\n"
|
|
||||||
(mapcar (lambda (mail)
|
|
||||||
(format "%s<b>%s</b> • %s"
|
|
||||||
(cond
|
|
||||||
((plist-get mail :in-reply-to) "⮩ ")
|
|
||||||
((string-match-p "\\`Fwd:"
|
|
||||||
(plist-get mail :subject)) " ⮯ ")
|
|
||||||
(t " "))
|
|
||||||
(truncate-string-to-width (or (caar (plist-get mail :from))
|
|
||||||
(cdar (plist-get mail :from)))
|
|
||||||
20 nil nil t)
|
|
||||||
(truncate-string-to-width
|
|
||||||
(replace-regexp-in-string "\\`Re: \\|\\`Fwd: " ""
|
|
||||||
(plist-get mail :subject))
|
|
||||||
40 nil nil t)))
|
|
||||||
mail-group))))
|
|
||||||
(let* ((new-mail (car mail-group))
|
|
||||||
(subject (plist-get new-mail :subject))
|
|
||||||
(sender (caar (plist-get new-mail :from))))
|
|
||||||
(list :title sender :body subject))))
|
|
||||||
(setq mu4e-alert-grouped-mail-notification-formatter #'+mu4e-alert-grouped-mail-notification-formatter-with-bell)))
|
|
||||||
|
|
|
@ -3,5 +3,3 @@
|
||||||
|
|
||||||
(when (modulep! +org)
|
(when (modulep! +org)
|
||||||
(package! org-msg :pin "0b65f0f77a7a71881ddfce19a8cdc60465bda057"))
|
(package! org-msg :pin "0b65f0f77a7a71881ddfce19a8cdc60465bda057"))
|
||||||
|
|
||||||
(package! mu4e-alert :pin "6beda20fc69771f2778f507c4a9e069dbaf1b628")
|
|
||||||
|
|
|
@ -78,7 +78,8 @@ This is ignored by ccls.")
|
||||||
:return "return"
|
:return "return"
|
||||||
:yield "#require")
|
:yield "#require")
|
||||||
|
|
||||||
(add-to-list 'find-sibling-rules '("/\\([^/]+\\)\\.c\\(c\\|pp\\)\\'" "\\1.\\(h\\|hh\\|hpp\\)"))
|
(add-to-list 'find-sibling-rules '("/\\([^/]+\\)\\.c\\(c\\|pp\\)?\\'" "\\1.h\\(h\\|pp\\)?\\'"))
|
||||||
|
(add-to-list 'find-sibling-rules '("/\\([^/]+\\)\\.h\\(h\\|pp\\)?\\'" "\\1.c\\(c\\|pp\\)?\\'"))
|
||||||
|
|
||||||
(when (modulep! +tree-sitter)
|
(when (modulep! +tree-sitter)
|
||||||
(add-hook! '(c-mode-local-vars-hook
|
(add-hook! '(c-mode-local-vars-hook
|
||||||
|
|
|
@ -174,3 +174,8 @@
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(add-to-list 'sly-contribs 'sly-asdf 'append))
|
(add-to-list 'sly-contribs 'sly-asdf 'append))
|
||||||
|
|
||||||
|
(use-package! sly-stepper
|
||||||
|
:defer t
|
||||||
|
:init
|
||||||
|
(add-to-list 'sly-contribs 'sly-stepper))
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
(when (package! sly :pin "ed17d2c2bd7aead0fbb09c3d22861c80a522a097")
|
(when (package! sly :pin "ed17d2c2bd7aead0fbb09c3d22861c80a522a097")
|
||||||
(package! sly-asdf :pin "6f9d751469bb82530db1673c22e7437ca6c95f45")
|
(package! sly-asdf :pin "6f9d751469bb82530db1673c22e7437ca6c95f45")
|
||||||
|
(package! sly-quicklisp :pin "34c73d43dd9066262387c626c17a9b486db07b2d")
|
||||||
|
(package! sly-stepper :recipe (:host github :repo "joaotavora/sly-stepper"
|
||||||
|
:files (:defaults "*.lisp" "*.asd")))
|
||||||
(package! sly-macrostep :pin "5113e4e926cd752b1d0bcc1508b3ebad5def5fad")
|
(package! sly-macrostep :pin "5113e4e926cd752b1d0bcc1508b3ebad5def5fad")
|
||||||
(package! sly-repl-ansi-color :pin "b9cd52d1cf927bf7e08582d46ab0bcf1d4fb5048")
|
(package! sly-repl-ansi-color :pin "b9cd52d1cf927bf7e08582d46ab0bcf1d4fb5048")
|
||||||
(package! sly-overlay :pin "916b50297a1f3bb110f840b89b8717d194623e5f"))
|
(package! sly-overlay :pin "916b50297a1f3bb110f840b89b8717d194623e5f"))
|
||||||
|
|
|
@ -413,20 +413,6 @@ This generally applies to your private config (`doom-user-dir') or Doom's source
|
||||||
;;
|
;;
|
||||||
;;; Fontification
|
;;; Fontification
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +emacs-lisp-truncate-pin ()
|
|
||||||
"Truncates long SHA1 hashes in `package!' :pin's."
|
|
||||||
(save-excursion
|
|
||||||
(goto-char (match-beginning 0))
|
|
||||||
(and (stringp (plist-get (sexp-at-point) :pin))
|
|
||||||
(search-forward ":pin" nil t)
|
|
||||||
(let ((start (re-search-forward "\"[^\"\n]\\{12\\}" nil t))
|
|
||||||
(finish (and (re-search-forward "\"" (line-end-position) t)
|
|
||||||
(match-beginning 0))))
|
|
||||||
(when (and start finish)
|
|
||||||
(put-text-property start finish 'display "...")))))
|
|
||||||
nil)
|
|
||||||
|
|
||||||
(defvar +emacs-lisp--face nil)
|
(defvar +emacs-lisp--face nil)
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +emacs-lisp-highlight-vars-and-faces (end)
|
(defun +emacs-lisp-highlight-vars-and-faces (end)
|
||||||
|
|
|
@ -115,8 +115,6 @@ See `+emacs-lisp-non-package-mode' for details.")
|
||||||
'emacs-lisp-mode
|
'emacs-lisp-mode
|
||||||
(append `(;; custom Doom cookies
|
(append `(;; custom Doom cookies
|
||||||
("^;;;###\\(autodef\\|if\\|package\\)[ \n]" (1 font-lock-warning-face t)))
|
("^;;;###\\(autodef\\|if\\|package\\)[ \n]" (1 font-lock-warning-face t)))
|
||||||
;; Shorten the :pin of `package!' statements to 10 characters
|
|
||||||
`(("(package!\\_>" (0 (+emacs-lisp-truncate-pin))))
|
|
||||||
;; highlight defined, special variables & functions
|
;; highlight defined, special variables & functions
|
||||||
(when +emacs-lisp-enable-extra-fontification
|
(when +emacs-lisp-enable-extra-fontification
|
||||||
`((+emacs-lisp-highlight-vars-and-faces . +emacs-lisp--face)))))
|
`((+emacs-lisp-highlight-vars-and-faces . +emacs-lisp--face)))))
|
||||||
|
|
8
modules/lang/factor/autoload.el
Normal file
8
modules/lang/factor/autoload.el
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
;;; lang/factor/autoload.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +factor/open-repl ()
|
||||||
|
"Open the Factor Listener."
|
||||||
|
(interactive)
|
||||||
|
(call-interactively #'run-factor)
|
||||||
|
(current-buffer))
|
|
@ -5,73 +5,79 @@
|
||||||
:init
|
:init
|
||||||
(after! factor-mode
|
(after! factor-mode
|
||||||
(set-eval-handler! 'factor-mode #'fuel-eval-region)
|
(set-eval-handler! 'factor-mode #'fuel-eval-region)
|
||||||
(set-repl-handler! 'factor-mode #'run-factor))
|
(set-repl-handler! 'factor-mode #'+factor/open-repl
|
||||||
|
:persist t
|
||||||
|
:send-region #'fuel-eval-region
|
||||||
|
:send-buffer #'fuel-run-file)
|
||||||
|
(set-lookup-handlers! 'factor-mode
|
||||||
|
:definition #'fuel-edit-word-at-point
|
||||||
|
:references #'fuel-show-callers
|
||||||
|
:documentation #'fuel-help)
|
||||||
|
(map! :map factor-mode-map
|
||||||
|
:localleader
|
||||||
|
"t" #'fuel-test-vocab
|
||||||
|
"F" #'fuel-run-file
|
||||||
|
"f" #'run-factor
|
||||||
|
"a" #'fuel-refresh-all
|
||||||
|
"L" #'fuel-load-usings
|
||||||
|
"u" #'fuel-vocab-usage
|
||||||
|
"U" #'fuel-vocab-uses
|
||||||
|
(:prefix ("c" . "change")
|
||||||
|
"w" #'fuel-edit-word-at-point
|
||||||
|
"d" #'fuel-edit-word-doc-at-point
|
||||||
|
"v" #'fuel-edit-vocabulary)
|
||||||
|
(:prefix ("e" . "eval")
|
||||||
|
"d" #'fuel-eval-definition
|
||||||
|
"R" #'fuel-eval-extended-region
|
||||||
|
"r" #'fuel-eval-region)
|
||||||
|
(:prefix ("h" . "help")
|
||||||
|
"p" #'fuel-apropos
|
||||||
|
"h" #'fuel-help
|
||||||
|
"b" #'fuel-help-display-bookmarks
|
||||||
|
"v" #'fuel-help-vocab
|
||||||
|
"w" #'fuel-show-file-words
|
||||||
|
"c" #'fuel-show-callees
|
||||||
|
"e" #'fuel-stack-effect-region
|
||||||
|
"s" #'fuel-stack-effect-sexp)
|
||||||
|
(:prefix ("s" . "scaffold")
|
||||||
|
"v" #'fuel-scaffold-vocab
|
||||||
|
"h" #'fuel-scaffold-help
|
||||||
|
"t" #'fuel-scaffold-tests)
|
||||||
|
(:prefix ("r" . "refactor")
|
||||||
|
"s" #'fuel-refactor-extract-sexp
|
||||||
|
"w" #'fuel-refactor-extract-region
|
||||||
|
"v" #'fuel-refactor-extract-vocab
|
||||||
|
"i" #'fuel-refactor-inline-word
|
||||||
|
"g" #'fuel-refactor-make-generic
|
||||||
|
"u" #'fuel-update-usings
|
||||||
|
"r" #'fuel-refactor-rename-word)))
|
||||||
:config
|
:config
|
||||||
(set-lookup-handlers! 'factor-mode
|
(set-popup-rules!
|
||||||
:definition #'fuel-edit-word-at-point
|
'(("^\\*fuel \\(debug\\|xref\\|messages\\)\\*$" :slot 1 :vslot -1)
|
||||||
:references #'fuel-show-callers
|
("^\\*fuel help\\*$" :slot 2 :vslot 2 :select t :size 0.35)
|
||||||
:documentation #'fuel-help))
|
("^\\*fuel listener\\*$" :size 0.3 :quit nil :ttl nil)))
|
||||||
|
|
||||||
(map! :after fuel-help
|
(map! :after fuel-help
|
||||||
:map fuel-help-mode-map
|
:map fuel-help-mode-map
|
||||||
:localleader
|
:localleader
|
||||||
"e" #'fuel-help-edit
|
"e" #'fuel-help-edit
|
||||||
"d" #'fuel-help-delete-bookmark
|
"d" #'fuel-help-delete-bookmark
|
||||||
"B" #'fuel-help-display-bookmarks
|
"B" #'fuel-help-display-bookmarks
|
||||||
"n" #'fuel-help-next
|
"n" #'fuel-help-next
|
||||||
"d" #'fuel-help-kill-page
|
"d" #'fuel-help-kill-page
|
||||||
"p" #'fuel-help-previous
|
"p" #'fuel-help-previous
|
||||||
"b" #'fuel-help-bookmark-page
|
"b" #'fuel-help-bookmark-page
|
||||||
"e" #'fuel-help-edit)
|
"e" #'fuel-help-edit)
|
||||||
|
|
||||||
(map! :after factor-mode
|
(map! :after fuel-listener
|
||||||
:map factor-mode-map
|
:map fuel-listener-mode-map
|
||||||
:localleader
|
:localleader
|
||||||
"t" #'fuel-test-vocab
|
"b" #'fuel-switch-to-buffer
|
||||||
"F" #'fuel-run-file
|
"w" #'fuel-switch-to-buffer-other-window
|
||||||
"f" #'run-factor
|
"f" #'fuel-switch-to-buffer-other-frame
|
||||||
"a" #'fuel-refresh-all
|
"e" #'fuel-edit-vocabulary
|
||||||
"L" #'fuel-load-usings
|
"r" #'fuel-refresh-all
|
||||||
"u" #'fuel-vocab-usage
|
"i" #'fuel-stack-mode
|
||||||
"U" #'fuel-vocab-uses
|
"h" #'fuel-help
|
||||||
(:prefix ("c" . "change")
|
"s" #'fuel-scaffold-vocab))
|
||||||
"w" #'fuel-edit-word-at-point
|
|
||||||
"d" #'fuel-edit-word-doc-at-point
|
|
||||||
"v" #'fuel-edit-vocabulary)
|
|
||||||
(:prefix ("e" . "eval")
|
|
||||||
"d" #'fuel-eval-definition
|
|
||||||
"R" #'fuel-eval-extended-region
|
|
||||||
"r" #'fuel-eval-region)
|
|
||||||
(:prefix ("h" . "help")
|
|
||||||
"p" #'fuel-apropos
|
|
||||||
"h" #'fuel-help
|
|
||||||
"b" #'fuel-help-display-bookmarks
|
|
||||||
"v" #'fuel-help-vocab
|
|
||||||
"w" #'fuel-show-file-words
|
|
||||||
"c" #'fuel-show-callees
|
|
||||||
"e" #'fuel-stack-effect-region
|
|
||||||
"s" #'fuel-stack-effect-sexp)
|
|
||||||
(:prefix ("s" . "scaffold")
|
|
||||||
"v" #'fuel-scaffold-vocab
|
|
||||||
"h" #'fuel-scaffold-help
|
|
||||||
"t" #'fuel-scaffold-tests)
|
|
||||||
(:prefix ("r" . "refactor")
|
|
||||||
"s" #'fuel-refactor-extract-sexp
|
|
||||||
"w" #'fuel-refactor-extract-region
|
|
||||||
"v" #'fuel-refactor-extract-vocab
|
|
||||||
"i" #'fuel-refactor-inline-word
|
|
||||||
"g" #'fuel-refactor-make-generic
|
|
||||||
"u" #'fuel-update-usings
|
|
||||||
"r" #'fuel-refactor-rename-word))
|
|
||||||
|
|
||||||
(map! :after fuel-listener
|
|
||||||
:map fuel-listener-mode-map
|
|
||||||
:localleader
|
|
||||||
"b" #'fuel-switch-to-buffer
|
|
||||||
"w" #'fuel-switch-to-buffer-other-window
|
|
||||||
"f" #'fuel-switch-to-buffer-other-frame
|
|
||||||
"e" #'fuel-edit-vocabulary
|
|
||||||
"r" #'fuel-refresh-all
|
|
||||||
"i" #'fuel-stack-mode
|
|
||||||
"h" #'fuel-help
|
|
||||||
"s" #'fuel-scaffold-vocab)
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; lang/factor/packages.el
|
;;; lang/factor/packages.el
|
||||||
|
|
||||||
(package! fuel :pin "23fcfc70753abbbdc0e86af06330d63da6e4ea64")
|
(package! fuel :pin "12fc9d5071e46cac7b558204db5f4f09ea56e9c7")
|
||||||
|
|
|
@ -91,7 +91,7 @@ query GetContinents($continentCode: String!) {
|
||||||
With this module, there are 3 ways to view schemas:
|
With this module, there are 3 ways to view schemas:
|
||||||
+ =+graphql-doc-open-config= which uses a local [[https://github.com/jimkyndemeyer/graphql-config-examples][=.graphqlconfig=]] file to seed endpoints to query
|
+ =+graphql-doc-open-config= which uses a local [[https://github.com/jimkyndemeyer/graphql-config-examples][=.graphqlconfig=]] file to seed endpoints to query
|
||||||
+ =graphql-doc= which prompts you to select an endpoint based on ones added manually by =graphql-doc-add-api=
|
+ =graphql-doc= which prompts you to select an endpoint based on ones added manually by =graphql-doc-add-api=
|
||||||
+ =graphql-doc-open-url= which prompts to to manually enter an endpoint url
|
+ =graphql-doc-open-url= which prompts to manually enter an endpoint url
|
||||||
|
|
||||||
When using the doc viewer, there are a few bindings for navigating around.
|
When using the doc viewer, there are a few bindings for navigating around.
|
||||||
|
|
||||||
|
|
|
@ -20,22 +20,23 @@ This module adds support for [[https://julialang.org/][the Julia language]] to D
|
||||||
- +tree-sitter ::
|
- +tree-sitter ::
|
||||||
Leverages tree-sitter for better syntax highlighting and structural text
|
Leverages tree-sitter for better syntax highlighting and structural text
|
||||||
editing. Requires [[doom-module::tools tree-sitter]].
|
editing. Requires [[doom-module::tools tree-sitter]].
|
||||||
- +snail :: Use Snail, a development environment and REPL interaction package
|
- +snail ::
|
||||||
for Julia in the spirit of Common Lisp’s SLIME and Clojure’s CIDER. It enables
|
Use Snail, a development environment and REPL interaction package for Julia in
|
||||||
convenient and dynamic REPL-driven development.
|
the spirit of Common Lisp’s SLIME and Clojure’s CIDER. It enables convenient
|
||||||
|
and dynamic REPL-driven development.
|
||||||
|
|
||||||
** Packages
|
** Packages
|
||||||
- [[doom-package:julia-mode]]
|
- [[doom-package:julia-mode]]
|
||||||
- [[doom-package:julia-repl]]
|
- [[doom-package:julia-repl]]
|
||||||
- if [[doom-package:+lsp]]
|
- if [[doom-module:+lsp]]
|
||||||
- if [[doom-module::tools lsp]]
|
- if [[doom-module::tools lsp]]
|
||||||
- [[doom-package:lsp-julia]]
|
- [[doom-package:lsp-julia]]
|
||||||
- [[doom-package:lsp]]
|
- [[doom-package:lsp]]
|
||||||
- if [[doom-module::tools lsp +eglot]]
|
- if [[doom-module::tools lsp +eglot]]
|
||||||
- [[doom-package:eglot-jl]]
|
- [[doom-package:eglot-jl]]
|
||||||
- [[doom-package:eglot]]
|
- [[doom-package:eglot]]
|
||||||
- if [[doom-package:][+snail]]
|
- if [[doom-module:+snail]]
|
||||||
- [[doom-package:][julia-snail]]
|
- [[doom-package:julia-snail]]
|
||||||
|
|
||||||
** Hacks
|
** Hacks
|
||||||
/No hacks documented for this module./
|
/No hacks documented for this module./
|
||||||
|
@ -63,8 +64,8 @@ Pkg.add("LanguageServer")
|
||||||
Pkg.add("SymbolServer")
|
Pkg.add("SymbolServer")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Then configure [[doom-package:lsp-julia]] or [[doom-package:eglot-jl]] depending on whether you have enabled
|
Then configure [[doom-package:lsp-julia]] or [[doom-package:eglot-jl]] depending on whether you have enabled [[doom-module::tools
|
||||||
[[doom-module::tools lsp]] or [[doom-module::tools lsp +eglot]], respectively:
|
lsp]] or [[doom-module::tools lsp +eglot]], respectively:
|
||||||
|
|
||||||
*** =lsp-julia=
|
*** =lsp-julia=
|
||||||
To instruct [[doom-package:lsp-julia]] not to use the built-in package:
|
To instruct [[doom-package:lsp-julia]] not to use the built-in package:
|
||||||
|
|
|
@ -53,7 +53,8 @@
|
||||||
:hook (+julia-repl-start . +julia-override-repl-escape-char-h)
|
:hook (+julia-repl-start . +julia-override-repl-escape-char-h)
|
||||||
:hook (+julia-repl-start . julia-repl-use-emacsclient)
|
:hook (+julia-repl-start . julia-repl-use-emacsclient)
|
||||||
:config
|
:config
|
||||||
(set-popup-rule! "^\\*julia.*\\*$" :ttl nil)
|
(unless (modulep! +snail)
|
||||||
|
(set-popup-rule! "^\\*julia.*\\*$" :ttl nil))
|
||||||
|
|
||||||
(when (modulep! :ui workspaces)
|
(when (modulep! :ui workspaces)
|
||||||
(defadvice! +julia--namespace-repl-buffer-to-workspace-a (&optional executable-key suffix)
|
(defadvice! +julia--namespace-repl-buffer-to-workspace-a (&optional executable-key suffix)
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; lang/julia/packages.el
|
;;; lang/julia/packages.el
|
||||||
|
|
||||||
(package! julia-mode :pin "7a8c868e0d3e51ba4a2c621ee22ca9599e0e4bbb")
|
(package! julia-mode :pin "2dfc869ff6b3878407fe7226669dfaae8d38d541")
|
||||||
(package! julia-repl :pin "4947319bc948b3f80d61b0d65a719737275949b8")
|
(package! julia-repl :pin "4947319bc948b3f80d61b0d65a719737275949b8")
|
||||||
|
|
||||||
(when (modulep! +lsp)
|
(when (modulep! +lsp)
|
||||||
(if (modulep! :tools lsp +eglot)
|
(if (modulep! :tools lsp +eglot)
|
||||||
(package! eglot-jl :pin "7dc604fe42a459a987853d065cd6d0f3c4cbc02a")
|
(package! eglot-jl :pin "1d9cab682380f37ca1e9e9933cda13164600706d")
|
||||||
(package! lsp-julia :pin "c869b2f6c05a97e5495ed3cc6710a33b4faf41a2")))
|
(package! lsp-julia :pin "c869b2f6c05a97e5495ed3cc6710a33b4faf41a2")))
|
||||||
|
|
||||||
(when (modulep! +snail)
|
(when (modulep! +snail)
|
||||||
(package! julia-snail :pin "d36653bb938050cfabbe3c1ea6d4575071085577"))
|
(package! julia-snail :pin "a25ce847480a0c2bed24fad3f1ee62904c9c93a5"))
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
:interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
|
:interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
|
||||||
:mode "\\.nix\\'"
|
:mode "\\.nix\\'"
|
||||||
:init
|
:init
|
||||||
;; Treat flake.lock files as json. Fall back to js-mode because it's faster
|
|
||||||
;; than js2-mode, and its extra features aren't needed there.
|
|
||||||
(add-to-list 'auto-mode-alist
|
(add-to-list 'auto-mode-alist
|
||||||
(cons "/flake\\.lock\\'"
|
(cons "/flake\\.lock\\'"
|
||||||
(if (modulep! :lang json)
|
(if (modulep! :lang json)
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
(cond ((and (string-prefix-p "jupyter-" lang)
|
(cond ((and (string-prefix-p "jupyter-" lang)
|
||||||
(require 'jupyter nil t))
|
(require 'jupyter nil t))
|
||||||
(jupyter-eval-region beg end))
|
(jupyter-eval-region beg end))
|
||||||
((let ((major-mode (org-src-get-lang-mode lang)))
|
((+eval-region-as-major-mode beg end (org-src-get-lang-mode lang))))))))
|
||||||
(+eval/region beg end))))))))
|
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
@ -1188,7 +1188,7 @@ between the two."
|
||||||
:hook (org-mode . org-eldoc-load)
|
:hook (org-mode . org-eldoc-load)
|
||||||
:init (setq org-eldoc-breadcrumb-separator " → ")
|
:init (setq org-eldoc-breadcrumb-separator " → ")
|
||||||
:config
|
:config
|
||||||
;; HACK Fix #2972: infinite recursion when eldoc kicks in in 'org' or 'python'
|
;; HACK Fix #2972: infinite recursion when eldoc kicks in 'org' or 'python'
|
||||||
;; src blocks.
|
;; src blocks.
|
||||||
;; TODO Should be reported upstream!
|
;; TODO Should be reported upstream!
|
||||||
(puthash "org" #'ignore org-eldoc-local-functions-cache)
|
(puthash "org" #'ignore org-eldoc-local-functions-cache)
|
||||||
|
|
|
@ -54,35 +54,4 @@
|
||||||
(lambda (path)
|
(lambda (path)
|
||||||
(if (file-in-directory-p path org-download-image-dir)
|
(if (file-in-directory-p path org-download-image-dir)
|
||||||
(file-relative-name path org-download-image-dir)
|
(file-relative-name path org-download-image-dir)
|
||||||
path)))
|
path))))
|
||||||
|
|
||||||
(defadvice! +org--fix-org-download-delete-a (fn beg end &optional times)
|
|
||||||
"Fix `org-download-delete' for a non-standard `org-download-link-format'."
|
|
||||||
:around #'org-download--delete
|
|
||||||
(save-excursion
|
|
||||||
(save-match-data
|
|
||||||
(goto-char beg)
|
|
||||||
(let ((times (or times most-positive-fixnum))
|
|
||||||
(linkname
|
|
||||||
(or (and (string-match "\\[\\[\\(\\w+\\):" org-download-link-format)
|
|
||||||
(match-string 1 org-download-link-format))
|
|
||||||
"file")))
|
|
||||||
(while (and (>= (cl-decf times) 0)
|
|
||||||
(re-search-forward (format "\\[\\[%s:\\([^]]*\\)\\]\\]"
|
|
||||||
(regexp-quote linkname))
|
|
||||||
end t))
|
|
||||||
(let ((str (match-string-no-properties 2)))
|
|
||||||
(delete-region beg (match-end 0))
|
|
||||||
(when (file-exists-p str)
|
|
||||||
(delete-file str))))))))
|
|
||||||
|
|
||||||
(defadvice! +org--dragndrop-then-display-inline-images-a (_link filename)
|
|
||||||
:after #'org-download-insert-link
|
|
||||||
(when (image-type-from-file-name filename)
|
|
||||||
(save-excursion
|
|
||||||
(org-display-inline-images
|
|
||||||
t t
|
|
||||||
(progn (org-back-to-heading-or-point-min t) (point))
|
|
||||||
(progn (org-end-of-subtree t t)
|
|
||||||
(when (and (org-at-heading-p) (not (eobp))) (backward-char 1))
|
|
||||||
(point)))))))
|
|
||||||
|
|
|
@ -31,25 +31,25 @@
|
||||||
(format "(defun org-git-version (&rest _) \"%s-??-%s\")\n"
|
(format "(defun org-git-version (&rest _) \"%s-??-%s\")\n"
|
||||||
version (cdr (doom-call-process "git" "rev-parse" "--short" "HEAD")))
|
version (cdr (doom-call-process "git" "rev-parse" "--short" "HEAD")))
|
||||||
"(provide 'org-version)\n")))))
|
"(provide 'org-version)\n")))))
|
||||||
:pin "7a6bb0904d01b50680f9028f7c0f3cfc6ae3aa6e")
|
:pin "e9c288dfaccc2960e5b6889e6aabea700ad4e05a")
|
||||||
(package! org-contrib
|
(package! org-contrib
|
||||||
:recipe (:host github
|
:recipe (:host github
|
||||||
:repo "emacsmirror/org-contrib")
|
:repo "emacsmirror/org-contrib")
|
||||||
:pin "8fbaceb247a775ad1534af97859c740e82cc955a")
|
:pin "d4056ce5d5611e1c971c151f182a2d407226fdb1")
|
||||||
|
|
||||||
(package! avy)
|
(package! avy)
|
||||||
(package! htmlize :pin "dd27bc3f26efd728f2b1f01f9e4ac4f61f2ffbf9")
|
(package! htmlize :pin "09d43dfa44899f194095bb3500a45ec5b34d59c6")
|
||||||
(package! org-yt
|
(package! org-yt
|
||||||
:recipe (:host github :repo "TobiasZawada/org-yt")
|
:recipe (:host github :repo "TobiasZawada/org-yt")
|
||||||
:pin "56166f48e04d83668f70ed84706b7a4d8b1e5438")
|
:pin "56166f48e04d83668f70ed84706b7a4d8b1e5438")
|
||||||
(package! ox-clip :pin "ff117cf3c619eef12eccc0ccbfa3f11adb73ea68")
|
(package! ox-clip :pin "a549cc8e1747beb6b7e567ffac27e31ba45cb8e8")
|
||||||
(package! toc-org :pin "6d3ae0fc47ce79b1ea06cabe21a3c596395409cd")
|
(package! toc-org :pin "6d3ae0fc47ce79b1ea06cabe21a3c596395409cd")
|
||||||
(package! org-cliplink :pin "13e0940b65d22bec34e2de4bc8cba1412a7abfbc")
|
(package! org-cliplink :pin "13e0940b65d22bec34e2de4bc8cba1412a7abfbc")
|
||||||
|
|
||||||
;; TODO Adjust when this is added to GNU ELPA
|
;; TODO Adjust when this is added to GNU ELPA
|
||||||
(when (modulep! +contacts)
|
(when (modulep! +contacts)
|
||||||
(package! org-contacts
|
(package! org-contacts
|
||||||
:pin "7f03eafaad2e5746949c0bebb98353e939c51ade"
|
:pin "6660db078f7687af3bc31f702e3e957d4d7654bd"
|
||||||
:recipe (:host nil
|
:recipe (:host nil
|
||||||
:type git
|
:type git
|
||||||
:repo "https://repo.or.cz/org-contacts.git")))
|
:repo "https://repo.or.cz/org-contacts.git")))
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
(when (modulep! :tools pdf)
|
(when (modulep! :tools pdf)
|
||||||
(package! org-pdftools :pin "4e420233a153a9c4ab3d1a7e1d7d3211c836f0ac"))
|
(package! org-pdftools :pin "4e420233a153a9c4ab3d1a7e1d7d3211c836f0ac"))
|
||||||
(when (modulep! :tools magit)
|
(when (modulep! :tools magit)
|
||||||
(package! orgit :pin "84bcb5c318f01b9ffc8d5aa18a7c393fe9c714b2")
|
(package! orgit :pin "a57beefa24712430fe6b5016b9273129931a8287")
|
||||||
(when (modulep! :tools magit +forge)
|
(when (modulep! :tools magit +forge)
|
||||||
(package! orgit-forge :pin "f2ff9e5ad68b3e860379a1d368ad6d8a9696b719")))
|
(package! orgit-forge :pin "f2ff9e5ad68b3e860379a1d368ad6d8a9696b719")))
|
||||||
(when (modulep! +brain)
|
(when (modulep! +brain)
|
||||||
|
@ -84,11 +84,11 @@
|
||||||
(when (modulep! +ipython) ; DEPRECATED
|
(when (modulep! +ipython) ; DEPRECATED
|
||||||
(package! ob-ipython :pin "7147455230841744fb5b95dcbe03320313a77124"))
|
(package! ob-ipython :pin "7147455230841744fb5b95dcbe03320313a77124"))
|
||||||
(when (modulep! +jupyter)
|
(when (modulep! +jupyter)
|
||||||
(package! jupyter :pin "da306a6dbda6f1e285281765a311938a1d9db022"))
|
(package! jupyter :pin "2059d79b2fecf6d25a6c796b69ab954645ec37d1"))
|
||||||
(when (modulep! +journal)
|
(when (modulep! +journal)
|
||||||
(package! org-journal :pin "605a7eb984a95fc6ec122df800632bf56ff59514"))
|
(package! org-journal :pin "17b34ce8df9649a73b715c13698220bde1628668"))
|
||||||
(when (modulep! +noter)
|
(when (modulep! +noter)
|
||||||
(package! org-noter :pin "8be376384772c1f053cb2ce907ddf4d484b390dd"))
|
(package! org-noter :pin "9e4f57957b8f54db20a4e13bf8d6b32e004ab3e8"))
|
||||||
(when (modulep! +pomodoro)
|
(when (modulep! +pomodoro)
|
||||||
(package! org-pomodoro :pin "3f5bcfb80d61556d35fc29e5ddb09750df962cc6"))
|
(package! org-pomodoro :pin "3f5bcfb80d61556d35fc29e5ddb09750df962cc6"))
|
||||||
(when (modulep! +pretty)
|
(when (modulep! +pretty)
|
||||||
|
@ -100,11 +100,11 @@
|
||||||
:recipe (:host github :repo "anler/centered-window-mode")
|
:recipe (:host github :repo "anler/centered-window-mode")
|
||||||
:pin "80965f6c6afe8d918481433984b493de72af5399")
|
:pin "80965f6c6afe8d918481433984b493de72af5399")
|
||||||
(package! org-tree-slide :pin "e2599a106a26ce5511095e23df4ea04be6687a8a")
|
(package! org-tree-slide :pin "e2599a106a26ce5511095e23df4ea04be6687a8a")
|
||||||
(package! org-re-reveal :pin "7c39d15b841c7a8d197a24c89e5fef5d54e271aa")
|
(package! org-re-reveal :pin "1944ac53d4cdd0fb250cc575447d5e6320fd5f81")
|
||||||
(package! revealjs
|
(package! revealjs
|
||||||
:recipe (:host github :repo "hakimel/reveal.js"
|
:recipe (:host github :repo "hakimel/reveal.js"
|
||||||
:files ("css" "dist" "js" "plugin"))
|
:files ("css" "dist" "js" "plugin"))
|
||||||
:pin "16f6633014672567de85aefd1f4639ffea0dde56"))
|
:pin "6410c756ea91ded3fa5f6b40a872523e7b8fe723"))
|
||||||
(cond
|
(cond
|
||||||
((modulep! +roam)
|
((modulep! +roam)
|
||||||
(package! org-roam
|
(package! org-roam
|
||||||
|
@ -162,6 +162,6 @@
|
||||||
(when (modulep! +hugo)
|
(when (modulep! +hugo)
|
||||||
(package! ox-hugo
|
(package! ox-hugo
|
||||||
:recipe (:host github :repo "kaushalmodi/ox-hugo" :nonrecursive t)
|
:recipe (:host github :repo "kaushalmodi/ox-hugo" :nonrecursive t)
|
||||||
:pin "cb1b6cfd7b080e889352150416c1725f11ba937a"))
|
:pin "c4156d9d383bf97853ba9e16271b7c4d5e697f49"))
|
||||||
(when (modulep! :lang rst)
|
(when (modulep! :lang rst)
|
||||||
(package! ox-rst :pin "99fa790da55b57a3f2e9aa187493ba434a64250e"))
|
(package! ox-rst :pin "99fa790da55b57a3f2e9aa187493ba434a64250e"))
|
||||||
|
|
|
@ -48,7 +48,36 @@
|
||||||
(if (modulep! :tools lsp +eglot)
|
(if (modulep! :tools lsp +eglot)
|
||||||
'eglot
|
'eglot
|
||||||
'lsp-mode))
|
'lsp-mode))
|
||||||
(add-hook 'rustic-mode-local-vars-hook #'rustic-setup-lsp 'append))
|
(add-hook 'rustic-mode-local-vars-hook #'rustic-setup-lsp 'append)
|
||||||
|
|
||||||
|
;; HACK: Add @scturtle fix for signatures on hover on LSP mode. This code
|
||||||
|
;; has not been upstreamed because it depends on the exact format of the
|
||||||
|
;; response of Rust Analyzer, which is not stable enough for `lsp-mode'
|
||||||
|
;; maintainers (see emacs-lsp/lsp-mode#1740).
|
||||||
|
(unless (modulep! :tools lsp +eglot)
|
||||||
|
(defadvice! +rust--dont-cache-results-from-ra-a (fn &rest args)
|
||||||
|
:after #'lsp-eldoc-function
|
||||||
|
(when (derived-mode-p 'rust-mode 'rust-ts-mode)
|
||||||
|
(setq lsp--hover-saved-bounds nil)))
|
||||||
|
|
||||||
|
;; extract and show short signature for rust-analyzer
|
||||||
|
(cl-defmethod lsp-clients-extract-signature-on-hover (contents (_server-id (eql rust-analyzer)))
|
||||||
|
(let* ((value (if lsp-use-plists (plist-get contents :value) (gethash "value" contents)))
|
||||||
|
(groups (--partition-by (s-blank? it) (s-lines (s-trim value))))
|
||||||
|
(mod-group (cond ((s-equals? "```rust" (car (-fifth-item groups))) (-third-item groups))
|
||||||
|
((s-equals? "```rust" (car (-third-item groups))) (-first-item groups))
|
||||||
|
(t nil)))
|
||||||
|
(cmt (if (null mod-group) "" (concat " // " (cadr mod-group))))
|
||||||
|
(sig-group (cond ((s-equals? "```rust" (car (-fifth-item groups))) (-fifth-item groups))
|
||||||
|
((s-equals? "```rust" (car (-third-item groups))) (-third-item groups))
|
||||||
|
(t (-first-item groups))))
|
||||||
|
(sig (->> sig-group
|
||||||
|
(--drop-while (s-equals? "```rust" it))
|
||||||
|
(--take-while (not (s-equals? "```" it)))
|
||||||
|
(--map (s-replace-regexp "//.*" "" it))
|
||||||
|
(--map (s-trim it))
|
||||||
|
(s-join " "))))
|
||||||
|
(lsp--render-element (concat "```rust\n" sig cmt "\n```"))))))
|
||||||
|
|
||||||
(when (modulep! +tree-sitter)
|
(when (modulep! +tree-sitter)
|
||||||
(add-hook 'rustic-mode-local-vars-hook #'tree-sitter! 'append))
|
(add-hook 'rustic-mode-local-vars-hook #'tree-sitter! 'append))
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; lang/scala/packages.el
|
;;; lang/scala/packages.el
|
||||||
|
|
||||||
(package! sbt-mode :pin "9fe1e8807c22cc1dc56a6233e000969518907f4d")
|
(package! sbt-mode :pin "cc68728a6ef0600aad369157b3a2d0ce56afba9b")
|
||||||
(package! scala-mode :pin "4c6d636b86e3bb1d95de819dc48dda92abdfbcf4")
|
(package! scala-mode :pin "4c6d636b86e3bb1d95de819dc48dda92abdfbcf4")
|
||||||
|
|
||||||
(when (and (modulep! +lsp)
|
(when (and (modulep! +lsp)
|
||||||
(not (modulep! :tools lsp +eglot)))
|
(not (modulep! :tools lsp +eglot)))
|
||||||
(package! lsp-metals :pin "da7e54ed65f4e153c94b9c54689908dce142ef37"))
|
(package! lsp-metals :pin "e55d544996f7321622e1eeafdc3dd128f8e72ce5"))
|
||||||
|
|
|
@ -8,7 +8,8 @@ be aligned.
|
||||||
|
|
||||||
If set to `nil', disable all the above behaviors.")
|
If set to `nil', disable all the above behaviors.")
|
||||||
|
|
||||||
(add-to-list 'find-sibling-rules '("/\\([^/]+\\)\\.\\(\\(s[ac]\\|le\\)ss\\|styl\\)\\'" "\\1\\.css"))
|
(add-to-list 'find-sibling-rules '("/\\([^/]+\\)\\.\\(\\(s[ac]\\|le\\)ss\\|styl\\)\\'" "\\1\\.css\\'"))
|
||||||
|
(add-to-list 'find-sibling-rules '("/\\([^/]+\\)\\.css\\'" "\\1\\.\\(\\(s[ac]\\|le\\)ss\\|styl\\)\\'"))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; term/eshell/packages.el
|
;;; term/eshell/packages.el
|
||||||
|
|
||||||
(package! eshell-up :pin "ff84e6069b98f2ed00857a0f78bff19d96e4955c")
|
(package! eshell-up :pin "1999afaa509204b780db44e99ac9648fe7d92d32")
|
||||||
(package! eshell-z :pin "337cb241e17bd472bd3677ff166a0800f684213c")
|
(package! eshell-z :pin "337cb241e17bd472bd3677ff166a0800f684213c")
|
||||||
(package! shrink-path :pin "c14882c8599aec79a6e8ef2d06454254bb3e1e41")
|
(package! shrink-path :pin "c14882c8599aec79a6e8ef2d06454254bb3e1e41")
|
||||||
(package! esh-help :pin "417673ed18a983930a66a6692dbfb288a995cb80")
|
(package! esh-help :pin "417673ed18a983930a66a6692dbfb288a995cb80")
|
||||||
(package! eshell-did-you-mean :pin "80cd8c4b186a2fb29621cf634bcf2bcd914f1e3d")
|
(package! eshell-did-you-mean :pin "80cd8c4b186a2fb29621cf634bcf2bcd914f1e3d")
|
||||||
(package! eshell-syntax-highlighting :pin "4ac27eec6595ba116a6151dfaf0b0e0440101e10")
|
(package! eshell-syntax-highlighting :pin "1d25386bf7d1a97e083d33750a98fbd1c6598138")
|
||||||
|
|
||||||
(unless (featurep :system 'windows)
|
(unless (featurep :system 'windows)
|
||||||
(package! fish-completion :pin "d34d0b96fde63feedf13c4288183d8d4d4d748cf")
|
(package! fish-completion :pin "006c613ff7f846b7d0a14422f2bdcc28b21205b8")
|
||||||
(package! bash-completion :pin "f1daac0386c24cbe8a244a62c7588cc6847b07ae"))
|
(package! bash-completion :pin "f1daac0386c24cbe8a244a62c7588cc6847b07ae"))
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/ansible/packages.el
|
;;; tools/ansible/packages.el
|
||||||
|
|
||||||
(package! ansible :recipe (:nonrecursive t) :pin "d89ac0ee57742cca0f0e0a3453d9dcc521575690")
|
(package! ansible :recipe (:nonrecursive t) :pin "1d7de8d3ddac980715eebd87ee66859f8665b101")
|
||||||
(package! ansible-doc :pin "86083a7bb2ed0468ca64e52076b06441a2f8e9e0")
|
(package! ansible-doc :pin "86083a7bb2ed0468ca64e52076b06441a2f8e9e0")
|
||||||
(package! jinja2-mode :pin "03e5430a7efe1d163a16beaf3c82c5fd2c2caee1")
|
(package! jinja2-mode :pin "03e5430a7efe1d163a16beaf3c82c5fd2c2caee1")
|
||||||
(package! yaml-mode :pin "5b58248ab255dff6cfa4c4057a191bc4446ee5b6")
|
(package! yaml-mode :pin "7b5ce294fb15c2c8926fa476d7218aa415550a2a")
|
||||||
|
|
||||||
(when (modulep! :completion company)
|
(when (modulep! :completion company)
|
||||||
(package! company-ansible :pin "79dd421b161efa49fbdffad57fa40edb41f484a3"))
|
(package! company-ansible :pin "338922601cf9e8ada863fe6f2dd9d5145d9983b0"))
|
||||||
|
|
|
@ -2,16 +2,16 @@
|
||||||
;;; tools/biblio/packages.el
|
;;; tools/biblio/packages.el
|
||||||
|
|
||||||
(when (modulep! :completion ivy)
|
(when (modulep! :completion ivy)
|
||||||
(package! bibtex-completion :pin "bf184cc311c9e1724f8b2eaf75b9e202c3aedd16")
|
(package! bibtex-completion :pin "8b71b4f5ce62eeaf18067f57faaddc06449fbe1c")
|
||||||
(package! ivy-bibtex :pin "bf184cc311c9e1724f8b2eaf75b9e202c3aedd16"))
|
(package! ivy-bibtex :pin "8b71b4f5ce62eeaf18067f57faaddc06449fbe1c"))
|
||||||
(when (modulep! :completion helm)
|
(when (modulep! :completion helm)
|
||||||
(package! bibtex-completion :pin "bf184cc311c9e1724f8b2eaf75b9e202c3aedd16")
|
(package! bibtex-completion :pin "8b71b4f5ce62eeaf18067f57faaddc06449fbe1c")
|
||||||
(package! helm-bibtex :pin "bf184cc311c9e1724f8b2eaf75b9e202c3aedd16"))
|
(package! helm-bibtex :pin "8b71b4f5ce62eeaf18067f57faaddc06449fbe1c"))
|
||||||
(when (modulep! :completion vertico)
|
(when (modulep! :completion vertico)
|
||||||
(package! citar :pin "885b86f6733fd70f42c32dd7791d3447f93db990")
|
(package! citar :pin "885b86f6733fd70f42c32dd7791d3447f93db990")
|
||||||
(package! citar-embark :pin "885b86f6733fd70f42c32dd7791d3447f93db990")
|
(package! citar-embark :pin "885b86f6733fd70f42c32dd7791d3447f93db990")
|
||||||
(when (modulep! :lang org +roam2)
|
(when (modulep! :lang org +roam2)
|
||||||
(package! citar-org-roam :pin "7d67dccf80065a88cb86ce9a8274383a9e8269c1")))
|
(package! citar-org-roam :pin "82d47b5df1926627f56a09055c69b49b31cbbb9f")))
|
||||||
|
|
||||||
(package! parsebib :pin "ace9df707108b17759c004c7387655277122d4c1")
|
(package! parsebib :pin "ace9df707108b17759c004c7387655277122d4c1")
|
||||||
(package! citeproc :pin "c61c98b9d230ea28b2ca49498134803e1f8ea526")
|
(package! citeproc :pin "44f90cb296766e03fffc28b7892521ab0e8709f1")
|
||||||
|
|
|
@ -6,5 +6,5 @@
|
||||||
(package! realgud-trepan-ni :pin "0ec088ea343835e24ae73da09bea96bfb02a3130")))
|
(package! realgud-trepan-ni :pin "0ec088ea343835e24ae73da09bea96bfb02a3130")))
|
||||||
|
|
||||||
(when (modulep! +lsp)
|
(when (modulep! +lsp)
|
||||||
(package! dap-mode :pin "2f0c5b28578ce65ec746e4084ba72ba5c652ea79")
|
(package! dap-mode :pin "c95537c58e8f3ceac9c827ddf89e4928b24a1cc7")
|
||||||
(package! posframe :pin "017deece88360c7297265680d78a0bb316470716"))
|
(package! posframe :pin "017deece88360c7297265680d78a0bb316470716"))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/direnv/packages.el
|
;;; tools/direnv/packages.el
|
||||||
|
|
||||||
(package! envrc :pin "1385e72a730924664697a0961d43516a47a977d7")
|
(package! envrc :pin "8eb7401700b0080902ce200ad610ff8d2f2dcc27")
|
||||||
|
|
|
@ -95,14 +95,8 @@ C-x C-f /docker:$USER@$CONTAINER:/path/to/file
|
||||||
Thanks to [[https://github.com/magit/magit-popup][magit-popup]], all the popups default arguments can be customized. For
|
Thanks to [[https://github.com/magit/magit-popup][magit-popup]], all the popups default arguments can be customized. For
|
||||||
example, here is how to customize the arguments for =docker-image-run-popup=:
|
example, here is how to customize the arguments for =docker-image-run-popup=:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq docker-image-run-arguments '("-i" "-t" "--rm"))
|
(after! docker
|
||||||
#+end_src
|
(setq docker-image-run-arguments '("-i" "-t" "--rm")))
|
||||||
|
|
||||||
or inside a =use-package= declaration:
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package! docker
|
|
||||||
:bind ("C-c d" . docker)
|
|
||||||
:custom (docker-image-run-arguments '("-i" "-t" "--rm")))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Other useful variables
|
*** Other useful variables
|
||||||
|
|
|
@ -5,4 +5,4 @@
|
||||||
;; tramp-container (included with Emacs 29+) replaces docker-tramp
|
;; tramp-container (included with Emacs 29+) replaces docker-tramp
|
||||||
(when (< emacs-major-version 29)
|
(when (< emacs-major-version 29)
|
||||||
(package! docker-tramp :pin "19d0771db4e6b89e19c00af5806438e315779c15"))
|
(package! docker-tramp :pin "19d0771db4e6b89e19c00af5806438e315779c15"))
|
||||||
(package! dockerfile-mode :pin "52c6c00da1d31c0b6c29c74335b3af63ed6bf06c")
|
(package! dockerfile-mode :pin "39a012a27fcf6fb629c447d13b6974baf906714c")
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
|
|
||||||
(package! editorconfig
|
(package! editorconfig
|
||||||
:recipe (:nonrecursive t)
|
:recipe (:nonrecursive t)
|
||||||
:pin "c3666c093f3a2a80fb42e513bf0a10d597497c18")
|
:pin "d73b6392ded0476af93ec7ba75cca2909aa8d2dc")
|
||||||
|
|
|
@ -72,6 +72,38 @@
|
||||||
output source-buffer)
|
output source-buffer)
|
||||||
output)
|
output)
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +eval-region-as-major-mode (beg end &optional runner-major-mode)
|
||||||
|
"Evaluate a region between BEG and END and display the output.
|
||||||
|
|
||||||
|
Evaluate as in RUNNER-MAJOR-MODE. If RUNNER-MAJOR-MODE is nil, use major-mode
|
||||||
|
of the buffer instead."
|
||||||
|
(let ((load-file-name buffer-file-name)
|
||||||
|
(load-true-file-name
|
||||||
|
(or buffer-file-truename
|
||||||
|
(if buffer-file-name
|
||||||
|
(file-truename buffer-file-name))))
|
||||||
|
(runner-major-mode (or runner-major-mode major-mode)))
|
||||||
|
(cond ((if (fboundp '+eval--ensure-in-repl-buffer)
|
||||||
|
(ignore-errors
|
||||||
|
(get-buffer-window (or (+eval--ensure-in-repl-buffer)
|
||||||
|
t))))
|
||||||
|
(funcall (or (plist-get (cdr (alist-get runner-major-mode +eval-repls)) :send-region)
|
||||||
|
#'+eval/send-region-to-repl)
|
||||||
|
beg end))
|
||||||
|
((let (lang)
|
||||||
|
(if-let ((runner
|
||||||
|
(or (alist-get runner-major-mode +eval-runners)
|
||||||
|
(and (require 'quickrun nil t)
|
||||||
|
(equal (setq
|
||||||
|
lang (quickrun--command-key
|
||||||
|
(buffer-file-name (buffer-base-buffer))))
|
||||||
|
"emacs")
|
||||||
|
(alist-get 'emacs-lisp-mode +eval-runners)))))
|
||||||
|
(funcall runner beg end)
|
||||||
|
(let ((quickrun-option-cmdkey lang))
|
||||||
|
(quickrun-region beg end))))))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Commands
|
;;; Commands
|
||||||
|
@ -103,31 +135,7 @@
|
||||||
(defun +eval/region (beg end)
|
(defun +eval/region (beg end)
|
||||||
"Evaluate a region between BEG and END and display the output."
|
"Evaluate a region between BEG and END and display the output."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(let ((load-file-name buffer-file-name)
|
(+eval-region-as-major-mode beg end))
|
||||||
(load-true-file-name
|
|
||||||
(or buffer-file-truename
|
|
||||||
(if buffer-file-name
|
|
||||||
(file-truename buffer-file-name)))))
|
|
||||||
(cond ((and (fboundp '+eval--ensure-in-repl-buffer)
|
|
||||||
(ignore-errors
|
|
||||||
(get-buffer-window (or (+eval--ensure-in-repl-buffer)
|
|
||||||
t))))
|
|
||||||
(funcall (or (plist-get (cdr (alist-get major-mode +eval-repls)) :send-region)
|
|
||||||
#'+eval/send-region-to-repl)
|
|
||||||
beg end))
|
|
||||||
((let ((runner
|
|
||||||
(or (alist-get major-mode +eval-runners)
|
|
||||||
(and (require 'quickrun nil t)
|
|
||||||
(equal (setq
|
|
||||||
lang (quickrun--command-key
|
|
||||||
(buffer-file-name (buffer-base-buffer))))
|
|
||||||
"emacs")
|
|
||||||
(alist-get 'emacs-lisp-mode +eval-runners))))
|
|
||||||
lang)
|
|
||||||
(if runner
|
|
||||||
(funcall runner beg end)
|
|
||||||
(let ((quickrun-option-cmdkey lang))
|
|
||||||
(quickrun-region beg end))))))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +eval/line-or-region ()
|
(defun +eval/line-or-region ()
|
||||||
|
|
|
@ -50,7 +50,9 @@
|
||||||
|
|
||||||
(defun +eval-repl-known-repls ()
|
(defun +eval-repl-known-repls ()
|
||||||
"Yield the available repl functions as a list of symbols."
|
"Yield the available repl functions as a list of symbols."
|
||||||
(seq-uniq (mapcar (pcase-lambda (`(,mode ,fn . _)) (list mode fn)) +eval-repls)))
|
(cl-delete-duplicates
|
||||||
|
(mapcar (lambda! ((mode fn &rest _)) (list mode fn))
|
||||||
|
+eval-repls)))
|
||||||
|
|
||||||
(defun +doom-pretty-mode-name (mode)
|
(defun +doom-pretty-mode-name (mode)
|
||||||
"Convert a mode name into a variant nicer for human eyes."
|
"Convert a mode name into a variant nicer for human eyes."
|
||||||
|
@ -82,15 +84,15 @@ human-readable variant of its associated major mode name."
|
||||||
|
|
||||||
(defun +eval-repl-prompt ()
|
(defun +eval-repl-prompt ()
|
||||||
"Prompt the user for the choice of a repl to open."
|
"Prompt the user for the choice of a repl to open."
|
||||||
(let* ((knowns (mapcar (pcase-lambda (`(,mode ,fn)) (list (+doom-pretty-mode-name mode) fn))
|
(let* ((knowns (mapcar (lambda! ((mode fn)) (list (+doom-pretty-mode-name mode) fn))
|
||||||
(+eval-repl-known-repls)))
|
(+eval-repl-known-repls)))
|
||||||
(founds (mapcar (lambda (fn) (list (+eval-pretty-mode-name-from-fn fn) fn))
|
(founds (mapcar (lambda (fn) (list (+eval-pretty-mode-name-from-fn fn) fn))
|
||||||
(+eval-repl-found-repls)))
|
(+eval-repl-found-repls)))
|
||||||
(repls (seq-uniq (append knowns founds)))
|
(repls (cl-delete-duplicates (append knowns founds)))
|
||||||
(names (mapcar #'cl-first repls))
|
(names (mapcar #'car repls))
|
||||||
(choice (or (completing-read "Open a REPL for: " names)
|
(choice (or (completing-read "Open a REPL for: " names)
|
||||||
(user-error "Aborting"))))
|
(user-error "Aborting"))))
|
||||||
(cl-second (assoc choice repls))))
|
(cadr (assoc choice repls))))
|
||||||
|
|
||||||
(defun +eval-repl-from-major-mode ()
|
(defun +eval-repl-from-major-mode ()
|
||||||
"Fetch the repl associated with the current major mode, if there
|
"Fetch the repl associated with the current major mode, if there
|
||||||
|
@ -103,8 +105,7 @@ is one."
|
||||||
prompted for a repl choice, even if the major mode they're in
|
prompted for a repl choice, even if the major mode they're in
|
||||||
already has a known one."
|
already has a known one."
|
||||||
(pcase-let* ((`(,fn ,plist) (+eval-repl-from-major-mode))
|
(pcase-let* ((`(,fn ,plist) (+eval-repl-from-major-mode))
|
||||||
(fn (cond ((or prompt-p (not fn)) (+eval-repl-prompt))
|
(fn (if (or prompt-p (not fn)) (+eval-repl-prompt) fn))
|
||||||
(t fn)))
|
|
||||||
(region (when (use-region-p)
|
(region (when (use-region-p)
|
||||||
(buffer-substring-no-properties (region-beginning)
|
(buffer-substring-no-properties (region-beginning)
|
||||||
(region-end)))))
|
(region-end)))))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/eval/packages.el
|
;;; tools/eval/packages.el
|
||||||
|
|
||||||
(package! quickrun :pin "248149b0261051bd9eec8bdbc21c22d18d7b1b11")
|
(package! quickrun :pin "373634cf5143f9680164e27fa844d3b02408e917")
|
||||||
(when (modulep! +overlay)
|
(when (modulep! +overlay)
|
||||||
(package! eros :pin "a9a92bdc6be0521a6a06eb464be55ed61946639c"))
|
(package! eros :pin "a9a92bdc6be0521a6a06eb464be55ed61946639c"))
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
(when (modulep! +dictionary)
|
(when (modulep! +dictionary)
|
||||||
(if (featurep :system 'macos)
|
(if (featurep :system 'macos)
|
||||||
(package! osx-dictionary :pin "1f5a74f3e5d7f3c443f07433951512cd99e820a6")
|
(package! osx-dictionary :pin "6abfd6908b0dc773020466225c908000870b383b")
|
||||||
(package! define-word :pin "31a8c67405afa99d0e25e7c86a4ee7ef84a808fe")
|
(package! define-word :pin "31a8c67405afa99d0e25e7c86a4ee7ef84a808fe")
|
||||||
;; REVIEW: This fork fixes SavchenkoValeriy/emacs-powerthesaurus#40.
|
;; REVIEW: This fork fixes SavchenkoValeriy/emacs-powerthesaurus#40.
|
||||||
(package! powerthesaurus
|
(package! powerthesaurus
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
:commands eglot eglot-ensure
|
:commands eglot eglot-ensure
|
||||||
:hook (eglot-managed-mode . +lsp-optimization-mode)
|
:hook (eglot-managed-mode . +lsp-optimization-mode)
|
||||||
:init
|
:init
|
||||||
(defadvice! +eglot--ensure-available-mode (fn)
|
(defadvice! +eglot--ensure-available-mode-a (fn)
|
||||||
"Run `eglot-ensure' if the current mode has support."
|
"Run `eglot-ensure' if the current mode has support."
|
||||||
:around #'eglot-ensure
|
:around #'eglot-ensure
|
||||||
(when (alist-get major-mode eglot-server-programs nil nil
|
(when (alist-get major-mode eglot-server-programs nil nil
|
||||||
|
@ -15,7 +15,6 @@
|
||||||
(funcall fn)))
|
(funcall fn)))
|
||||||
(setq eglot-sync-connect 1
|
(setq eglot-sync-connect 1
|
||||||
eglot-autoshutdown t
|
eglot-autoshutdown t
|
||||||
eglot-send-changes-idle-time 0.5
|
|
||||||
;; NOTE: We disable eglot-auto-display-help-buffer because :select t in
|
;; NOTE: We disable eglot-auto-display-help-buffer because :select t in
|
||||||
;; its popup rule causes eglot to steal focus too often.
|
;; its popup rule causes eglot to steal focus too often.
|
||||||
eglot-auto-display-help-buffer nil)
|
eglot-auto-display-help-buffer nil)
|
||||||
|
@ -44,8 +43,8 @@
|
||||||
(defadvice! +lsp--defer-server-shutdown-a (fn &optional server)
|
(defadvice! +lsp--defer-server-shutdown-a (fn &optional server)
|
||||||
"Defer server shutdown for a few seconds.
|
"Defer server shutdown for a few seconds.
|
||||||
This gives the user a chance to open other project files before the server is
|
This gives the user a chance to open other project files before the server is
|
||||||
auto-killed (which is a potentially expensive process). It also prevents the
|
auto-killed (which is a potentially expensive process). It also spares the
|
||||||
server getting expensively restarted when reverting buffers."
|
server an expensive restart when its buffer is reverted."
|
||||||
:around #'eglot--managed-mode
|
:around #'eglot--managed-mode
|
||||||
(letf! (defun eglot-shutdown (server)
|
(letf! (defun eglot-shutdown (server)
|
||||||
(if (or (null +lsp-defer-shutdown)
|
(if (or (null +lsp-defer-shutdown)
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
|
|
||||||
(if (modulep! +eglot)
|
(if (modulep! +eglot)
|
||||||
(progn
|
(progn
|
||||||
(package! eglot :pin "24f2bf7b28c33e1d677b547956ade5560d27f55f")
|
(package! eglot :pin "678610fdc544f10ac757ab7acf88ac7c5815ed5a")
|
||||||
(when (modulep! :completion vertico)
|
(when (modulep! :completion vertico)
|
||||||
(package! consult-eglot :pin "049c6319b8a48ff66189d49592c7759f0b356596"))
|
(package! consult-eglot :pin "64262e72452f8fe6dd49d31bcdd4bd577b7d682d"))
|
||||||
(when (and (modulep! :checkers syntax)
|
(when (and (modulep! :checkers syntax)
|
||||||
(not (modulep! :checkers syntax +flymake)))
|
(not (modulep! :checkers syntax +flymake)))
|
||||||
(package! flycheck-eglot :pin "114e1315aaf0dc3196da67da426bbe2b46384fe2")))
|
(package! flycheck-eglot :pin "114e1315aaf0dc3196da67da426bbe2b46384fe2")))
|
||||||
(package! lsp-mode :pin "a5f5ca9a8a4b2ceaf236457bf2524f94c183c2f2")
|
(package! lsp-mode :pin "8861252880f6c2f6374a7bca2b945e6447eebd5a")
|
||||||
(package! lsp-ui :pin "bc58c6664577d1d79060c6b32b7ad20e70ee19d0")
|
(package! lsp-ui :pin "942eeecc3d9a23ad006a3476885dfa7cbb5e207e")
|
||||||
(when (modulep! :completion ivy)
|
(when (modulep! :completion ivy)
|
||||||
(package! lsp-ivy :pin "9ecf4dd9b1207109802bd1882aa621eb1c385106"))
|
(package! lsp-ivy :pin "9ecf4dd9b1207109802bd1882aa621eb1c385106"))
|
||||||
(when (modulep! :completion helm)
|
(when (modulep! :completion helm)
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/magit/packages.el
|
;;; tools/magit/packages.el
|
||||||
|
|
||||||
(when (package! magit :pin "0963697f24cfbe80f92312044bd9ab28b914b053")
|
(when (package! magit :pin "b5637d665c1e5bd5b76ffb072dbac387f37a5f63")
|
||||||
(when (modulep! +forge)
|
(when (modulep! +forge)
|
||||||
(package! forge :pin "68771ca4d53c3aea5c860eeb888cee8e9cb5ca37")
|
(package! forge :pin "ad94b5665de357347bfc52910eef46a79f74988d")
|
||||||
(package! code-review
|
(package! code-review
|
||||||
:recipe (:host github
|
:recipe (:host github
|
||||||
:repo "doomelpa/code-review"
|
:repo "doomelpa/code-review"
|
||||||
:files ("graphql" "code-review*.el"))
|
:files ("graphql" "code-review*.el"))
|
||||||
:pin "e4c34fa284da25d8e0bafbae4300f1db5bdcda44"))
|
:pin "e4c34fa284da25d8e0bafbae4300f1db5bdcda44"))
|
||||||
(package! magit-todos :pin "1e9acc0ba63fbc297001bf334d63cb4326be80df"))
|
(package! magit-todos :pin "332ce763f7336ea356964b92723678aa1ed4640f"))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/pdf/packages.el
|
;;; tools/pdf/packages.el
|
||||||
|
|
||||||
(package! pdf-tools :pin "c69e7656a4678fe25afbd29f3503dd19ee7f9896")
|
(package! pdf-tools :pin "a1048bceb2bd3f635437b0f2bfac27cae8c2dabc")
|
||||||
(package! saveplace-pdf-view :pin "abfb5e1f463cffc18218a0f7f2fa141a271b1813")
|
(package! saveplace-pdf-view :pin "ee95460cd934080338f03a16f95b549577425216")
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/terraform/packages.el
|
;;; tools/terraform/packages.el
|
||||||
|
|
||||||
(package! terraform-mode :pin "e8b57df8c2a3d3171f3768f60eb84067f553289c")
|
(package! terraform-mode :pin "a645c32a8f0f0d04034262ae5fea330d5c7a33c6")
|
||||||
(when (modulep! :completion company)
|
(when (modulep! :completion company)
|
||||||
(package! company-terraform :pin "8d5a16d1bbeeb18ca49a8fd57b5d8cd30c8b8dc7"))
|
(package! company-terraform :pin "8d5a16d1bbeeb18ca49a8fd57b5d8cd30c8b8dc7"))
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
;;; tools/tree-sitter/packages.el
|
;;; tools/tree-sitter/packages.el
|
||||||
|
|
||||||
(package! tree-sitter :pin "3cfab8a0e945db9b3df84437f27945746a43cc71")
|
(package! tree-sitter :pin "3cfab8a0e945db9b3df84437f27945746a43cc71")
|
||||||
(package! tree-sitter-langs :pin "20fbbb85735a9196ba3e7fb33f99b3a904b363ba")
|
(package! tree-sitter-langs :pin "b7895ca759563f3c7c3b928eb4f816bb4099d866")
|
||||||
(package! tree-sitter-indent :pin "4ef246db3e4ff99f672fe5e4b416c890f885c09e")
|
(package! tree-sitter-indent :pin "4ef246db3e4ff99f672fe5e4b416c890f885c09e")
|
||||||
|
|
||||||
(when (modulep! :editor evil +everywhere)
|
(when (modulep! :editor evil +everywhere)
|
||||||
(package! evil-textobj-tree-sitter
|
(package! evil-textobj-tree-sitter
|
||||||
:pin "220ceae065852ef4f717fa41efd1ab51ca2346d3"))
|
:pin "a19ab9d89a00f4a04420f9b5d61b66f04fea5261"))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; ui/deft/packages.el
|
;;; ui/deft/packages.el
|
||||||
|
|
||||||
(package! deft :pin "28be94d89bff2e1c7edef7244d7c5ba0636b1296")
|
(package! deft :pin "bb1a16b87c3e0fe70fade6227e47dd7712b89bf6")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; ui/doom/packages.el
|
;;; ui/doom/packages.el
|
||||||
|
|
||||||
(package! doom-themes :pin "ff26f26ea3d761375f5fc4070438fbd0f3473d33")
|
(package! doom-themes :pin "3b2422b208d28e8734b300cd3cc6a7f4af5eba55")
|
||||||
(package! solaire-mode :pin "8af65fbdc50b25ed3214da949b8a484527c7cc14")
|
(package! solaire-mode :pin "8ccdceeb9298b3c4e35f630914f467bf164f39ad")
|
||||||
|
|
|
@ -161,12 +161,13 @@ and cannot run in."
|
||||||
(fboundp 'mac-auto-operator-composition-mode))
|
(fboundp 'mac-auto-operator-composition-mode))
|
||||||
(add-hook 'doom-init-ui-hook #'mac-auto-operator-composition-mode 'append))
|
(add-hook 'doom-init-ui-hook #'mac-auto-operator-composition-mode 'append))
|
||||||
|
|
||||||
;; NOTE: the module does not support Emacs 27 and less, but if we still try to enable ligatures,
|
;; This module does not support Emacs 27 and less, but if we still try to
|
||||||
;; it will end up in catastrophic work-loss errors, so we leave the check here for safety.
|
;; enable ligatures, it will end up in catastrophic work-loss errors, so we
|
||||||
|
;; leave the check here for safety.
|
||||||
((and (> emacs-major-version 27)
|
((and (> emacs-major-version 27)
|
||||||
(or (featurep 'ns)
|
(or (featurep 'ns)
|
||||||
(string-match-p "HARFBUZZ" system-configuration-features))
|
(featurep 'harfbuzz))
|
||||||
(featurep 'composite)) ; Emacs loads `composite' at startup
|
(featurep 'composite)) ; Emacs loads `composite' at startup
|
||||||
|
|
||||||
(use-package! ligature
|
(use-package! ligature
|
||||||
:config
|
:config
|
||||||
|
|
|
@ -96,7 +96,7 @@ Some possible solutions:
|
||||||
(after! doom-modeline
|
(after! doom-modeline
|
||||||
(doom-modeline-def-modeline 'main
|
(doom-modeline-def-modeline 'main
|
||||||
'(bar matches buffer-info remote-host buffer-position parrot selection-info)
|
'(bar matches buffer-info remote-host buffer-position parrot selection-info)
|
||||||
'(misc-info minor-modes checker input-method buffer-encoding major-mode process vcs " "))) ; <-- added padding here
|
'(misc-info minor-modes check input-method buffer-encoding major-mode process vcs " "))) ; <-- added padding here
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
2. Use another font for the mode line (or a different ~:height~) (source)
|
2. Use another font for the mode line (or a different ~:height~) (source)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
;;; ui/modeline/packages.el
|
;;; ui/modeline/packages.el
|
||||||
|
|
||||||
(unless (modulep! +light)
|
(unless (modulep! +light)
|
||||||
(package! doom-modeline :pin "bf880ae56f3f6aab7bd334de9bd9b455c63a24c0"))
|
(package! doom-modeline :pin "e09b8e989fa5fc1d98320aaa29d7138631b20ae5"))
|
||||||
(package! anzu :pin "26fb50b429ee968eb944b0615dd0aed1dd66172c")
|
(package! anzu :pin "26fb50b429ee968eb944b0615dd0aed1dd66172c")
|
||||||
(when (modulep! :editor evil)
|
(when (modulep! :editor evil)
|
||||||
(package! evil-anzu :pin "d1e98ee6976437164627542909a25c6946497899"))
|
(package! evil-anzu :pin "d1e98ee6976437164627542909a25c6946497899"))
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
neo-mode-line-type 'none
|
neo-mode-line-type 'none
|
||||||
neo-window-width 30
|
neo-window-width 30
|
||||||
neo-show-updir-line nil
|
neo-show-updir-line nil
|
||||||
neo-theme 'icons
|
neo-theme 'nerd
|
||||||
neo-banner-message nil
|
neo-banner-message nil
|
||||||
neo-confirm-create-file #'off-p
|
neo-confirm-create-file #'off-p
|
||||||
neo-confirm-create-directory #'off-p
|
neo-confirm-create-directory #'off-p
|
||||||
|
|
|
@ -106,7 +106,7 @@ the buffer is visible, then set another timer and try again later."
|
||||||
(param (if (memq side '(left right))
|
(param (if (memq side '(left right))
|
||||||
'window-width
|
'window-width
|
||||||
'window-height)))
|
'window-height)))
|
||||||
(setq list (assq-delete-all 'size alist))
|
(setq alist (assq-delete-all 'size alist))
|
||||||
(setf (alist-get param alist) size))
|
(setf (alist-get param alist) size))
|
||||||
(setf (alist-get 'window-parameters alist)
|
(setf (alist-get 'window-parameters alist)
|
||||||
parameters)
|
parameters)
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
;;; ui/tabs/config.el -*- lexical-binding: t; -*-
|
;;; ui/tabs/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defcustom +tabs-buffer-update-groups-delay 0.1
|
||||||
|
"Minimum wait time (in seconds) before tab groups are recalculated."
|
||||||
|
:type 'float
|
||||||
|
:group 'doom)
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
;;; Packages
|
||||||
|
|
||||||
(use-package! centaur-tabs
|
(use-package! centaur-tabs
|
||||||
:hook (doom-first-file . centaur-tabs-mode)
|
:hook (doom-first-file . centaur-tabs-mode)
|
||||||
:init
|
:init
|
||||||
|
@ -20,7 +29,20 @@
|
||||||
(defun +tabs-disable-centaur-tabs-mode-maybe-h ()
|
(defun +tabs-disable-centaur-tabs-mode-maybe-h ()
|
||||||
"Disable `centaur-tabs-mode' in current buffer."
|
"Disable `centaur-tabs-mode' in current buffer."
|
||||||
(when (centaur-tabs-mode-on-p)
|
(when (centaur-tabs-mode-on-p)
|
||||||
(centaur-tabs-local-mode)))))
|
(centaur-tabs-local-mode))))
|
||||||
|
|
||||||
|
;; HACK: `centaur-tabs-buffer-update-groups' is both expensive and called too
|
||||||
|
;; frequently. There really is no reason to call it more than 10 times per
|
||||||
|
;; second, as buffers rarely change groups more frequently than that.
|
||||||
|
(let ((time (float-time)))
|
||||||
|
(defadvice! +tabs--rate-limit-buffer-update-groups-a (fn)
|
||||||
|
:around #'centaur-tabs-buffer-update-groups
|
||||||
|
(let ((now (float-time)))
|
||||||
|
(if-let ((buf (and (< now (+ time +tabs-buffer-update-groups-delay))
|
||||||
|
(assq (current-buffer) centaur-tabs--buffers))))
|
||||||
|
(car (nth 2 buf))
|
||||||
|
(setq time now)
|
||||||
|
(funcall fn))))))
|
||||||
|
|
||||||
|
|
||||||
;; TODO tab-bar-mode (emacs 27)
|
;; TODO tab-bar-mode (emacs 27)
|
||||||
|
|
|
@ -26,7 +26,7 @@ This must be set before `treemacs' has loaded.")
|
||||||
treemacs-persist-file (concat doom-cache-dir "treemacs-persist")
|
treemacs-persist-file (concat doom-cache-dir "treemacs-persist")
|
||||||
treemacs-last-error-persist-file (concat doom-cache-dir "treemacs-last-error-persist"))
|
treemacs-last-error-persist-file (concat doom-cache-dir "treemacs-last-error-persist"))
|
||||||
:config
|
:config
|
||||||
;; Don't follow the cursor
|
;; Don't follow the cursor (it's more disruptive/jarring than helpful as a default)
|
||||||
(treemacs-follow-mode -1)
|
(treemacs-follow-mode -1)
|
||||||
|
|
||||||
(set-popup-rule! "^ ?\\*Treemacs" :ignore t)
|
(set-popup-rule! "^ ?\\*Treemacs" :ignore t)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; ui/treemacs/packages.el
|
;;; ui/treemacs/packages.el
|
||||||
|
|
||||||
(package! treemacs :pin "df26b6ab9a0f467e5ff99f7ed97551ccf756e06c")
|
(package! treemacs :pin "8c6df39f01a4d47fda2cc943645fa067f771b748")
|
||||||
(package! treemacs-nerd-icons :pin "9876cb478145a0ec4e36f64ff6583f3de7126216")
|
(package! treemacs-nerd-icons :pin "9876cb478145a0ec4e36f64ff6583f3de7126216")
|
||||||
;; These packages have no :pin because they're in the same repo
|
;; These packages have no :pin because they're in the same repo
|
||||||
(when (modulep! :editor evil +everywhere)
|
(when (modulep! :editor evil +everywhere)
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
;;; ui/vc-gutter/packages.el
|
;;; ui/vc-gutter/packages.el
|
||||||
|
|
||||||
(if (modulep! +diff-hl)
|
(if (modulep! +diff-hl)
|
||||||
(package! diff-hl :pin "b8b2727a72fdf64ac98e6cfa136a43cb0cacf72f")
|
(package! diff-hl :pin "96620839430c1205cbb8c92dd54973397f70f9d2")
|
||||||
(package! git-gutter-fringe :pin "648cb5b57faec55711803cdc9434e55a733c3eba"))
|
(package! git-gutter-fringe :pin "648cb5b57faec55711803cdc9434e55a733c3eba"))
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
;;; ui/workspaces/autoload/ivy.el -*- lexical-binding: t; -*-
|
|
||||||
;;;###if (modulep! :completion ivy)
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +workspace--ivy-rich-preview (workspace)
|
|
||||||
(if-let (buffers (when-let (workspace (gethash workspace *persp-hash*))
|
|
||||||
(cl-loop for (type . rest) in (persp-window-conf workspace)
|
|
||||||
if (eq type 'buffer)
|
|
||||||
collect (car leaf)
|
|
||||||
else if (eq type 'leaf)
|
|
||||||
append (cl-loop for (type . leaf) in rest
|
|
||||||
if (eq type 'buffer)
|
|
||||||
collect (car leaf)))))
|
|
||||||
(string-join buffers " ")
|
|
||||||
"*No buffers*"))
|
|
||||||
|
|
||||||
;;; ivy.el ends here
|
|
|
@ -318,12 +318,7 @@ workspace, otherwise the new workspace is blank."
|
||||||
end of the workspace list."
|
end of the workspace list."
|
||||||
(interactive
|
(interactive
|
||||||
(list (or current-prefix-arg
|
(list (or current-prefix-arg
|
||||||
(if (modulep! :completion ivy)
|
(completing-read "Switch to workspace: " (+workspace-list-names)))))
|
||||||
(ivy-read "Switch to workspace: "
|
|
||||||
(+workspace-list-names)
|
|
||||||
:caller #'+workspace/switch-to
|
|
||||||
:preselect (+workspace-current-name))
|
|
||||||
(completing-read "Switch to workspace: " (+workspace-list-names))))))
|
|
||||||
(when (and (stringp index)
|
(when (and (stringp index)
|
||||||
(string-match-p "^[0-9]+$" index))
|
(string-match-p "^[0-9]+$" index))
|
||||||
(setq index (string-to-number index)))
|
(setq index (string-to-number index)))
|
||||||
|
|
|
@ -84,9 +84,10 @@ stored in `persp-save-dir'.")
|
||||||
;; HACK Fix #319: the warnings buffer gets swallowed when creating
|
;; HACK Fix #319: the warnings buffer gets swallowed when creating
|
||||||
;; `+workspaces-main', so display it ourselves, if it exists.
|
;; `+workspaces-main', so display it ourselves, if it exists.
|
||||||
(when-let (warnings (get-buffer "*Warnings*"))
|
(when-let (warnings (get-buffer "*Warnings*"))
|
||||||
(save-excursion
|
(unless (get-buffer-window warnings)
|
||||||
(display-buffer-in-side-window
|
(save-excursion
|
||||||
warnings '((window-height . shrink-window-if-larger-than-buffer))))))))
|
(display-buffer-in-side-window
|
||||||
|
warnings '((window-height . shrink-window-if-larger-than-buffer)))))))))
|
||||||
(defun +workspaces-init-persp-mode-h ()
|
(defun +workspaces-init-persp-mode-h ()
|
||||||
(cond (persp-mode
|
(cond (persp-mode
|
||||||
;; `uniquify' breaks persp-mode. It renames old buffers, which causes
|
;; `uniquify' breaks persp-mode. It renames old buffers, which causes
|
||||||
|
@ -206,13 +207,6 @@ stored in `persp-save-dir'.")
|
||||||
("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root")
|
("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root")
|
||||||
("X" counsel-projectile-switch-project-action-org-capture "org-capture into project")))
|
("X" counsel-projectile-switch-project-action-org-capture "org-capture into project")))
|
||||||
|
|
||||||
(when (modulep! :completion ivy)
|
|
||||||
(after! ivy-rich
|
|
||||||
(cl-callf plist-put ivy-rich-display-transformers-list
|
|
||||||
'+workspace/switch-to
|
|
||||||
'(:columns ((ivy-rich-candidate (:width 50))
|
|
||||||
(+workspace--ivy-rich-preview))))))
|
|
||||||
|
|
||||||
(when (modulep! :completion helm)
|
(when (modulep! :completion helm)
|
||||||
(after! helm-projectile
|
(after! helm-projectile
|
||||||
(setcar helm-source-projectile-projects-actions
|
(setcar helm-source-projectile-projects-actions
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue