Merge remote-tracking branch 'upstream/develop' into develop
merge upsteam
This commit is contained in:
commit
d5d241b36e
125 changed files with 1272 additions and 879 deletions
14
.github/workflows/lock.yml
vendored
Normal file
14
.github/workflows/lock.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
name: 'Lock Threads'
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 * * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lock:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: dessant/lock-threads@v2
|
||||||
|
with:
|
||||||
|
github-token: ${{ github.token }}
|
||||||
|
issue-lock-inactive-days: '180'
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -3,20 +3,20 @@ name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
|
||||||
- develop
|
- develop
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
|
||||||
- develop
|
- develop
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
if: false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
emacs_version:
|
emacs_version:
|
||||||
- 26.3
|
- 26.3
|
||||||
|
- 27.1
|
||||||
include:
|
include:
|
||||||
- emacs_version: 26.3
|
- emacs_version: 26.3
|
||||||
lint_ignore: 1
|
lint_ignore: 1
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016-2020 Henrik Lissner.
|
Copyright (c) 2016-2021 Henrik Lissner.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|
4
bin/doom
4
bin/doom
|
@ -3,7 +3,7 @@
|
||||||
:; case "$EMACS" in *term*) EMACS=emacs ;; *) EMACS="${EMACS:-emacs}" ;; esac
|
:; case "$EMACS" in *term*) EMACS=emacs ;; *) EMACS="${EMACS:-emacs}" ;; esac
|
||||||
:; $EMACS --version >/dev/null 2>&1 || { >&2 echo "Can't find emacs in your PATH"; exit 1; }
|
:; $EMACS --version >/dev/null 2>&1 || { >&2 echo "Can't find emacs in your PATH"; exit 1; }
|
||||||
:; $EMACS --no-site-file --script "$0" -- "$@" || __DOOMCODE=$?
|
:; $EMACS --no-site-file --script "$0" -- "$@" || __DOOMCODE=$?
|
||||||
:; [ "${__DOOMCODE:-0}" -eq 128 ] && { "`$EMACS -Q --batch --eval '(princ temporary-file-directory)'`/doom.sh" "$0" "$@" && true; __DOOMCODE=$?; }
|
:; [ "${__DOOMCODE:-0}" -eq 128 ] && { sh "`$EMACS -Q --batch --eval '(princ temporary-file-directory)'`/doom.sh" "$0" "$@" && true; __DOOMCODE=$?; }
|
||||||
:; exit $__DOOMCODE
|
:; exit $__DOOMCODE
|
||||||
|
|
||||||
;; The garbage collector isn't as important during CLI ops. A higher threshold
|
;; The garbage collector isn't as important during CLI ops. A higher threshold
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
(shell-quote-argument (match-string 2 env)))))
|
(shell-quote-argument (match-string 2 env)))))
|
||||||
(format "PATH=\"%s%s$PATH\" \\\n" (concat doom-emacs-dir "bin/") path-separator)
|
(format "PATH=\"%s%s$PATH\" \\\n" (concat doom-emacs-dir "bin/") path-separator)
|
||||||
"_postscript $@\n"))
|
"_postscript $@\n"))
|
||||||
(set-file-modes script #o700))
|
(set-file-modes script #o600))
|
||||||
;; Error code 128 is special: it means run the post-script after this
|
;; Error code 128 is special: it means run the post-script after this
|
||||||
;; session ends.
|
;; session ends.
|
||||||
128)
|
128)
|
||||||
|
|
|
@ -113,7 +113,7 @@ ready to be pasted in a bug report on github."
|
||||||
(letf! ((defun sh (&rest args) (cdr (apply #'doom-call-process args)))
|
(letf! ((defun sh (&rest args) (cdr (apply #'doom-call-process args)))
|
||||||
(defun abbrev-path (path)
|
(defun abbrev-path (path)
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
(regexp-quote (user-login-name)) "$USER"
|
(concat "\\<" (regexp-quote (user-login-name)) "\\>") "$USER"
|
||||||
(abbreviate-file-name path))))
|
(abbreviate-file-name path))))
|
||||||
`((system
|
`((system
|
||||||
(type . ,system-type)
|
(type . ,system-type)
|
||||||
|
|
|
@ -351,13 +351,15 @@ module derived from a `featurep!' or `require!' call, c) the module that the
|
||||||
current file is in, or d) the module associated with the current major mode (see
|
current file is in, or d) the module associated with the current major mode (see
|
||||||
`doom--help-major-mode-module-alist')."
|
`doom--help-major-mode-module-alist')."
|
||||||
(interactive
|
(interactive
|
||||||
|
(nconc
|
||||||
(mapcar #'intern
|
(mapcar #'intern
|
||||||
(split-string
|
(split-string
|
||||||
(completing-read "Describe module: "
|
(completing-read "Describe module: "
|
||||||
(doom--help-modules-list)
|
(doom--help-modules-list)
|
||||||
nil t nil nil
|
nil t nil nil
|
||||||
(doom--help-current-module-str))
|
(doom--help-current-module-str))
|
||||||
" " t)))
|
" " t))
|
||||||
|
(list current-prefix-arg)))
|
||||||
(cl-check-type category symbol)
|
(cl-check-type category symbol)
|
||||||
(cl-check-type module symbol)
|
(cl-check-type module symbol)
|
||||||
(cl-destructuring-bind (module-string path)
|
(cl-destructuring-bind (module-string path)
|
||||||
|
@ -377,29 +379,58 @@ current file is in, or d) the module associated with the current major mode (see
|
||||||
(doom-project-browse (file-name-directory path)))
|
(doom-project-browse (file-name-directory path)))
|
||||||
((user-error "Aborted module lookup")))))
|
((user-error "Aborted module lookup")))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom/help-custom-variable (var)
|
||||||
|
"Look up documentation for a custom variable.
|
||||||
|
|
||||||
|
Unlike `helpful-variable', which casts a wider net that includes internal
|
||||||
|
variables, this only lists variables that exist to be customized (defined with
|
||||||
|
`defcustom')."
|
||||||
|
(interactive
|
||||||
|
(list (helpful--read-symbol
|
||||||
|
"Custom variable: "
|
||||||
|
(helpful--variable-at-point)
|
||||||
|
(lambda (sym)
|
||||||
|
(and (helpful--variable-p sym)
|
||||||
|
(custom-variable-p sym)
|
||||||
|
;; Exclude minor mode state variables, which aren't meant to be
|
||||||
|
;; modified directly, but through their associated function.
|
||||||
|
(not (or (and (string-suffix-p "-mode" (symbol-name sym))
|
||||||
|
(fboundp sym))
|
||||||
|
(eq (get sym 'custom-set) 'custom-set-minor-mode))))))))
|
||||||
|
(helpful-variable var))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; `doom/help-packages'
|
;;; `doom/help-packages'
|
||||||
|
|
||||||
(defun doom--help-package-insert-button (label path &optional regexp)
|
(defun doom--help-insert-button (label &optional path)
|
||||||
(declare (indent defun))
|
(cl-destructuring-bind (uri . qs)
|
||||||
|
(let ((parts (split-string label "::" t)))
|
||||||
|
(cons (string-trim (car parts))
|
||||||
|
(string-join (cdr parts) "::")))
|
||||||
|
(let ((path (or path label)))
|
||||||
(insert-text-button
|
(insert-text-button
|
||||||
(string-trim label)
|
uri
|
||||||
'face 'link
|
'face 'link
|
||||||
'follow-link t
|
'follow-link t
|
||||||
'action
|
'action
|
||||||
`(lambda (_)
|
(lambda (_)
|
||||||
(unless (file-exists-p ,path)
|
|
||||||
(user-error "Module doesn't exist"))
|
|
||||||
(when (window-dedicated-p)
|
(when (window-dedicated-p)
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
(let ((buffer (find-file ,path)))
|
(pcase (cond ((string-match-p "^https?://" qs) 'url)
|
||||||
(when ,(stringp regexp)
|
('file))
|
||||||
|
((or `file `nil)
|
||||||
|
(unless (file-exists-p path)
|
||||||
|
(user-error "Path does not exist: %S" path))
|
||||||
|
(let ((buffer (or (get-file-buffer path)
|
||||||
|
(find-file path))))
|
||||||
|
(when qs
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(if (re-search-forward ,regexp nil t)
|
(re-search-forward qs)
|
||||||
(recenter)
|
(recenter)))))
|
||||||
(message "Couldn't find the config block"))))))))
|
(`url (browse-url uri))))))))
|
||||||
|
|
||||||
(defun doom--help-package-configs (package)
|
(defun doom--help-package-configs (package)
|
||||||
(let ((default-directory doom-emacs-dir))
|
(let ((default-directory doom-emacs-dir))
|
||||||
|
@ -413,6 +444,7 @@ current file is in, or d) the module associated with the current major mode (see
|
||||||
":(exclude)*.org"))
|
":(exclude)*.org"))
|
||||||
"\n" t)))
|
"\n" t)))
|
||||||
|
|
||||||
|
(defvar doom--help-packages-list nil)
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/help-packages (package)
|
(defun doom/help-packages (package)
|
||||||
"Like `describe-package', but for packages installed by Doom modules.
|
"Like `describe-package', but for packages installed by Doom modules.
|
||||||
|
@ -427,12 +459,18 @@ If prefix arg is present, refresh the cache."
|
||||||
(require 'finder-inf nil t)
|
(require 'finder-inf nil t)
|
||||||
(require 'package)
|
(require 'package)
|
||||||
(require 'straight)
|
(require 'straight)
|
||||||
(let ((packages (delete-dups
|
(let ((packages
|
||||||
|
(if (and doom--help-packages-list (null current-prefix-arg))
|
||||||
|
doom--help-packages-list
|
||||||
|
(message "Generating packages list for the first time...")
|
||||||
|
(sit-for 0.1)
|
||||||
|
(setq doom--help-packages-list
|
||||||
|
(delete-dups
|
||||||
(append (mapcar #'car package-alist)
|
(append (mapcar #'car package-alist)
|
||||||
(mapcar #'car package--builtins)
|
(mapcar #'car package--builtins)
|
||||||
(mapcar #'intern (hash-table-keys straight--build-cache))
|
(mapcar #'intern (hash-table-keys straight--build-cache))
|
||||||
(mapcar #'car (doom-package-list 'all))
|
(mapcar #'car (doom-package-list 'all))
|
||||||
nil))))
|
nil))))))
|
||||||
(unless (memq guess packages)
|
(unless (memq guess packages)
|
||||||
(setq guess nil))
|
(setq guess nil))
|
||||||
(list
|
(list
|
||||||
|
@ -440,9 +478,10 @@ If prefix arg is present, refresh the cache."
|
||||||
(completing-read (if guess
|
(completing-read (if guess
|
||||||
(format "Select Doom package to search for (default %s): "
|
(format "Select Doom package to search for (default %s): "
|
||||||
guess)
|
guess)
|
||||||
"Describe Doom package: ")
|
(format "Describe Doom package (%d): " (length packages)))
|
||||||
packages nil t nil nil
|
packages nil t nil nil
|
||||||
(if guess (symbol-name guess))))))))
|
(if guess (symbol-name guess))))))))
|
||||||
|
;; TODO Refactor me.
|
||||||
(require 'core-packages)
|
(require 'core-packages)
|
||||||
(doom-initialize-packages)
|
(doom-initialize-packages)
|
||||||
(if (or (package-desc-p package)
|
(if (or (package-desc-p package)
|
||||||
|
@ -477,20 +516,38 @@ If prefix arg is present, refresh the cache."
|
||||||
"unpinned")
|
"unpinned")
|
||||||
"\n")
|
"\n")
|
||||||
(package--print-help-section "Build")
|
(package--print-help-section "Build")
|
||||||
(insert (let ((default-directory (straight--repos-dir (symbol-name package))))
|
(let ((default-directory (straight--repos-dir (symbol-name package))))
|
||||||
(cdr
|
(insert (cdr (doom-call-process "git" "log" "-1" "--format=%D %h %ci"))
|
||||||
(doom-call-process "git" "log" "-1" "--format=%D %h %ci")))
|
"\n" indent))
|
||||||
"\n")
|
(package--print-help-section "Build location")
|
||||||
|
(let ((build-dir (straight--build-dir (symbol-name package))))
|
||||||
|
(if (file-exists-p build-dir)
|
||||||
|
(doom--help-insert-button (abbreviate-file-name build-dir))
|
||||||
|
(insert "n/a")))
|
||||||
|
(insert "\n" indent)
|
||||||
|
(package--print-help-section "Repo location")
|
||||||
|
(let ((repo-dir (straight--repos-dir (symbol-name package))))
|
||||||
|
(if (file-exists-p repo-dir)
|
||||||
|
(doom--help-insert-button (abbreviate-file-name repo-dir))
|
||||||
|
(insert "n/a"))
|
||||||
|
(insert "\n"))
|
||||||
(let ((recipe (doom-package-build-recipe package)))
|
(let ((recipe (doom-package-build-recipe package)))
|
||||||
(insert (format! "%s\n"
|
(package--print-help-section "Recipe")
|
||||||
(indent 13
|
(insert (format "%s\n" (string-trim (pp-to-string recipe))))
|
||||||
(string-trim (pp-to-string recipe)))))
|
|
||||||
|
|
||||||
(package--print-help-section "Homepage")
|
(package--print-help-section "Homepage")
|
||||||
(insert (doom--package-url package))))
|
(doom--help-insert-button (doom--package-url package))))
|
||||||
(`elpa (insert "[M]ELPA " (doom--package-url package)))
|
(`elpa (insert "[M]ELPA ")
|
||||||
(`builtin (insert "Built-in"))
|
(doom--help-insert-button (doom--package-url package))
|
||||||
(`other (insert
|
(package--print-help-section "Location")
|
||||||
|
(doom--help-insert-button
|
||||||
|
(abbreviate-file-name
|
||||||
|
(file-name-directory (locate-library (symbol-name package))))))
|
||||||
|
(`builtin (insert "Built-in\n")
|
||||||
|
(package--print-help-section "Location")
|
||||||
|
(doom--help-insert-button
|
||||||
|
(abbreviate-file-name
|
||||||
|
(file-name-directory (locate-library (symbol-name package))))))
|
||||||
|
(`other (doom--help-insert-button
|
||||||
(abbreviate-file-name
|
(abbreviate-file-name
|
||||||
(or (symbol-file package)
|
(or (symbol-file package)
|
||||||
(locate-library (symbol-name package))))))
|
(locate-library (symbol-name package))))))
|
||||||
|
@ -506,14 +563,22 @@ If prefix arg is present, refresh the cache."
|
||||||
(package--print-help-section "Modules")
|
(package--print-help-section "Modules")
|
||||||
(insert "Declared by the following Doom modules:\n")
|
(insert "Declared by the following Doom modules:\n")
|
||||||
(dolist (m modules)
|
(dolist (m modules)
|
||||||
(insert indent)
|
(let* ((module-path (pcase (car m)
|
||||||
(doom--help-package-insert-button
|
|
||||||
(format "%s %s" (car m) (or (cdr m) ""))
|
|
||||||
(pcase (car m)
|
|
||||||
(:core doom-core-dir)
|
(:core doom-core-dir)
|
||||||
(:private doom-private-dir)
|
(:private doom-private-dir)
|
||||||
(category (doom-module-path category (cdr m)))))
|
(category (doom-module-path category (cdr m)))))
|
||||||
(insert "\n")))
|
(readme-path (expand-file-name "README.org" module-path)))
|
||||||
|
(insert indent)
|
||||||
|
(doom--help-insert-button
|
||||||
|
(format "%s %s" (car m) (or (cdr m) ""))
|
||||||
|
module-path)
|
||||||
|
(insert " (")
|
||||||
|
(if (file-exists-p readme-path)
|
||||||
|
(doom--help-insert-button
|
||||||
|
"readme"
|
||||||
|
readme-path)
|
||||||
|
(insert "no readme"))
|
||||||
|
(insert ")\n"))))
|
||||||
|
|
||||||
(package--print-help-section "Configs")
|
(package--print-help-section "Configs")
|
||||||
(insert "This package is configured in the following locations:")
|
(insert "This package is configured in the following locations:")
|
||||||
|
@ -582,7 +647,9 @@ If prefix arg is present, refresh the cache."
|
||||||
(format "%s.el" package))))
|
(format "%s.el" package))))
|
||||||
(_ (plist-get plist :url))))))
|
(_ (plist-get plist :url))))))
|
||||||
((and (require 'package nil t)
|
((and (require 'package nil t)
|
||||||
(or package-archive-contents (doom-refresh-packages-maybe))
|
(or package-archive-contents
|
||||||
|
(progn (package-refresh-contents)
|
||||||
|
package-archive-contents))
|
||||||
(pcase (package-desc-archive (cadr (assq package package-archive-contents)))
|
(pcase (package-desc-archive (cadr (assq package package-archive-contents)))
|
||||||
("org" "https://orgmode.org")
|
("org" "https://orgmode.org")
|
||||||
((or "melpa" "melpa-mirror")
|
((or "melpa" "melpa-mirror")
|
||||||
|
|
|
@ -13,18 +13,24 @@
|
||||||
;;
|
;;
|
||||||
;;; Bump commands
|
;;; Bump commands
|
||||||
|
|
||||||
(defun doom--package-full-recipe (package plist)
|
(defun doom--package-merge-recipes (package plist)
|
||||||
(require 'straight)
|
(require 'straight)
|
||||||
(doom-plist-merge
|
(doom-plist-merge
|
||||||
(plist-get plist :recipe)
|
(plist-get plist :recipe)
|
||||||
(or (cdr (straight-recipes-retrieve package))
|
(if-let (recipe (straight-recipes-retrieve package))
|
||||||
(plist-get (cdr (assq package doom-packages))
|
(cdr (if (memq (car recipe) '(quote \`))
|
||||||
:recipe))))
|
(eval recipe t)
|
||||||
|
recipe))
|
||||||
|
(let ((recipe (plist-get (cdr (assq package doom-packages))
|
||||||
|
:recipe)))
|
||||||
|
(if (keywordp (car recipe))
|
||||||
|
recipe
|
||||||
|
(cdr recipe))))))
|
||||||
|
|
||||||
(defun doom--package-to-bump-string (package plist)
|
(defun doom--package-to-bump-string (package plist)
|
||||||
"Return a PACKAGE and its PLIST in 'username/repo@commit' format."
|
"Return a PACKAGE and its PLIST in 'username/repo@commit' format."
|
||||||
(format "%s@%s"
|
(format "%s@%s"
|
||||||
(plist-get (doom--package-full-recipe package plist) :repo)
|
(plist-get (doom--package-merge-recipes package plist) :repo)
|
||||||
(substring-no-properties (plist-get plist :pin) 0 7)))
|
(substring-no-properties (plist-get plist :pin) 0 7)))
|
||||||
|
|
||||||
(defun doom--package-at-point (&optional point)
|
(defun doom--package-at-point (&optional point)
|
||||||
|
@ -78,7 +84,7 @@ Grabs the latest commit id of the package using 'git'."
|
||||||
(cl-destructuring-bind (&key package plist beg end)
|
(cl-destructuring-bind (&key package plist beg end)
|
||||||
(or (doom--package-at-point)
|
(or (doom--package-at-point)
|
||||||
(user-error "Not on a `package!' call"))
|
(user-error "Not on a `package!' call"))
|
||||||
(let* ((recipe (doom--package-full-recipe package plist))
|
(let* ((recipe (doom--package-merge-recipes package plist))
|
||||||
(branch (plist-get recipe :branch))
|
(branch (plist-get recipe :branch))
|
||||||
(oldid (or (plist-get plist :pin)
|
(oldid (or (plist-get plist :pin)
|
||||||
(doom-package-get package :pin)))
|
(doom-package-get package :pin)))
|
||||||
|
@ -177,8 +183,8 @@ each package."
|
||||||
(defun doom/bump-package (package)
|
(defun doom/bump-package (package)
|
||||||
"Bump PACKAGE in all modules that install it."
|
"Bump PACKAGE in all modules that install it."
|
||||||
(interactive
|
(interactive
|
||||||
(list (completing-read "Bump package: "
|
(list (intern (completing-read "Bump package: "
|
||||||
(mapcar #'car (doom-package-list 'all)))))
|
(mapcar #'car (doom-package-list 'all))))))
|
||||||
(let* ((packages (doom-package-list 'all))
|
(let* ((packages (doom-package-list 'all))
|
||||||
(modules (plist-get (alist-get package packages) :modules)))
|
(modules (plist-get (alist-get package packages) :modules)))
|
||||||
(unless modules
|
(unless modules
|
||||||
|
|
|
@ -251,7 +251,7 @@ the value of `indent-tab-mode'.
|
||||||
|
|
||||||
If ARG (universal argument) is non-nil, retab the current buffer using the
|
If ARG (universal argument) is non-nil, retab the current buffer using the
|
||||||
opposite indentation style."
|
opposite indentation style."
|
||||||
(interactive "Pr")
|
(interactive "P\nr")
|
||||||
(unless (and beg end)
|
(unless (and beg end)
|
||||||
(setq beg (point-min)
|
(setq beg (point-min)
|
||||||
end (point-max)))
|
end (point-max)))
|
||||||
|
|
|
@ -127,48 +127,16 @@ Activate again to undo this. If prefix ARG is non-nil, don't restore the last
|
||||||
window configuration and re-maximize the current window. Alternatively, use
|
window configuration and re-maximize the current window. Alternatively, use
|
||||||
`doom/window-enlargen'."
|
`doom/window-enlargen'."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let ((param 'doom--maximize-last-wconf))
|
|
||||||
(cl-destructuring-bind (window . wconf)
|
|
||||||
(or (frame-parameter nil param)
|
|
||||||
(cons nil nil))
|
|
||||||
(set-frame-parameter
|
|
||||||
nil param
|
|
||||||
(if (and (equal window (selected-window))
|
|
||||||
(not arg)
|
|
||||||
(null (cdr (cl-remove-if #'window-dedicated-p (window-list))))
|
|
||||||
wconf)
|
|
||||||
(ignore
|
|
||||||
(let ((source-window (selected-window)))
|
|
||||||
(set-window-configuration wconf)
|
|
||||||
(when (window-live-p source-window)
|
|
||||||
(select-window source-window))))
|
|
||||||
(when (and (bound-and-true-p +popup-mode)
|
(when (and (bound-and-true-p +popup-mode)
|
||||||
(+popup-window-p))
|
(+popup-window-p))
|
||||||
(user-error "Cannot maximize a popup, use `+popup/raise' first or use `doom/window-enlargen' instead"))
|
(+popup/raise (selected-window)))
|
||||||
(prog1 (cons (selected-window) (or wconf (current-window-configuration)))
|
(delete-other-windows))
|
||||||
(delete-other-windows)
|
|
||||||
(add-hook 'doom-switch-window-hook #'doom--enlargened-forget-last-wconf-h)))))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/window-enlargen (&optional arg)
|
(defun doom/window-enlargen (&optional arg)
|
||||||
"Enlargen the current window to focus on this one. Does not close other
|
"Enlargen the current window to focus on this one. Does not close other
|
||||||
windows (unlike `doom/window-maximize-buffer'). Activate again to undo."
|
windows (unlike `doom/window-maximize-buffer'). Activate again to undo."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let ((param 'doom--enlargen-last-wconf))
|
|
||||||
(cl-destructuring-bind (window . wconf)
|
|
||||||
(or (frame-parameter nil param)
|
|
||||||
(cons nil nil))
|
|
||||||
(set-frame-parameter
|
|
||||||
nil param
|
|
||||||
(if (and (equal window (selected-window))
|
|
||||||
(not arg)
|
|
||||||
wconf)
|
|
||||||
(ignore
|
|
||||||
(let ((source-window (selected-window)))
|
|
||||||
(set-window-configuration wconf)
|
|
||||||
(when (window-live-p source-window)
|
|
||||||
(select-window source-window))))
|
|
||||||
(prog1 (cons (selected-window) (or wconf (current-window-configuration)))
|
|
||||||
(let* ((window (selected-window))
|
(let* ((window (selected-window))
|
||||||
(dedicated-p (window-dedicated-p window))
|
(dedicated-p (window-dedicated-p window))
|
||||||
(preserved-p (window-parameter window 'window-preserved-size))
|
(preserved-p (window-parameter window 'window-preserved-size))
|
||||||
|
@ -184,8 +152,7 @@ windows (unlike `doom/window-maximize-buffer'). Activate again to undo."
|
||||||
(maximize-window window))
|
(maximize-window window))
|
||||||
(set-window-dedicated-p window dedicated-p)
|
(set-window-dedicated-p window dedicated-p)
|
||||||
(when preserved-p
|
(when preserved-p
|
||||||
(set-window-parameter window 'window-preserved-size preserved-p))
|
(set-window-parameter window 'window-preserved-size preserved-p)))))
|
||||||
(add-hook 'doom-switch-window-hook #'doom--enlargened-forget-last-wconf-h)))))))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/window-maximize-horizontally ()
|
(defun doom/window-maximize-horizontally ()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;;; core/cli/autoloads.el -*- lexical-binding: t; -*-
|
;;; core/cli/autoloads.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defvar doom-autoloads-excluded-packages '("gh")
|
(defvar doom-autoloads-excluded-packages ()
|
||||||
"What packages whose autoloads file we won't index.
|
"What packages whose autoloads files we won't index.
|
||||||
|
|
||||||
These packages have silly or destructive autoload files that try to load
|
These packages have silly or destructive autoload files that try to load
|
||||||
everyone in the universe and their dog, causing errors that make babies cry. No
|
everyone in the universe and their dog, causing errors that make babies cry. No
|
||||||
|
@ -10,7 +10,7 @@ one wants that.")
|
||||||
(defvar doom-autoloads-cached-vars
|
(defvar doom-autoloads-cached-vars
|
||||||
'(doom-modules
|
'(doom-modules
|
||||||
doom-disabled-packages
|
doom-disabled-packages
|
||||||
comp-deferred-compilation-black-list
|
comp-deferred-compilation-deny-list
|
||||||
load-path
|
load-path
|
||||||
auto-mode-alist
|
auto-mode-alist
|
||||||
interpreter-mode-alist
|
interpreter-mode-alist
|
||||||
|
|
|
@ -48,9 +48,15 @@ in."
|
||||||
|
|
||||||
;; REVIEW Refactor me
|
;; REVIEW Refactor me
|
||||||
(print! (start "Checking your Emacs version..."))
|
(print! (start "Checking your Emacs version..."))
|
||||||
(when EMACS28+
|
(cond
|
||||||
(warn! "Emacs %s detected. Doom doesn't support Emacs 28/HEAD. It is unstable and may cause errors."
|
(EMACS28+
|
||||||
|
(warn! (concat "Emacs %s detected. Doom should support this version, but be prepared for "
|
||||||
|
"Emacs updates causing breakages.")
|
||||||
emacs-version))
|
emacs-version))
|
||||||
|
((= emacs-major-version 26)
|
||||||
|
(warn! (concat "Emacs %s detected. Doom is dropping Emacs 26.x support very soon. Consider "
|
||||||
|
"upgrading to Emacs 27.x.")
|
||||||
|
emacs-version)))
|
||||||
|
|
||||||
(print! (start "Checking for Emacs config conflicts..."))
|
(print! (start "Checking for Emacs config conflicts..."))
|
||||||
(when (file-exists-p "~/.emacs")
|
(when (file-exists-p "~/.emacs")
|
||||||
|
@ -86,6 +92,19 @@ in."
|
||||||
(print! (start "Checking for stale elc files..."))
|
(print! (start "Checking for stale elc files..."))
|
||||||
(elc-check-dir user-emacs-directory)
|
(elc-check-dir user-emacs-directory)
|
||||||
|
|
||||||
|
(print! (start "Checking for problematic git global settings..."))
|
||||||
|
(if (executable-find "git")
|
||||||
|
(when (zerop (car (doom-call-process "git" "config" "--global" "--get-regexp" "^url\\.git://github\\.com")))
|
||||||
|
(warn! "Detected insteadOf rules in your global gitconfig.")
|
||||||
|
(explain! "Doom's package manager heavily relies on git. In particular, many of its packages "
|
||||||
|
"are hosted on github. Rewrite rules like these will break it:\n\n"
|
||||||
|
" [url \"git://github.com\"]\n"
|
||||||
|
" insteadOf = https://github.com\n\n"
|
||||||
|
"Please remove them from your gitconfig or use a conditional includeIf rule to "
|
||||||
|
"only apply your rewrites to specific repositories. See "
|
||||||
|
"'https://git-scm.com/docs/git-config#_includes' for more information."))
|
||||||
|
(error! "Couldn't find the `git' binary; this a hard dependecy for Doom!"))
|
||||||
|
|
||||||
(print! (start "Checking Doom Emacs..."))
|
(print! (start "Checking Doom Emacs..."))
|
||||||
(condition-case-unless-debug ex
|
(condition-case-unless-debug ex
|
||||||
(print-group!
|
(print-group!
|
||||||
|
|
|
@ -92,7 +92,7 @@ default, on Linux, this is '$SHELL -ic /usr/bin/env'. Variables in
|
||||||
(process-environment doom--initial-process-environment))
|
(process-environment doom--initial-process-environment))
|
||||||
(when (or force-p (not (file-exists-p env-file)))
|
(when (or force-p (not (file-exists-p env-file)))
|
||||||
(with-temp-file env-file
|
(with-temp-file env-file
|
||||||
(setq-local coding-system-for-write 'utf-8)
|
(setq-local coding-system-for-write 'utf-8-unix)
|
||||||
(print! (start "%s envvars file at %S")
|
(print! (start "%s envvars file at %S")
|
||||||
(if (file-exists-p env-file)
|
(if (file-exists-p env-file)
|
||||||
"Regenerating"
|
"Regenerating"
|
||||||
|
@ -104,7 +104,7 @@ default, on Linux, this is '$SHELL -ic /usr/bin/env'. Variables in
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(insert
|
(insert
|
||||||
(concat
|
(concat
|
||||||
"# -*- mode: sh -*-\n"
|
"# -*- mode: sh; coding: utf-8-unix -*-\n"
|
||||||
"# ---------------------------------------------------------------------------\n"
|
"# ---------------------------------------------------------------------------\n"
|
||||||
"# This file was auto-generated by `doom env'. It contains a list of environment\n"
|
"# This file was auto-generated by `doom env'. It contains a list of environment\n"
|
||||||
"# variables scraped from your default shell (excluding variables blacklisted\n"
|
"# variables scraped from your default shell (excluding variables blacklisted\n"
|
||||||
|
|
|
@ -24,7 +24,8 @@ Emacs (as byte-code is generally not forward-compatible)."
|
||||||
((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")
|
||||||
(regraft-p ["-g" "--regraft"] "Regraft git repos (ie. compact them)"))
|
(noeln-p ["-e" "--no-eln"] "Don't purge old ELN bytecode")
|
||||||
|
(noregraft-p ["-g" "--no-regraft"] "Regraft git repos (ie. compact them)"))
|
||||||
"Deletes orphaned packages & repos, and compacts them.
|
"Deletes orphaned packages & repos, and compacts them.
|
||||||
|
|
||||||
Purges all installed ELPA packages (as they are considered temporary). Purges
|
Purges all installed ELPA packages (as they are considered temporary). Purges
|
||||||
|
@ -39,7 +40,8 @@ list remains lean."
|
||||||
(not noelpa-p)
|
(not noelpa-p)
|
||||||
(not norepos-p)
|
(not norepos-p)
|
||||||
(not nobuilds-p)
|
(not nobuilds-p)
|
||||||
regraft-p)
|
(not noregraft-p)
|
||||||
|
(not noeln-p))
|
||||||
(doom-autoloads-reload))
|
(doom-autoloads-reload))
|
||||||
t)
|
t)
|
||||||
|
|
||||||
|
@ -232,46 +234,11 @@ list remains lean."
|
||||||
(doom-log "Compiling %s" file)
|
(doom-log "Compiling %s" file)
|
||||||
(native-compile-async file))))
|
(native-compile-async file))))
|
||||||
|
|
||||||
(defun doom--bootstrap-trampolines ()
|
|
||||||
"Build the trampolines we need to prevent hanging."
|
|
||||||
(when (featurep 'comp)
|
|
||||||
;; HACK The following list was obtained by running 'doom build', waiting for
|
|
||||||
;; it to hang, then checking the eln-cache for trampolines. We
|
|
||||||
;; simulate running 'doom build' twice by compiling the trampolines
|
|
||||||
;; then restarting.
|
|
||||||
(let (restart)
|
|
||||||
(dolist (f '(abort-recursive-edit
|
|
||||||
describe-buffer-bindings
|
|
||||||
execute-kbd-macro
|
|
||||||
handle-switch-frame
|
|
||||||
load
|
|
||||||
make-indirect-buffer
|
|
||||||
make-process
|
|
||||||
message
|
|
||||||
read-char
|
|
||||||
read-key-sequence
|
|
||||||
select-window
|
|
||||||
set-window-buffer
|
|
||||||
top-level
|
|
||||||
use-global-map
|
|
||||||
use-local-map
|
|
||||||
write-region))
|
|
||||||
(unless (doom--find-eln-file
|
|
||||||
(concat comp-native-version-dir "/"
|
|
||||||
(comp-trampoline-filename f)))
|
|
||||||
(print! (info "Compiling trampoline for %s") f)
|
|
||||||
(comp-trampoline-compile f)
|
|
||||||
(setq restart t)))
|
|
||||||
(when restart
|
|
||||||
(throw 'exit :restart)))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun doom-cli-packages-install ()
|
(defun doom-cli-packages-install ()
|
||||||
"Installs missing packages.
|
"Installs missing packages.
|
||||||
|
|
||||||
This function will install any primary package (i.e. a package with a `package!'
|
This function will install any primary package (i.e. a package with a `package!'
|
||||||
declaration) or dependency thereof that hasn't already been."
|
declaration) or dependency thereof that hasn't already been."
|
||||||
(doom--bootstrap-trampolines)
|
|
||||||
(doom-initialize-packages)
|
(doom-initialize-packages)
|
||||||
(print! (start "Installing packages..."))
|
(print! (start "Installing packages..."))
|
||||||
(let ((pinned (doom-package-pinned-list)))
|
(let ((pinned (doom-package-pinned-list)))
|
||||||
|
@ -311,7 +278,6 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
|
|
||||||
(defun doom-cli-packages-build (&optional force-p)
|
(defun doom-cli-packages-build (&optional force-p)
|
||||||
"(Re)build all packages."
|
"(Re)build all packages."
|
||||||
(doom--bootstrap-trampolines)
|
|
||||||
(doom-initialize-packages)
|
(doom-initialize-packages)
|
||||||
(print! (start "(Re)building %spackages...") (if force-p "all " ""))
|
(print! (start "(Re)building %spackages...") (if force-p "all " ""))
|
||||||
(print-group!
|
(print-group!
|
||||||
|
@ -335,19 +301,31 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
(doom--with-package-recipes recipes (package local-repo recipe)
|
(doom--with-package-recipes recipes (package local-repo recipe)
|
||||||
(unless force-p
|
(unless force-p
|
||||||
;; Ensure packages with outdated files/bytecode are rebuilt
|
;; Ensure packages with outdated files/bytecode are rebuilt
|
||||||
(let ((build-dir (straight--build-dir package))
|
(let* ((build-dir (straight--build-dir package))
|
||||||
(repo-dir (straight--repos-dir local-repo)))
|
(repo-dir (straight--repos-dir local-repo))
|
||||||
(and (not (plist-get recipe :no-build))
|
(build (if (plist-member recipe :build)
|
||||||
|
(plist-get recipe :build)
|
||||||
|
t))
|
||||||
|
(want-byte-compile
|
||||||
|
(or (eq build t)
|
||||||
|
(memq 'compile build)))
|
||||||
|
(want-native-compile
|
||||||
|
(or (eq build t)
|
||||||
|
(memq 'native-compile build))))
|
||||||
|
(when (eq (car-safe build) :not)
|
||||||
|
(setq want-byte-compile (not want-byte-compile)
|
||||||
|
want-native-compile (not want-native-compile)))
|
||||||
|
(unless (require 'comp nil t)
|
||||||
|
(setq want-native-compile nil))
|
||||||
|
(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 want-byte = (straight--byte-compile-package-p recipe)
|
(cl-loop with outdated = nil
|
||||||
with want-native = (if (require 'comp nil t) (straight--native-compile-package-p recipe))
|
|
||||||
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 (doom--elc-file-outdated-p file))
|
if (or (if want-byte-compile (doom--elc-file-outdated-p file))
|
||||||
(if want-native (doom--eln-file-outdated-p file)))
|
(if want-native-compile (doom--eln-file-outdated-p file)))
|
||||||
do (setq outdated t)
|
do (setq outdated t)
|
||||||
(when want-native
|
(when want-native-compile
|
||||||
(push file doom--eln-output-expected))
|
(push file doom--eln-output-expected))
|
||||||
finally return outdated))
|
finally return outdated))
|
||||||
(puthash package t straight--packages-to-rebuild))))
|
(puthash package t straight--packages-to-rebuild))))
|
||||||
|
@ -357,7 +335,7 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
(doom--wait-for-compile-jobs)
|
(doom--wait-for-compile-jobs)
|
||||||
(doom--write-missing-eln-errors)
|
(doom--write-missing-eln-errors)
|
||||||
(print! (success "\033[KRebuilt %d package(s)") (length built)))
|
(print! (success "\033[KRebuilt %d package(s)") (length built)))
|
||||||
(print! (success "No packages need rebuilding"))
|
(print! (info "No packages need rebuilding"))
|
||||||
nil))))
|
nil))))
|
||||||
|
|
||||||
|
|
||||||
|
@ -556,7 +534,23 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
(filename path)
|
(filename path)
|
||||||
e)))))))
|
e)))))))
|
||||||
|
|
||||||
(defun doom-cli-packages-purge (&optional elpa-p builds-p repos-p regraft-repos-p)
|
(defun doom--cli-packages-purge-eln ()
|
||||||
|
(if-let (dirs
|
||||||
|
(cl-delete (expand-file-name comp-native-version-dir doom--eln-output-path)
|
||||||
|
(directory-files doom--eln-output-path t "^[^.]" t)
|
||||||
|
:test #'file-equal-p))
|
||||||
|
(progn
|
||||||
|
(print! (start "Purging old native bytecode..."))
|
||||||
|
(print-group!
|
||||||
|
(dolist (dir dirs)
|
||||||
|
(print! (info "Deleting %S") (relpath dir doom--eln-output-path))
|
||||||
|
(delete-directory dir 'recursive))
|
||||||
|
(print! (success "Purged %d directory(ies)" (length dirs))))
|
||||||
|
(length dirs))
|
||||||
|
(print! (info "No ELN directories to purge"))
|
||||||
|
0))
|
||||||
|
|
||||||
|
(defun doom-cli-packages-purge (&optional elpa-p builds-p repos-p regraft-repos-p eln-p)
|
||||||
"Auto-removes orphaned packages and repos.
|
"Auto-removes orphaned packages and repos.
|
||||||
|
|
||||||
An orphaned package is a package that isn't a primary package (i.e. doesn't have
|
An orphaned package is a package that isn't a primary package (i.e. doesn't have
|
||||||
|
@ -598,4 +592,8 @@ If ELPA-P, include packages installed with package.el (M-x package-install)."
|
||||||
(/= 0 (doom--cli-packages-purge-repos repos-to-purge)))
|
(/= 0 (doom--cli-packages-purge-repos repos-to-purge)))
|
||||||
(if (not regraft-repos-p)
|
(if (not regraft-repos-p)
|
||||||
(ignore (print! (info "Skipping regrafting")))
|
(ignore (print! (info "Skipping regrafting")))
|
||||||
(doom--cli-packages-regraft-repos repos-to-regraft)))))))
|
(doom--cli-packages-regraft-repos repos-to-regraft))
|
||||||
|
(when (require 'comp nil t)
|
||||||
|
(if (not eln-p)
|
||||||
|
(ignore (print! (info "Skipping native bytecode")))
|
||||||
|
(doom--cli-packages-purge-eln))))))))
|
||||||
|
|
|
@ -31,7 +31,7 @@ stale."
|
||||||
(doom-cli-packages-build)
|
(doom-cli-packages-build)
|
||||||
(when update-p
|
(when update-p
|
||||||
(doom-cli-packages-update))
|
(doom-cli-packages-update))
|
||||||
(doom-cli-packages-purge purge-p 'builds-p purge-p purge-p)
|
(doom-cli-packages-purge purge-p 'builds-p purge-p purge-p purge-p)
|
||||||
(run-hooks 'doom-sync-post-hook)
|
(run-hooks 'doom-sync-post-hook)
|
||||||
(when (doom-autoloads-reload)
|
(when (doom-autoloads-reload)
|
||||||
(print! (info "Restart Emacs or use 'M-x doom/reload' for changes to take effect")))
|
(print! (info "Restart Emacs or use 'M-x doom/reload' for changes to take effect")))
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
;; Don't generate superfluous files when writing temp buffers
|
;; Don't generate superfluous files when writing temp buffers
|
||||||
(setq make-backup-files nil)
|
(setq make-backup-files nil)
|
||||||
|
|
||||||
;; Stop user configuration from interfering with Doom
|
;; Stop user configuration from interfering with package management
|
||||||
(setq enable-dir-local-variables nil)
|
(setq enable-dir-local-variables nil)
|
||||||
|
|
||||||
|
|
||||||
|
@ -260,8 +260,9 @@ BODY will be run when this dispatcher is called."
|
||||||
(string-match-p (regexp-quote straight-process-buffer)
|
(string-match-p (regexp-quote straight-process-buffer)
|
||||||
data))
|
data))
|
||||||
(print! (error "There was an unexpected package error"))
|
(print! (error "There was an unexpected package error"))
|
||||||
|
(when-let (output (straight--process-get-output))
|
||||||
(print-group!
|
(print-group!
|
||||||
(print! "%s" (string-trim-right (straight--process-get-output)))))
|
(print! "%s" (string-trim-right output)))))
|
||||||
((print! (error "There was an unexpected error"))
|
((print! (error "There was an unexpected error"))
|
||||||
(print-group!
|
(print-group!
|
||||||
(print! "%s %s" (bold "Message:") (get type 'error-message))
|
(print! "%s %s" (bold "Message:") (get type 'error-message))
|
||||||
|
@ -424,6 +425,18 @@ everywhere we use it (and internally)."
|
||||||
cause)
|
cause)
|
||||||
interactive)))
|
interactive)))
|
||||||
|
|
||||||
|
(defadvice! doom--straight-inject-load-path-a (orig-fn &rest args)
|
||||||
|
"Straight builds packages in an isolated Emacs child process, which means
|
||||||
|
needed packages may not be accessible when a package is compiled."
|
||||||
|
:override #'straight--build-compile
|
||||||
|
(let* ((package (plist-get recipe :package))
|
||||||
|
(dir (straight--build-dir package)))
|
||||||
|
(call-process (concat invocation-directory invocation-name)
|
||||||
|
nil straight-byte-compilation-buffer nil
|
||||||
|
"-Q" "--batch"
|
||||||
|
"--eval" (prin1-to-string `(setq load-path (cons ,dir ',load-path)))
|
||||||
|
"--eval" (format "(byte-recompile-directory %S 0 'force)" dir))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Entry point
|
;;; Entry point
|
||||||
|
|
|
@ -9,7 +9,10 @@ detected.")
|
||||||
indentation settings or not. This should be set by editorconfig if it
|
indentation settings or not. This should be set by editorconfig if it
|
||||||
successfully sets indent_style/indent_size.")
|
successfully sets indent_style/indent_size.")
|
||||||
|
|
||||||
(defvar-local doom-large-file-p nil)
|
(defvar doom-inhibit-large-file-detection nil
|
||||||
|
"If non-nil, inhibit large/long file detection when opening files.")
|
||||||
|
|
||||||
|
(defvar doom-large-file-p nil)
|
||||||
(put 'doom-large-file-p 'permanent-local t)
|
(put 'doom-large-file-p 'permanent-local t)
|
||||||
|
|
||||||
(defvar doom-large-file-size-alist '(("." . 1.0))
|
(defvar doom-large-file-size-alist '(("." . 1.0))
|
||||||
|
@ -40,21 +43,25 @@ runtime costs (or disable themselves) to ensure the buffer is as fast as
|
||||||
possible."
|
possible."
|
||||||
:before #'abort-if-file-too-large
|
:before #'abort-if-file-too-large
|
||||||
(and (numberp size)
|
(and (numberp size)
|
||||||
|
(null doom-inhibit-large-file-detection)
|
||||||
|
(ignore-errors
|
||||||
(> size
|
(> size
|
||||||
(* 1024 1024
|
(* 1024 1024
|
||||||
(assoc-default filename doom-large-file-size-alist
|
(assoc-default filename doom-large-file-size-alist
|
||||||
#'string-match-p)))
|
#'string-match-p))))
|
||||||
(setq doom-large-file-p size)))
|
(setq-local doom-large-file-p size)))
|
||||||
|
|
||||||
(defadvice! doom--optimize-for-large-files-a (&rest _)
|
(add-hook! 'find-file-hook
|
||||||
|
(defun doom-optimize-for-large-files-h ()
|
||||||
"Trigger `so-long-minor-mode' if the file is large."
|
"Trigger `so-long-minor-mode' if the file is large."
|
||||||
:after #'after-find-file
|
|
||||||
(when (and doom-large-file-p buffer-file-name)
|
(when (and doom-large-file-p buffer-file-name)
|
||||||
(if (memq major-mode doom-large-file-excluded-modes)
|
(if (or doom-inhibit-large-file-detection
|
||||||
(setq doom-large-file-p nil)
|
(memq major-mode doom-large-file-excluded-modes))
|
||||||
|
(kill-local-variable 'doom-large-file-p)
|
||||||
(when (fboundp 'so-long-minor-mode) ; in case the user disabled it
|
(when (fboundp 'so-long-minor-mode) ; in case the user disabled it
|
||||||
(so-long-minor-mode +1))
|
(so-long-minor-mode +1))
|
||||||
(message "Large file detected! Cutting a few corners to improve performance..."))))
|
(message "Large file detected! Cutting a few corners to improve performance...")))))
|
||||||
|
|
||||||
|
|
||||||
;; Resolve symlinks when opening files, so that any operations are conducted
|
;; Resolve symlinks when opening files, so that any operations are conducted
|
||||||
;; from the file's true directory (like `find-file').
|
;; from the file's true directory (like `find-file').
|
||||||
|
@ -65,19 +72,6 @@ possible."
|
||||||
;; warning as it will redirect you to the existing buffer anyway.
|
;; warning as it will redirect you to the existing buffer anyway.
|
||||||
(setq find-file-suppress-same-file-warnings t)
|
(setq find-file-suppress-same-file-warnings t)
|
||||||
|
|
||||||
;; Create missing directories when we open a file that doesn't exist under a
|
|
||||||
;; directory tree that may not exist.
|
|
||||||
(add-hook! 'find-file-not-found-functions
|
|
||||||
(defun doom-create-missing-directories-h ()
|
|
||||||
"Automatically create missing directories when creating new files."
|
|
||||||
(unless (file-remote-p buffer-file-name)
|
|
||||||
(let ((parent-directory (file-name-directory buffer-file-name)))
|
|
||||||
(and (not (file-directory-p parent-directory))
|
|
||||||
(y-or-n-p (format "Directory `%s' does not exist! Create it?"
|
|
||||||
parent-directory))
|
|
||||||
(progn (make-directory parent-directory 'parents)
|
|
||||||
t))))))
|
|
||||||
|
|
||||||
;; Don't generate backups or lockfiles. While auto-save maintains a copy so long
|
;; Don't generate backups or lockfiles. While auto-save maintains a copy so long
|
||||||
;; as a buffer is unsaved, backups create copies once, when the file is first
|
;; as a buffer is unsaved, backups create copies once, when the file is first
|
||||||
;; written, and never again until it is killed and reopened. This is better
|
;; written, and never again until it is killed and reopened. This is better
|
||||||
|
@ -101,7 +95,7 @@ possible."
|
||||||
;; the purpose of a failsafe. This adds the risk of losing the data we
|
;; the purpose of a failsafe. This adds the risk of losing the data we
|
||||||
;; just deleted, but I believe that's VCS's jurisdiction, not ours.
|
;; just deleted, but I believe that's VCS's jurisdiction, not ours.
|
||||||
auto-save-include-big-deletions t
|
auto-save-include-big-deletions t
|
||||||
;; ...but have directories set up in case we use it.
|
;; Keep it out of `doom-emacs-dir' or the local directory.
|
||||||
auto-save-list-file-prefix (concat doom-cache-dir "autosave/")
|
auto-save-list-file-prefix (concat doom-cache-dir "autosave/")
|
||||||
tramp-auto-save-directory (concat doom-cache-dir "tramp-autosave/")
|
tramp-auto-save-directory (concat doom-cache-dir "tramp-autosave/")
|
||||||
auto-save-file-name-transforms
|
auto-save-file-name-transforms
|
||||||
|
@ -112,7 +106,10 @@ possible."
|
||||||
|
|
||||||
(add-hook! 'after-save-hook
|
(add-hook! 'after-save-hook
|
||||||
(defun doom-guess-mode-h ()
|
(defun doom-guess-mode-h ()
|
||||||
"Guess mode when saving a file in `fundamental-mode'."
|
"Guess major mode when saving a file in `fundamental-mode'.
|
||||||
|
|
||||||
|
Likely, something has changed since the buffer was opened. e.g. A shebang line
|
||||||
|
or file path may exist now."
|
||||||
(when (eq major-mode 'fundamental-mode)
|
(when (eq major-mode 'fundamental-mode)
|
||||||
(let ((buffer (or (buffer-base-buffer) (current-buffer))))
|
(let ((buffer (or (buffer-base-buffer) (current-buffer))))
|
||||||
(and (buffer-file-name buffer)
|
(and (buffer-file-name buffer)
|
||||||
|
@ -161,7 +158,7 @@ possible."
|
||||||
;; The POSIX standard defines a line is "a sequence of zero or more non-newline
|
;; The POSIX standard defines a line is "a sequence of zero or more non-newline
|
||||||
;; characters followed by a terminating newline", so files should end in a
|
;; characters followed by a terminating newline", so files should end in a
|
||||||
;; newline. Windows doesn't respect this (because it's Windows), but we should,
|
;; newline. Windows doesn't respect this (because it's Windows), but we should,
|
||||||
;; since programmers' tools tend to be POSIX compliant.
|
;; since programmers' tools tend to be POSIX compliant (and no big deal if not).
|
||||||
(setq require-final-newline t)
|
(setq require-final-newline t)
|
||||||
|
|
||||||
;; Default to soft line-wrapping in text modes. It is more sensibile for text
|
;; Default to soft line-wrapping in text modes. It is more sensibile for text
|
||||||
|
@ -331,6 +328,7 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||||
(when-let (name (getenv "EMACS_SERVER_NAME"))
|
(when-let (name (getenv "EMACS_SERVER_NAME"))
|
||||||
(setq server-name name))
|
(setq server-name name))
|
||||||
:config
|
:config
|
||||||
|
(setq server-auth-dir (concat doom-emacs-dir "server/"))
|
||||||
(unless (server-running-p)
|
(unless (server-running-p)
|
||||||
(server-start)))
|
(server-start)))
|
||||||
|
|
||||||
|
@ -486,7 +484,12 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||||
;; correct this vile injustice.
|
;; correct this vile injustice.
|
||||||
(setq sp-show-pair-from-inside t)
|
(setq sp-show-pair-from-inside t)
|
||||||
;; ...and stay highlighted until we've truly escaped the pair!
|
;; ...and stay highlighted until we've truly escaped the pair!
|
||||||
(setq sp-cancel-autoskip-on-backward-movement nil))
|
(setq sp-cancel-autoskip-on-backward-movement nil)
|
||||||
|
;; Smartparens conditional binds a key to C-g when sp overlays are active
|
||||||
|
;; (even if they're invisible). This disruptively changes the behavior of
|
||||||
|
;; C-g in insert mode, requiring two presses of the key to exit insert mode.
|
||||||
|
;; I don't see the point of this keybind, so...
|
||||||
|
(setq sp-pair-overlay-keymap (make-sparse-keymap)))
|
||||||
|
|
||||||
;; The default is 100, because smartparen's scans are relatively expensive
|
;; The default is 100, because smartparen's scans are relatively expensive
|
||||||
;; (especially with large pair lists for some modes), we reduce it, as a
|
;; (especially with large pair lists for some modes), we reduce it, as a
|
||||||
|
@ -495,21 +498,25 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||||
;; No pair has any business being longer than 4 characters; if they must, set
|
;; No pair has any business being longer than 4 characters; if they must, set
|
||||||
;; it buffer-locally. It's less work for smartparens.
|
;; it buffer-locally. It's less work for smartparens.
|
||||||
(setq sp-max-pair-length 4)
|
(setq sp-max-pair-length 4)
|
||||||
;; This isn't always smart enough to determine when we're in a string or not.
|
|
||||||
;; See https://github.com/Fuco1/smartparens/issues/783.
|
|
||||||
(setq sp-escape-quotes-after-insert nil)
|
|
||||||
|
|
||||||
;; Silence some harmless but annoying echo-area spam
|
;; Silence some harmless but annoying echo-area spam
|
||||||
(dolist (key '(:unmatched-expression :no-matching-tag))
|
(dolist (key '(:unmatched-expression :no-matching-tag))
|
||||||
(setf (alist-get key sp-message-alist) nil))
|
(setf (alist-get key sp-message-alist) nil))
|
||||||
|
|
||||||
|
(add-hook! 'eval-expression-minibuffer-setup-hook
|
||||||
|
(defun doom-init-smartparens-in-eval-expression-h ()
|
||||||
|
"Enable `smartparens-mode' in the minibuffer for `eval-expression'.
|
||||||
|
This includes everything that calls `read--expression', e.g.
|
||||||
|
`edebug-eval-expression' Only enable it if
|
||||||
|
`smartparens-global-mode' is on."
|
||||||
|
(when smartparens-global-mode (smartparens-mode +1))))
|
||||||
(add-hook! 'minibuffer-setup-hook
|
(add-hook! 'minibuffer-setup-hook
|
||||||
(defun doom-init-smartparens-in-minibuffer-maybe-h ()
|
(defun doom-init-smartparens-in-minibuffer-maybe-h ()
|
||||||
"Enable `smartparens-mode' in the minibuffer, during `eval-expression',
|
"Enable `smartparens' for non-`eval-expression' commands.
|
||||||
`pp-eval-expression' or `evil-ex'."
|
Only enable `smartparens-mode' if `smartparens-global-mode' is
|
||||||
(and (memq this-command '(eval-expression pp-eval-expression evil-ex))
|
on."
|
||||||
smartparens-global-mode
|
(when (and smartparens-global-mode (memq this-command '(evil-ex)))
|
||||||
(smartparens-mode))))
|
(smartparens-mode +1))))
|
||||||
|
|
||||||
;; You're likely writing lisp in the minibuffer, therefore, disable these
|
;; You're likely writing lisp in the minibuffer, therefore, disable these
|
||||||
;; quote pairs, which lisps doesn't use for strings:
|
;; quote pairs, which lisps doesn't use for strings:
|
||||||
|
@ -545,8 +552,6 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||||
(add-to-list 'so-long-variable-overrides '(font-lock-maximum-decoration . 1))
|
(add-to-list 'so-long-variable-overrides '(font-lock-maximum-decoration . 1))
|
||||||
;; ...and insist that save-place not operate in large/long files
|
;; ...and insist that save-place not operate in large/long files
|
||||||
(add-to-list 'so-long-variable-overrides '(save-place-alist . nil))
|
(add-to-list 'so-long-variable-overrides '(save-place-alist . nil))
|
||||||
;; Text files could possibly be too long too
|
|
||||||
(add-to-list 'so-long-target-modes 'text-mode)
|
|
||||||
;; But disable everything else that may be unnecessary/expensive for large or
|
;; But disable everything else that may be unnecessary/expensive for large or
|
||||||
;; wide buffers.
|
;; wide buffers.
|
||||||
(appendq! so-long-minor-modes
|
(appendq! so-long-minor-modes
|
||||||
|
@ -563,11 +568,11 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||||
highlight-indent-guides-mode
|
highlight-indent-guides-mode
|
||||||
hl-fill-column-mode))
|
hl-fill-column-mode))
|
||||||
(defun doom-buffer-has-long-lines-p ()
|
(defun doom-buffer-has-long-lines-p ()
|
||||||
;; HACK Fix #2183: `so-long-detected-long-line-p' tries to parse comment
|
|
||||||
;; syntax, but in some buffers comment state isn't initialized, leading
|
|
||||||
;; to a wrong-type-argument: stringp error.
|
|
||||||
(unless (bound-and-true-p visual-line-mode)
|
(unless (bound-and-true-p visual-line-mode)
|
||||||
(let ((so-long-skip-leading-comments
|
(let ((so-long-skip-leading-comments
|
||||||
|
;; HACK Fix #2183: `so-long-detected-long-line-p' tries to parse
|
||||||
|
;; comment syntax, but comment state may not be initialized,
|
||||||
|
;; leading to a wrong-type-argument: stringp error.
|
||||||
(bound-and-true-p comment-use-syntax)))
|
(bound-and-true-p comment-use-syntax)))
|
||||||
(so-long-detected-long-line-p))))
|
(so-long-detected-long-line-p))))
|
||||||
(setq so-long-predicate #'doom-buffer-has-long-lines-p))
|
(setq so-long-predicate #'doom-buffer-has-long-lines-p))
|
||||||
|
|
|
@ -39,6 +39,21 @@ and Emacs states, and for non-evil users.")
|
||||||
(setq w32-lwindow-modifier 'super
|
(setq w32-lwindow-modifier 'super
|
||||||
w32-rwindow-modifier 'super)))
|
w32-rwindow-modifier 'super)))
|
||||||
|
|
||||||
|
;; HACK Fixes Emacs' disturbing inability to distinguish C-i from TAB.
|
||||||
|
(define-key key-translation-map [?\C-i]
|
||||||
|
(cmd! (if (let ((keys (this-single-command-raw-keys)))
|
||||||
|
(and keys
|
||||||
|
(not (cl-position 'tab keys))
|
||||||
|
(not (cl-position 'kp-tab keys))
|
||||||
|
(display-graphic-p)
|
||||||
|
;; Fall back if no <C-i> keybind can be found, otherwise
|
||||||
|
;; we've broken all pre-existing C-i keybinds.
|
||||||
|
(let ((key
|
||||||
|
(doom-lookup-key
|
||||||
|
(vconcat (cl-subseq keys 0 -1) [C-i]))))
|
||||||
|
(not (or (numberp key) (null key))))))
|
||||||
|
[C-i] [?\C-i])))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Universal, non-nuclear escape
|
;;; Universal, non-nuclear escape
|
||||||
|
@ -63,18 +78,22 @@ and Emacs states, and for non-evil users.")
|
||||||
More specifically, when `doom/escape' is pressed. If any hook returns non-nil,
|
More specifically, when `doom/escape' is pressed. If any hook returns non-nil,
|
||||||
all hooks after it are ignored.")
|
all hooks after it are ignored.")
|
||||||
|
|
||||||
(defun doom/escape ()
|
(defun doom/escape (&optional interactive)
|
||||||
"Run `doom-escape-hook'."
|
"Run `doom-escape-hook'."
|
||||||
(interactive)
|
(interactive (list 'interactive))
|
||||||
(cond ((minibuffer-window-active-p (minibuffer-window))
|
(cond ((minibuffer-window-active-p (minibuffer-window))
|
||||||
;; quit the minibuffer if open.
|
;; quit the minibuffer if open.
|
||||||
|
(when interactive
|
||||||
|
(setq this-command 'abort-recursive-edit))
|
||||||
(abort-recursive-edit))
|
(abort-recursive-edit))
|
||||||
;; Run all escape hooks. If any returns non-nil, then stop there.
|
;; Run all escape hooks. If any returns non-nil, then stop there.
|
||||||
((run-hook-with-args-until-success 'doom-escape-hook))
|
((run-hook-with-args-until-success 'doom-escape-hook))
|
||||||
;; don't abort macros
|
;; don't abort macros
|
||||||
((or defining-kbd-macro executing-kbd-macro) nil)
|
((or defining-kbd-macro executing-kbd-macro) nil)
|
||||||
;; Back to the default
|
;; Back to the default
|
||||||
((keyboard-quit))))
|
((unwind-protect (keyboard-quit)
|
||||||
|
(when interactive
|
||||||
|
(setq this-command 'keyboard-quit))))))
|
||||||
|
|
||||||
(global-set-key [remap keyboard-quit] #'doom/escape)
|
(global-set-key [remap keyboard-quit] #'doom/escape)
|
||||||
|
|
||||||
|
|
180
core/core-lib.el
180
core/core-lib.el
|
@ -67,8 +67,8 @@ list is returned as-is."
|
||||||
|
|
||||||
(defmacro doom-log (format-string &rest args)
|
(defmacro doom-log (format-string &rest args)
|
||||||
"Log to *Messages* if `doom-debug-p' is on.
|
"Log to *Messages* if `doom-debug-p' is on.
|
||||||
Does not interrupt the minibuffer if it is in use, but still logs to *Messages*.
|
Does not display text in echo area, but still logs to *Messages*. Accepts the
|
||||||
Accepts the same arguments as `message'."
|
same arguments as `message'."
|
||||||
`(when doom-debug-p
|
`(when doom-debug-p
|
||||||
(let ((inhibit-message (active-minibuffer-window)))
|
(let ((inhibit-message (active-minibuffer-window)))
|
||||||
(message
|
(message
|
||||||
|
@ -85,7 +85,7 @@ Accepts the same arguments as `message'."
|
||||||
(defalias 'doom-partial #'apply-partially)
|
(defalias 'doom-partial #'apply-partially)
|
||||||
|
|
||||||
(defun doom-rpartial (fn &rest args)
|
(defun doom-rpartial (fn &rest args)
|
||||||
"Return a function that is a partial application of FUN to right-hand ARGS.
|
"Return a partial application of FUN to right-hand ARGS.
|
||||||
|
|
||||||
ARGS is a list of the last N arguments to pass to FUN. The result is a new
|
ARGS is a list of the last N arguments to pass to FUN. The result is a new
|
||||||
function which does the same as FUN, except that the last N arguments are fixed
|
function which does the same as FUN, except that the last N arguments are fixed
|
||||||
|
@ -94,6 +94,24 @@ at the values with which this function was called."
|
||||||
(lambda (&rest pre-args)
|
(lambda (&rest pre-args)
|
||||||
(apply fn (append pre-args args))))
|
(apply fn (append pre-args args))))
|
||||||
|
|
||||||
|
(defun doom-lookup-key (keys &optional keymap)
|
||||||
|
"Like `lookup-key', but search active keymaps if KEYMAP is omitted."
|
||||||
|
(if keymap
|
||||||
|
(lookup-key keymap keys)
|
||||||
|
(cl-loop for keymap
|
||||||
|
in (append (cl-loop for alist in emulation-mode-map-alists
|
||||||
|
append (mapcar #'cdr
|
||||||
|
(if (symbolp alist)
|
||||||
|
(if (boundp alist) (symbol-value alist))
|
||||||
|
alist)))
|
||||||
|
(list (current-local-map))
|
||||||
|
(mapcar #'cdr minor-mode-overriding-map-alist)
|
||||||
|
(mapcar #'cdr minor-mode-map-alist)
|
||||||
|
(list (current-global-map)))
|
||||||
|
if (keymapp keymap)
|
||||||
|
if (lookup-key keymap keys)
|
||||||
|
return it)))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Sugars
|
;;; Sugars
|
||||||
|
@ -123,6 +141,7 @@ at the values with which this function was called."
|
||||||
|
|
||||||
(defmacro letf! (bindings &rest body)
|
(defmacro letf! (bindings &rest body)
|
||||||
"Temporarily rebind function and macros in BODY.
|
"Temporarily rebind function and macros in BODY.
|
||||||
|
Intended as a simpler version of `cl-letf' and `cl-macrolet'.
|
||||||
|
|
||||||
BINDINGS is either a) a list of, or a single, `defun' or `defmacro'-ish form, or
|
BINDINGS is either a) a list of, or a single, `defun' or `defmacro'-ish form, or
|
||||||
b) a list of (PLACE VALUE) bindings as `cl-letf*' would accept.
|
b) a list of (PLACE VALUE) bindings as `cl-letf*' would accept.
|
||||||
|
@ -157,7 +176,8 @@ the same name, for use with `funcall' or `apply'. ARGLIST and BODY are as in
|
||||||
"Run FORMS without generating any output.
|
"Run FORMS without generating any output.
|
||||||
|
|
||||||
This silences calls to `message', `load', `write-region' and anything that
|
This silences calls to `message', `load', `write-region' and anything that
|
||||||
writes to `standard-output'."
|
writes to `standard-output'. In interactive sessions this won't suppress writing
|
||||||
|
to *Messages*, only inhibit output in the echo area."
|
||||||
`(if doom-debug-p
|
`(if doom-debug-p
|
||||||
(progn ,@forms)
|
(progn ,@forms)
|
||||||
,(if doom-interactive-p
|
,(if doom-interactive-p
|
||||||
|
@ -193,21 +213,24 @@ See `eval-if!' for details on this macro's purpose."
|
||||||
|
|
||||||
;;; Closure factories
|
;;; Closure factories
|
||||||
(defmacro fn! (arglist &rest body)
|
(defmacro fn! (arglist &rest body)
|
||||||
"Expands to (cl-function (lambda ARGLIST BODY...))"
|
"Returns (cl-function (lambda ARGLIST BODY...))
|
||||||
|
The closure is wrapped in `cl-function', meaning ARGLIST will accept anything
|
||||||
|
`cl-defun' will. "
|
||||||
(declare (indent defun) (doc-string 1) (pure t) (side-effect-free t))
|
(declare (indent defun) (doc-string 1) (pure t) (side-effect-free t))
|
||||||
`(cl-function (lambda ,arglist ,@body)))
|
`(cl-function (lambda ,arglist ,@body)))
|
||||||
|
|
||||||
(defmacro cmd! (&rest body)
|
(defmacro cmd! (&rest body)
|
||||||
"Expands to (lambda () (interactive) ,@body).
|
"Returns (lambda () (interactive) ,@body)
|
||||||
A factory for quickly producing interaction commands, particularly for keybinds
|
A factory for quickly producing interaction commands, particularly for keybinds
|
||||||
or aliases."
|
or aliases."
|
||||||
(declare (doc-string 1) (pure t) (side-effect-free t))
|
(declare (doc-string 1) (pure t) (side-effect-free t))
|
||||||
`(lambda (&rest _) (interactive) ,@body))
|
`(lambda (&rest _) (interactive) ,@body))
|
||||||
|
|
||||||
(defmacro cmd!! (command &optional prefix-arg &rest args)
|
(defmacro cmd!! (command &optional prefix-arg &rest args)
|
||||||
"Expands to a closure that interactively calls COMMAND with ARGS.
|
"Returns a closure that interactively calls COMMAND with ARGS and PREFIX-ARG.
|
||||||
A factory for quickly producing interactive, prefixed commands for keybinds or
|
Like `cmd!', but allows you to change `current-prefix-arg' or pass arguments to
|
||||||
aliases."
|
COMMAND. This macro is meant to be used as a target for keybinds (e.g. with
|
||||||
|
`define-key' or `map!')."
|
||||||
(declare (doc-string 1) (pure t) (side-effect-free t))
|
(declare (doc-string 1) (pure t) (side-effect-free t))
|
||||||
`(lambda (arg &rest _) (interactive "P")
|
`(lambda (arg &rest _) (interactive "P")
|
||||||
(let ((current-prefix-arg (or ,prefix-arg arg)))
|
(let ((current-prefix-arg (or ,prefix-arg arg)))
|
||||||
|
@ -217,7 +240,20 @@ aliases."
|
||||||
,command ,@args))))
|
,command ,@args))))
|
||||||
|
|
||||||
(defmacro cmds! (&rest branches)
|
(defmacro cmds! (&rest branches)
|
||||||
"Expands to a `menu-item' dispatcher for keybinds."
|
"Returns a dispatcher that runs the a command in BRANCHES.
|
||||||
|
Meant to be used as a target for keybinds (e.g. with `define-key' or `map!').
|
||||||
|
|
||||||
|
BRANCHES is a flat list of CONDITION COMMAND pairs. CONDITION is a lisp form
|
||||||
|
that is evaluated when (and each time) the dispatcher is invoked. If it returns
|
||||||
|
non-nil, COMMAND is invoked, otherwise it falls through to the next pair.
|
||||||
|
|
||||||
|
The last element of BRANCHES can be a COMMANd with no CONDITION. This acts as
|
||||||
|
the fallback if all other conditions fail.
|
||||||
|
|
||||||
|
Otherwise, Emacs will fall through the keybind and search the next keymap for a
|
||||||
|
keybind (as if this keybind never existed).
|
||||||
|
|
||||||
|
See `general-key-dispatch' for what other arguments it accepts in BRANCHES."
|
||||||
(declare (doc-string 1))
|
(declare (doc-string 1))
|
||||||
(let ((docstring (if (stringp (car branches)) (pop branches) ""))
|
(let ((docstring (if (stringp (car branches)) (pop branches) ""))
|
||||||
fallback)
|
fallback)
|
||||||
|
@ -228,6 +264,8 @@ aliases."
|
||||||
:docstring ,docstring
|
:docstring ,docstring
|
||||||
,@branches)))
|
,@branches)))
|
||||||
|
|
||||||
|
(defalias 'kbd! 'general-simulate-key)
|
||||||
|
|
||||||
;; For backwards compatibility
|
;; For backwards compatibility
|
||||||
(defalias 'λ! 'cmd!)
|
(defalias 'λ! 'cmd!)
|
||||||
(defalias 'λ!! 'cmd!!)
|
(defalias 'λ!! 'cmd!!)
|
||||||
|
@ -612,7 +650,7 @@ set earlier in the ‘setq-local’. The return value of the
|
||||||
(macroexp-progn (nreverse expr)))))
|
(macroexp-progn (nreverse expr)))))
|
||||||
|
|
||||||
(eval-when! (version< emacs-version "27.1")
|
(eval-when! (version< emacs-version "27.1")
|
||||||
;; DEPRECATED Backported from Emacs 27; earlier verisons don't have REMOTE arg
|
;; DEPRECATED Backported from Emacs 27. Remove when 26.x support is dropped.
|
||||||
(defun executable-find (command &optional remote)
|
(defun executable-find (command &optional remote)
|
||||||
"Search for COMMAND in `exec-path' and return the absolute file name.
|
"Search for COMMAND in `exec-path' and return the absolute file name.
|
||||||
Return nil if COMMAND is not found anywhere in `exec-path'. If
|
Return nil if COMMAND is not found anywhere in `exec-path'. If
|
||||||
|
@ -633,5 +671,125 @@ REMOTE is non-nil, search on the remote host indicated by
|
||||||
(file-name-quote default-directory))))
|
(file-name-quote default-directory))))
|
||||||
(locate-file command exec-path exec-suffixes 1)))))
|
(locate-file command exec-path exec-suffixes 1)))))
|
||||||
|
|
||||||
|
(eval-when! (not (fboundp 'exec-path))
|
||||||
|
;; DEPRECATED Backported from Emacs 27.1. Remove when 26.x support is dropped.
|
||||||
|
(defun exec-path ()
|
||||||
|
"Return list of directories to search programs to run in remote subprocesses.
|
||||||
|
The remote host is identified by `default-directory'. For remote
|
||||||
|
hosts that do not support subprocesses, this returns `nil'.
|
||||||
|
If `default-directory' is a local directory, this function returns
|
||||||
|
the value of the variable `exec-path'."
|
||||||
|
(let ((handler (find-file-name-handler default-directory 'exec-path)))
|
||||||
|
(if handler
|
||||||
|
(funcall handler 'exec-path)
|
||||||
|
exec-path))))
|
||||||
|
|
||||||
|
;; DEPRECATED Remove once enough packages have adapted to these breaking changes.
|
||||||
|
(eval-when! EMACS28+
|
||||||
|
(defmacro define-obsolete-variable-alias (obsolete-name current-name &optional when docstring)
|
||||||
|
"Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
|
||||||
|
|
||||||
|
WHEN should be a string indicating when the variable was first
|
||||||
|
made obsolete, for example a date or a release number.
|
||||||
|
|
||||||
|
This macro evaluates all its parameters, and both OBSOLETE-NAME
|
||||||
|
and CURRENT-NAME should be symbols, so a typical usage would look like:
|
||||||
|
|
||||||
|
(define-obsolete-variable-alias 'foo-thing 'bar-thing \"27.1\")
|
||||||
|
|
||||||
|
This macro uses `defvaralias' and `make-obsolete-variable' (which see).
|
||||||
|
See the Info node `(elisp)Variable Aliases' for more details.
|
||||||
|
|
||||||
|
If CURRENT-NAME is a defcustom or a defvar (more generally, any variable
|
||||||
|
where OBSOLETE-NAME may be set, e.g. in an init file, before the
|
||||||
|
alias is defined), then the define-obsolete-variable-alias
|
||||||
|
statement should be evaluated before the defcustom, if user
|
||||||
|
customizations are to be respected. The simplest way to achieve
|
||||||
|
this is to place the alias statement before the defcustom (this
|
||||||
|
is not necessary for aliases that are autoloaded, or in files
|
||||||
|
dumped with Emacs). This is so that any user customizations are
|
||||||
|
applied before the defcustom tries to initialize the
|
||||||
|
variable (this is due to the way `defvaralias' works).
|
||||||
|
|
||||||
|
For the benefit of Customize, if OBSOLETE-NAME has
|
||||||
|
any of the following properties, they are copied to
|
||||||
|
CURRENT-NAME, if it does not already have them:
|
||||||
|
`saved-value', `saved-variable-comment'."
|
||||||
|
(declare (doc-string 4)
|
||||||
|
(advertised-calling-convention
|
||||||
|
(obsolete-name current-name when &optional docstring) "23.1"))
|
||||||
|
`(progn
|
||||||
|
(defvaralias ,obsolete-name ,current-name ,docstring)
|
||||||
|
(dolist (prop '(saved-value saved-variable-comment))
|
||||||
|
(and (get ,obsolete-name prop)
|
||||||
|
(null (get ,current-name prop))
|
||||||
|
(put ,current-name prop (get ,obsolete-name prop))))
|
||||||
|
(make-obsolete-variable ,obsolete-name ,current-name ,when)))
|
||||||
|
|
||||||
|
(defmacro define-obsolete-face-alias (obsolete-face current-face &optional when)
|
||||||
|
"Make OBSOLETE-FACE a face alias for CURRENT-FACE and mark it obsolete.
|
||||||
|
WHEN should be a string indicating when the face was first made
|
||||||
|
obsolete, for example a date or a release number."
|
||||||
|
`(progn (put ,obsolete-face 'face-alias ,current-face)
|
||||||
|
(put ,obsolete-face 'obsolete-face (or (purecopy ,when) t))))
|
||||||
|
|
||||||
|
(defmacro define-obsolete-function-alias (obsolete-name current-name &optional when docstring)
|
||||||
|
"Set OBSOLETE-NAME's function definition to CURRENT-NAME and mark it obsolete.
|
||||||
|
|
||||||
|
\(define-obsolete-function-alias \\='old-fun \\='new-fun \"22.1\" \"old-fun's doc.\")
|
||||||
|
|
||||||
|
is equivalent to the following two lines of code:
|
||||||
|
|
||||||
|
\(defalias \\='old-fun \\='new-fun \"old-fun's doc.\")
|
||||||
|
\(make-obsolete \\='old-fun \\='new-fun \"22.1\")
|
||||||
|
|
||||||
|
WHEN should be a string indicating when the function was first
|
||||||
|
made obsolete, for example a date or a release number.
|
||||||
|
|
||||||
|
See the docstrings of `defalias' and `make-obsolete' for more details."
|
||||||
|
(declare (doc-string 4))
|
||||||
|
`(progn (defalias ,obsolete-name ,current-name ,docstring)
|
||||||
|
(make-obsolete ,obsolete-name ,current-name ,when)))
|
||||||
|
|
||||||
|
(defadvice! doom--fix-wrong-number-of-args-during-byte-compile (recipe)
|
||||||
|
:override #'straight--build-compile
|
||||||
|
(let* ((package (plist-get recipe :package))
|
||||||
|
(dir (straight--build-dir package))
|
||||||
|
(program (concat invocation-directory invocation-name))
|
||||||
|
(args
|
||||||
|
`("-Q" "-L" ,dir
|
||||||
|
,@(apply #'append
|
||||||
|
(mapcar (lambda (d)
|
||||||
|
(let ((d (straight--build-dir d)))
|
||||||
|
(when (file-exists-p d) (list "-L" d))))
|
||||||
|
(straight--get-dependencies package)))
|
||||||
|
"--batch"
|
||||||
|
"--eval"
|
||||||
|
,(prin1-to-string
|
||||||
|
'(progn
|
||||||
|
(defmacro define-obsolete-face-alias (obsolete-face current-face &optional when)
|
||||||
|
`(progn (put ,obsolete-face 'face-alias ,current-face)
|
||||||
|
(put ,obsolete-face 'obsolete-face (or (purecopy ,when) t))))
|
||||||
|
(defmacro define-obsolete-function-alias (obsolete-name current-name &optional when docstring)
|
||||||
|
`(progn (defalias ,obsolete-name ,current-name ,docstring)
|
||||||
|
(make-obsolete ,obsolete-name ,current-name ,when)))
|
||||||
|
(defmacro define-obsolete-variable-alias (obsolete-name current-name &optional when docstring)
|
||||||
|
`(progn (defvaralias ,obsolete-name ,current-name ,docstring)
|
||||||
|
(dolist (prop '(saved-value saved-variable-comment))
|
||||||
|
(and (get ,obsolete-name prop)
|
||||||
|
(null (get ,current-name prop))
|
||||||
|
(put ,current-name prop (get ,obsolete-name prop))))
|
||||||
|
(make-obsolete-variable ,obsolete-name ,current-name ,when)))))
|
||||||
|
"--eval"
|
||||||
|
,(format "(byte-recompile-directory %S 0 'force)" dir))))
|
||||||
|
(when straight-byte-compilation-buffer
|
||||||
|
(with-current-buffer (get-buffer-create straight-byte-compilation-buffer)
|
||||||
|
(insert "\n$ " (replace-regexp-in-string
|
||||||
|
"\\(-L [^z-a]*? \\)"
|
||||||
|
"\\1\\\\ \n "
|
||||||
|
(string-join `(,program ,@args) " "))
|
||||||
|
"\n")))
|
||||||
|
(apply #'call-process program nil straight-byte-compilation-buffer nil args))))
|
||||||
|
|
||||||
(provide 'core-lib)
|
(provide 'core-lib)
|
||||||
;;; core-lib.el ends here
|
;;; core-lib.el ends here
|
||||||
|
|
|
@ -203,7 +203,7 @@ This doesn't require modules to be enabled. For enabled modules us
|
||||||
for default-directory in doom-modules-dirs
|
for default-directory in doom-modules-dirs
|
||||||
for path = (concat category "/" module "/" file)
|
for path = (concat category "/" module "/" file)
|
||||||
if (file-exists-p path)
|
if (file-exists-p path)
|
||||||
return (file-truename path)))
|
return (expand-file-name path)))
|
||||||
|
|
||||||
(defun doom-module-from-path (&optional path enabled-only)
|
(defun doom-module-from-path (&optional path enabled-only)
|
||||||
"Returns a cons cell (CATEGORY . MODULE) derived from PATH (a file path).
|
"Returns a cons cell (CATEGORY . MODULE) derived from PATH (a file path).
|
||||||
|
@ -218,7 +218,7 @@ If ENABLED-ONLY, return nil if the containing module isn't enabled."
|
||||||
(ignore-errors
|
(ignore-errors
|
||||||
(doom-module-from-path (file!))))
|
(doom-module-from-path (file!))))
|
||||||
(let* ((file-name-handler-alist nil)
|
(let* ((file-name-handler-alist nil)
|
||||||
(path (file-truename (or path (file!)))))
|
(path (expand-file-name (or path (file!)))))
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(cond ((string-match "/modules/\\([^/]+\\)/\\([^/]+\\)\\(?:/.*\\)?$" path)
|
(cond ((string-match "/modules/\\([^/]+\\)/\\([^/]+\\)\\(?:/.*\\)?$" path)
|
||||||
(when-let* ((category (doom-keyword-intern (match-string 1 path)))
|
(when-let* ((category (doom-keyword-intern (match-string 1 path)))
|
||||||
|
@ -226,9 +226,11 @@ If ENABLED-ONLY, return nil if the containing module isn't enabled."
|
||||||
(and (or (null enabled-only)
|
(and (or (null enabled-only)
|
||||||
(doom-module-p category module))
|
(doom-module-p category module))
|
||||||
(cons category module))))
|
(cons category module))))
|
||||||
((file-in-directory-p path doom-core-dir)
|
((or (string-match-p (concat "^" (regexp-quote doom-core-dir)) path)
|
||||||
|
(file-in-directory-p path doom-core-dir))
|
||||||
(cons :core (intern (file-name-base path))))
|
(cons :core (intern (file-name-base path))))
|
||||||
((file-in-directory-p path doom-private-dir)
|
((or (string-match-p (concat "^" (regexp-quote doom-private-dir)) path)
|
||||||
|
(file-in-directory-p path doom-private-dir))
|
||||||
(cons :private (intern (file-name-base path)))))))))
|
(cons :private (intern (file-name-base path)))))))))
|
||||||
|
|
||||||
(defun doom-module-load-path (&optional module-dirs)
|
(defun doom-module-load-path (&optional module-dirs)
|
||||||
|
@ -277,7 +279,7 @@ those directories. The first returned path is always `doom-private-dir'."
|
||||||
(:if (if (eval (cadr m) t)
|
(:if (if (eval (cadr m) t)
|
||||||
(push (caddr m) mplist)
|
(push (caddr m) mplist)
|
||||||
(prependq! mplist (cdddr m))))
|
(prependq! mplist (cdddr m))))
|
||||||
(test (if (or (eval (cadr m) t)
|
(test (if (xor (eval (cadr m) t)
|
||||||
(eq test :unless))
|
(eq test :unless))
|
||||||
(prependq! mplist (cddr m))))))
|
(prependq! mplist (cddr m))))))
|
||||||
((catch 'doom-modules
|
((catch 'doom-modules
|
||||||
|
@ -329,7 +331,7 @@ This value is cached. If REFRESH-P, then don't use the cached value."
|
||||||
use-package-minimum-reported-time (if doom-debug-p 0 0.1)
|
use-package-minimum-reported-time (if doom-debug-p 0 0.1)
|
||||||
use-package-expand-minimally doom-interactive-p)
|
use-package-expand-minimally doom-interactive-p)
|
||||||
|
|
||||||
;; A common mistake for new users is that they inadvertantly install their
|
;; A common mistake for new users is that they inadvertently install their
|
||||||
;; packages with package.el, by copying over old `use-package' declarations with
|
;; packages with package.el, by copying over old `use-package' declarations with
|
||||||
;; an :ensure t property. Doom doesn't use package.el, so this will throw an
|
;; an :ensure t property. Doom doesn't use package.el, so this will throw an
|
||||||
;; error that will confuse beginners, so we disable `:ensure'.
|
;; error that will confuse beginners, so we disable `:ensure'.
|
||||||
|
|
|
@ -99,9 +99,7 @@ uses a straight or package.el command directly).")
|
||||||
straight-vc-git-default-clone-depth 1
|
straight-vc-git-default-clone-depth 1
|
||||||
;; Prefix declarations are unneeded bulk added to our autoloads file. Best
|
;; Prefix declarations are unneeded bulk added to our autoloads file. Best
|
||||||
;; we don't have to deal with them at all.
|
;; we don't have to deal with them at all.
|
||||||
autoload-compute-prefixes nil
|
autoload-compute-prefixes nil)
|
||||||
;; We handle it ourselves
|
|
||||||
straight-fix-org nil)
|
|
||||||
|
|
||||||
(with-eval-after-load 'straight
|
(with-eval-after-load 'straight
|
||||||
;; `let-alist' is built into Emacs 26 and onwards
|
;; `let-alist' is built into Emacs 26 and onwards
|
||||||
|
@ -187,17 +185,18 @@ processed."
|
||||||
(error "Failed to initialize package.el")))
|
(error "Failed to initialize package.el")))
|
||||||
(when (or force-p (null doom-packages))
|
(when (or force-p (null doom-packages))
|
||||||
(doom-log "Initializing straight.el")
|
(doom-log "Initializing straight.el")
|
||||||
(or (setq doom-disabled-packages nil
|
(setq doom-disabled-packages nil
|
||||||
doom-packages (doom-package-list))
|
doom-packages (doom-package-list))
|
||||||
(error "Failed to read any packages"))
|
(let (packages)
|
||||||
(dolist (package doom-packages)
|
(dolist (package doom-packages)
|
||||||
(cl-destructuring-bind
|
(cl-destructuring-bind
|
||||||
(name &key recipe disable ignore shadow &allow-other-keys) package
|
(name &key recipe disable ignore shadow &allow-other-keys) package
|
||||||
(unless ignore
|
(if ignore
|
||||||
|
(straight-override-recipe (cons name '(:type built-in)))
|
||||||
(if disable
|
(if disable
|
||||||
(cl-pushnew name doom-disabled-packages)
|
(cl-pushnew name doom-disabled-packages)
|
||||||
(when shadow
|
(when shadow
|
||||||
(straight-override-recipe (cons shadow '(:local-repo nil)))
|
(straight-override-recipe (cons shadow `(:local-repo nil :package included :build nil :included-by ,name)))
|
||||||
(let ((site-load-path (copy-sequence doom--initial-load-path))
|
(let ((site-load-path (copy-sequence doom--initial-load-path))
|
||||||
lib)
|
lib)
|
||||||
(while (setq
|
(while (setq
|
||||||
|
@ -208,7 +207,12 @@ processed."
|
||||||
load-path (delete lib load-path))))))
|
load-path (delete lib load-path))))))
|
||||||
(when recipe
|
(when recipe
|
||||||
(straight-override-recipe (cons name recipe)))
|
(straight-override-recipe (cons name recipe)))
|
||||||
(straight-register-package name)))))))
|
(appendq! packages (cons name (straight--get-dependencies name)))))))
|
||||||
|
(dolist (package (cl-delete-duplicates packages :test #'equal))
|
||||||
|
(straight-register-package package)
|
||||||
|
(let ((name (symbol-name package)))
|
||||||
|
(add-to-list 'load-path (directory-file-name (straight--build-dir name)))
|
||||||
|
(straight--load-package-autoloads name))))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -231,7 +235,12 @@ processed."
|
||||||
|
|
||||||
(defun doom-package-recipe (package &optional prop nil-value)
|
(defun doom-package-recipe (package &optional prop nil-value)
|
||||||
"Returns the `straight' recipe PACKAGE was registered with."
|
"Returns the `straight' recipe PACKAGE was registered with."
|
||||||
(let ((plist (gethash (symbol-name package) straight--recipe-cache)))
|
(let* ((recipe (straight-recipes-retrieve package))
|
||||||
|
(plist (doom-plist-merge
|
||||||
|
(plist-get (alist-get package doom-packages) :recipe)
|
||||||
|
(cdr (if (memq (car recipe) '(quote \`))
|
||||||
|
(eval recipe t)
|
||||||
|
recipe)))))
|
||||||
(if prop
|
(if prop
|
||||||
(if (plist-member plist prop)
|
(if (plist-member plist prop)
|
||||||
(plist-get plist prop)
|
(plist-get plist prop)
|
||||||
|
@ -240,8 +249,14 @@ processed."
|
||||||
|
|
||||||
(defun doom-package-recipe-repo (package)
|
(defun doom-package-recipe-repo (package)
|
||||||
"Resolve and return PACKAGE's (symbol) local-repo property."
|
"Resolve and return PACKAGE's (symbol) local-repo property."
|
||||||
(if-let* ((recipe (cdr (straight-recipes-retrieve package)))
|
(if-let* ((recipe (copy-sequence (doom-package-recipe package)))
|
||||||
(repo (straight-vc-local-repo-name recipe)))
|
(recipe (if (and (not (plist-member recipe :type))
|
||||||
|
(memq (plist-get recipe :host) '(github gitlab bitbucket)))
|
||||||
|
(plist-put recipe :type 'git)
|
||||||
|
recipe))
|
||||||
|
(repo (if-let (local-repo (plist-get recipe :local-repo))
|
||||||
|
(file-name-nondirectory (directory-file-name local-repo))
|
||||||
|
(ignore-errors (straight-vc-local-repo-name recipe)))))
|
||||||
repo
|
repo
|
||||||
(symbol-name package)))
|
(symbol-name package)))
|
||||||
|
|
||||||
|
@ -263,12 +278,15 @@ processed."
|
||||||
(copy-sequence deps))))
|
(copy-sequence deps))))
|
||||||
|
|
||||||
(defun doom-package-depending-on (package &optional noerror)
|
(defun doom-package-depending-on (package &optional noerror)
|
||||||
"Return a list of packages that depend on the package named NAME."
|
"Return a list of packages that depend on PACKAGE.
|
||||||
(cl-check-type name symbol)
|
|
||||||
|
If PACKAGE (a symbol) isn't installed, throw an error, unless NOERROR is
|
||||||
|
non-nil."
|
||||||
|
(cl-check-type package symbol)
|
||||||
;; can't get dependencies for built-in packages
|
;; can't get dependencies for built-in packages
|
||||||
(unless (or (doom-package-build-recipe name)
|
(unless (or (doom-package-build-recipe package)
|
||||||
noerror)
|
noerror)
|
||||||
(error "Couldn't find %s, is it installed?" name))
|
(error "Couldn't find %s, is it installed?" package))
|
||||||
(cl-loop for pkg in (hash-table-keys straight--build-cache)
|
(cl-loop for pkg in (hash-table-keys straight--build-cache)
|
||||||
for deps = (doom-package-dependencies pkg)
|
for deps = (doom-package-dependencies pkg)
|
||||||
if (memq package deps)
|
if (memq package deps)
|
||||||
|
@ -478,8 +496,8 @@ elsewhere."
|
||||||
(when-let (recipe (plist-get plist :recipe))
|
(when-let (recipe (plist-get plist :recipe))
|
||||||
(cl-destructuring-bind
|
(cl-destructuring-bind
|
||||||
(&key local-repo _files _flavor
|
(&key local-repo _files _flavor
|
||||||
_no-build _build _post-build _no-byte-compile
|
_build _pre-build _post-build _includes
|
||||||
_no-native-compile _no-autoloads _type _repo _host _branch
|
_type _repo _host _branch
|
||||||
_remote _nonrecursive _fork _depth)
|
_remote _nonrecursive _fork _depth)
|
||||||
recipe
|
recipe
|
||||||
;; Expand :local-repo from current directory
|
;; Expand :local-repo from current directory
|
||||||
|
|
|
@ -145,10 +145,10 @@ c) are not valid projectile projects."
|
||||||
projectile-project-root-files)
|
projectile-project-root-files)
|
||||||
projectile-project-root-files-bottom-up nil)))
|
projectile-project-root-files-bottom-up nil)))
|
||||||
|
|
||||||
;; Some utilities have issues with windows-style paths in MSYS, so emit
|
;; Some MSYS utilities auto expanded the `/' path separator, so we need to prevent it.
|
||||||
;; unix-style paths instead.
|
|
||||||
(when IS-WINDOWS
|
(when IS-WINDOWS
|
||||||
(setenv "MSYS_NO_PATHCONV" "1"))
|
(setenv "MSYS_NO_PATHCONV" "1") ; Fix path in Git Bash
|
||||||
|
(setenv "MSYS2_ARG_CONV_EXCL" "--path-separator")) ; Fix path in MSYS2
|
||||||
|
|
||||||
;; HACK Don't rely on VCS-specific commands to generate our file lists. That's
|
;; HACK Don't rely on VCS-specific commands to generate our file lists. That's
|
||||||
;; 7 commands to maintain, versus the more generic, reliable and
|
;; 7 commands to maintain, versus the more generic, reliable and
|
||||||
|
@ -179,13 +179,13 @@ And if it's a function, evaluate it."
|
||||||
(cl-find-if (doom-rpartial #'executable-find t)
|
(cl-find-if (doom-rpartial #'executable-find t)
|
||||||
(list "fdfind" "fd"))
|
(list "fdfind" "fd"))
|
||||||
doom-projectile-fd-binary))
|
doom-projectile-fd-binary))
|
||||||
(concat (format "%s . -0 -H --color=never --type file --type symlink --follow"
|
(concat (format "%s . -0 -H --color=never --type file --type symlink --follow --exclude .git"
|
||||||
bin)
|
bin)
|
||||||
(if IS-WINDOWS " --path-separator=/"))))
|
(if IS-WINDOWS " --path-separator=/"))))
|
||||||
;; Otherwise, resort to ripgrep, which is also faster than find
|
;; Otherwise, resort to ripgrep, which is also faster than find
|
||||||
((executable-find "rg" t)
|
((executable-find "rg" t)
|
||||||
(concat "rg -0 --files --follow --color=never --hidden -g!.git"
|
(concat "rg -0 --files --follow --color=never --hidden -g!.git"
|
||||||
(if IS-WINDOWS " --path-separator /")))
|
(if IS-WINDOWS " --path-separator=/")))
|
||||||
("find . -type f -print0"))))
|
("find . -type f -print0"))))
|
||||||
|
|
||||||
(defadvice! doom--projectile-default-generic-command-a (orig-fn &rest args)
|
(defadvice! doom--projectile-default-generic-command-a (orig-fn &rest args)
|
||||||
|
|
|
@ -194,8 +194,8 @@ or if the current buffer is read-only or not file-visiting."
|
||||||
;; for tall lines.
|
;; for tall lines.
|
||||||
auto-window-vscroll nil
|
auto-window-vscroll nil
|
||||||
;; mouse
|
;; mouse
|
||||||
mouse-wheel-scroll-amount '(5 ((shift) . 2))
|
mouse-wheel-scroll-amount '(2 ((shift) . hscroll))
|
||||||
mouse-wheel-progressive-speed nil) ; don't accelerate scrolling
|
mouse-wheel-scroll-amount-horizontal 2)
|
||||||
|
|
||||||
;; Remove hscroll-margin in shells, otherwise it causes jumpiness
|
;; Remove hscroll-margin in shells, otherwise it causes jumpiness
|
||||||
(setq-hook! '(eshell-mode-hook term-mode-hook) hscroll-margin 0)
|
(setq-hook! '(eshell-mode-hook term-mode-hook) hscroll-margin 0)
|
||||||
|
@ -289,18 +289,16 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
;; where we resize windows too quickly.
|
;; where we resize windows too quickly.
|
||||||
(setq window-resize-pixelwise nil)
|
(setq window-resize-pixelwise nil)
|
||||||
|
|
||||||
(unless (assq 'menu-bar-lines default-frame-alist)
|
;; Disable tool, menu, and scrollbars. Doom is designed to be keyboard-centric,
|
||||||
;; We do this in early-init.el too, but in case the user is on Emacs 26 we do
|
;; so these are just clutter (the scrollbar also impacts performance). Whats
|
||||||
;; it here too: disable tool and scrollbars, as Doom encourages
|
;; more, the menu bar exposes functionality that Doom doesn't endorse.
|
||||||
;; keyboard-centric workflows, so these are just clutter (the scrollbar also
|
(push '(menu-bar-lines . 0) default-frame-alist)
|
||||||
;; impacts performance).
|
(push '(tool-bar-lines . 0) default-frame-alist)
|
||||||
(add-to-list 'default-frame-alist '(menu-bar-lines . 0))
|
(push '(vertical-scroll-bars) default-frame-alist)
|
||||||
(add-to-list 'default-frame-alist '(tool-bar-lines . 0))
|
|
||||||
(add-to-list 'default-frame-alist '(vertical-scroll-bars)))
|
|
||||||
|
|
||||||
;; These are disabled directly through their frame parameters, to avoid the
|
;; These are disabled directly through their frame parameters to avoid the extra
|
||||||
;; extra work their minor modes do, but we have to unset these variables
|
;; work their minor modes do, but their variables must be unset too, otherwise
|
||||||
;; ourselves, otherwise users will have to cycle them twice to re-enable them.
|
;; users will have to cycle them twice to re-enable them.
|
||||||
(setq menu-bar-mode nil
|
(setq menu-bar-mode nil
|
||||||
tool-bar-mode nil
|
tool-bar-mode nil
|
||||||
scroll-bar-mode nil)
|
scroll-bar-mode nil)
|
||||||
|
@ -344,9 +342,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
|
|
||||||
;; Expand the minibuffer to fit multi-line text displayed in the echo-area. This
|
;; Expand the minibuffer to fit multi-line text displayed in the echo-area. This
|
||||||
;; doesn't look too great with direnv, however...
|
;; doesn't look too great with direnv, however...
|
||||||
(setq resize-mini-windows 'grow-only
|
(setq resize-mini-windows 'grow-only)
|
||||||
;; But don't let the minibuffer grow beyond this size
|
|
||||||
max-mini-window-height 0.15)
|
|
||||||
|
|
||||||
;; Typing yes/no is obnoxious when y/n will do
|
;; Typing yes/no is obnoxious when y/n will do
|
||||||
(fset #'yes-or-no-p #'y-or-n-p)
|
(fset #'yes-or-no-p #'y-or-n-p)
|
||||||
|
@ -396,7 +392,9 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
;; Highlights the current line
|
;; Highlights the current line
|
||||||
:hook (doom-first-buffer . global-hl-line-mode)
|
:hook (doom-first-buffer . global-hl-line-mode)
|
||||||
:init
|
:init
|
||||||
(defvar global-hl-line-modes '(prog-mode text-mode conf-mode special-mode)
|
(defvar global-hl-line-modes
|
||||||
|
'(prog-mode text-mode conf-mode special-mode
|
||||||
|
org-agenda-mode)
|
||||||
"What modes to enable `hl-line-mode' in.")
|
"What modes to enable `hl-line-mode' in.")
|
||||||
:config
|
:config
|
||||||
;; HACK I reimplement `global-hl-line-mode' so we can white/blacklist modes in
|
;; HACK I reimplement `global-hl-line-mode' so we can white/blacklist modes in
|
||||||
|
@ -506,6 +504,8 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
all-the-icons-wicon all-the-icons-alltheicon)
|
all-the-icons-wicon all-the-icons-alltheicon)
|
||||||
""))))
|
""))))
|
||||||
|
|
||||||
|
;; Hide the mode line in completion popups and MAN pages because they serve
|
||||||
|
;; little purpose there, and is better hidden.
|
||||||
;;;###package hide-mode-line-mode
|
;;;###package hide-mode-line-mode
|
||||||
(add-hook! '(completion-list-mode-hook Man-mode-hook)
|
(add-hook! '(completion-list-mode-hook Man-mode-hook)
|
||||||
#'hide-mode-line-mode)
|
#'hide-mode-line-mode)
|
||||||
|
@ -520,17 +520,19 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
|
|
||||||
;;;###package rainbow-delimiters
|
;;;###package rainbow-delimiters
|
||||||
;; Helps us distinguish stacked delimiter pairs, especially in parentheses-drunk
|
;; Helps us distinguish stacked delimiter pairs, especially in parentheses-drunk
|
||||||
;; languages like Lisp.
|
;; languages like Lisp. I reduce it from it's default of 9 to reduce the
|
||||||
|
;; complexity of the font-lock keyword and hopefully buy us a few ms of
|
||||||
|
;; performance.
|
||||||
(setq rainbow-delimiters-max-face-count 3)
|
(setq rainbow-delimiters-max-face-count 3)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Line numbers
|
;;; Line numbers
|
||||||
|
|
||||||
;; Explicitly define a width to reduce computation
|
;; Explicitly define a width to reduce the cost of on-the-fly computation
|
||||||
(setq-default display-line-numbers-width 3)
|
(setq-default display-line-numbers-width 3)
|
||||||
|
|
||||||
;; Show absolute line numbers for narrowed regions makes it easier to tell the
|
;; Show absolute line numbers for narrowed regions to make it easier to tell the
|
||||||
;; buffer is narrowed, and where you are, exactly.
|
;; buffer is narrowed, and where you are, exactly.
|
||||||
(setq-default display-line-numbers-widen t)
|
(setq-default display-line-numbers-widen t)
|
||||||
|
|
||||||
|
@ -550,6 +552,14 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
;;
|
;;
|
||||||
;;; Theme & font
|
;;; Theme & font
|
||||||
|
|
||||||
|
;; User themes should live in ~/.doom.d/themes, not ~/.emacs.d
|
||||||
|
(setq custom-theme-directory (concat doom-private-dir "themes/"))
|
||||||
|
|
||||||
|
;; Always prioritize the user's themes above the built-in/packaged ones.
|
||||||
|
(setq custom-theme-load-path
|
||||||
|
(cons 'custom-theme-directory
|
||||||
|
(remq 'custom-theme-directory custom-theme-load-path)))
|
||||||
|
|
||||||
;; Underline looks a bit better when drawn lower
|
;; Underline looks a bit better when drawn lower
|
||||||
(setq x-underline-at-descent-line t)
|
(setq x-underline-at-descent-line t)
|
||||||
|
|
||||||
|
@ -589,7 +599,7 @@ behavior). Do not set this directly, this is let-bound in `doom-init-theme-h'.")
|
||||||
(when doom-variable-pitch-font
|
(when doom-variable-pitch-font
|
||||||
(set-face-attribute 'variable-pitch nil :font doom-variable-pitch-font))
|
(set-face-attribute 'variable-pitch nil :font doom-variable-pitch-font))
|
||||||
(when (fboundp 'set-fontset-font)
|
(when (fboundp 'set-fontset-font)
|
||||||
(dolist (font (append doom-unicode-extra-fonts (doom-enlist doom-unicode-font)))
|
(dolist (font (cons doom-unicode-font doom-unicode-extra-fonts))
|
||||||
(set-fontset-font t 'unicode font nil 'prepend)))
|
(set-fontset-font t 'unicode font nil 'prepend)))
|
||||||
(run-hooks 'after-setting-font-hook))
|
(run-hooks 'after-setting-font-hook))
|
||||||
((debug error)
|
((debug error)
|
||||||
|
|
23
core/core.el
23
core/core.el
|
@ -158,11 +158,11 @@ users).")
|
||||||
;; HACK Disable native-compilation for some troublesome packages
|
;; HACK Disable native-compilation for some troublesome packages
|
||||||
(mapc (doom-partial #'add-to-list 'comp-deferred-compilation-deny-list)
|
(mapc (doom-partial #'add-to-list 'comp-deferred-compilation-deny-list)
|
||||||
(let ((local-dir-re (concat "\\`" (regexp-quote doom-local-dir))))
|
(let ((local-dir-re (concat "\\`" (regexp-quote doom-local-dir))))
|
||||||
(list (concat local-dir-re ".*/evil-collection-vterm\\.el\\'")
|
(list (concat "\\`" (regexp-quote doom-autoloads-file) "\\'")
|
||||||
;; https://github.com/nnicandro/emacs-jupyter/issues/297
|
(concat local-dir-re ".*/evil-collection-vterm\\.el\\'")
|
||||||
(concat local-dir-re ".*/jupyter-channel\\.el\\'")
|
|
||||||
(concat local-dir-re ".*/with-editor\\.el\\'")
|
(concat local-dir-re ".*/with-editor\\.el\\'")
|
||||||
(concat "\\`" (regexp-quote doom-autoloads-file) "\\'"))))
|
;; https://github.com/nnicandro/emacs-jupyter/issues/297
|
||||||
|
(concat local-dir-re ".*/jupyter-channel\\.el\\'"))))
|
||||||
;; Default to using all cores, rather than half of them, since we compile
|
;; Default to using all cores, rather than half of them, since we compile
|
||||||
;; things ahead-of-time in a non-interactive session.
|
;; things ahead-of-time in a non-interactive session.
|
||||||
(defadvice! doom--comp-use-all-cores-a ()
|
(defadvice! doom--comp-use-all-cores-a ()
|
||||||
|
@ -208,7 +208,8 @@ users).")
|
||||||
inhibit-default-init t
|
inhibit-default-init t
|
||||||
;; Shave seconds off startup time by starting the scratch buffer in
|
;; Shave seconds off startup time by starting the scratch buffer in
|
||||||
;; `fundamental-mode', rather than, say, `org-mode' or `text-mode', which
|
;; `fundamental-mode', rather than, say, `org-mode' or `text-mode', which
|
||||||
;; pull in a ton of packages.
|
;; pull in a ton of packages. `doom/open-scratch-buffer' provides a better
|
||||||
|
;; scratch buffer anyway.
|
||||||
initial-major-mode 'fundamental-mode
|
initial-major-mode 'fundamental-mode
|
||||||
initial-scratch-message nil)
|
initial-scratch-message nil)
|
||||||
|
|
||||||
|
@ -219,7 +220,6 @@ users).")
|
||||||
;; We avoid `no-littering' because it's a mote too opinionated for our needs.
|
;; We avoid `no-littering' because it's a mote too opinionated for our needs.
|
||||||
(setq async-byte-compile-log-file (concat doom-etc-dir "async-bytecomp.log")
|
(setq async-byte-compile-log-file (concat doom-etc-dir "async-bytecomp.log")
|
||||||
custom-file (concat doom-private-dir "custom.el")
|
custom-file (concat doom-private-dir "custom.el")
|
||||||
custom-theme-directory (concat doom-private-dir "themes/")
|
|
||||||
desktop-dirname (concat doom-etc-dir "desktop")
|
desktop-dirname (concat doom-etc-dir "desktop")
|
||||||
desktop-base-file-name "autosave"
|
desktop-base-file-name "autosave"
|
||||||
desktop-base-lock-name "autosave-lock"
|
desktop-base-lock-name "autosave-lock"
|
||||||
|
@ -247,8 +247,7 @@ config.el instead."
|
||||||
;;; Optimizations
|
;;; Optimizations
|
||||||
|
|
||||||
;; A second, case-insensitive pass over `auto-mode-alist' is time wasted, and
|
;; A second, case-insensitive pass over `auto-mode-alist' is time wasted, and
|
||||||
;; indicates misconfiguration (or that the user needs to stop relying on case
|
;; indicates misconfiguration (don't rely on case insensitivity for file names).
|
||||||
;; insensitivity).
|
|
||||||
(setq auto-mode-case-fold nil)
|
(setq auto-mode-case-fold nil)
|
||||||
|
|
||||||
;; Disable bidirectional text rendering for a modest performance boost. I've set
|
;; Disable bidirectional text rendering for a modest performance boost. I've set
|
||||||
|
@ -296,6 +295,10 @@ config.el instead."
|
||||||
;; usage, however!
|
;; usage, however!
|
||||||
(setq inhibit-compacting-font-caches t)
|
(setq inhibit-compacting-font-caches t)
|
||||||
|
|
||||||
|
;; Introduced in Emacs HEAD (b2f8c9f), this inhibits fontification while
|
||||||
|
;; receiving input, which should help with performance while scrolling.
|
||||||
|
(setq redisplay-skip-fontification-on-input t)
|
||||||
|
|
||||||
;; Performance on Windows is considerably worse than elsewhere. We'll need
|
;; Performance on Windows is considerably worse than elsewhere. We'll need
|
||||||
;; everything we can get.
|
;; everything we can get.
|
||||||
(when IS-WINDOWS
|
(when IS-WINDOWS
|
||||||
|
@ -378,7 +381,7 @@ config.el instead."
|
||||||
|
|
||||||
(defvar doom-incremental-packages '(t)
|
(defvar doom-incremental-packages '(t)
|
||||||
"A list of packages to load incrementally after startup. Any large packages
|
"A list of packages to load incrementally after startup. Any large packages
|
||||||
here may cause noticable pauses, so it's recommended you break them up into
|
here may cause noticeable pauses, so it's recommended you break them up into
|
||||||
sub-packages. For example, `org' is comprised of many packages, and can be
|
sub-packages. For example, `org' is comprised of many packages, and can be
|
||||||
broken up into:
|
broken up into:
|
||||||
|
|
||||||
|
@ -612,7 +615,7 @@ to least)."
|
||||||
(eval-after-load 'straight '(doom-initialize-packages))
|
(eval-after-load 'straight '(doom-initialize-packages))
|
||||||
|
|
||||||
;; Bootstrap our GC manager
|
;; Bootstrap our GC manager
|
||||||
(add-hook 'doom-first-input-hook #'gcmh-mode)
|
(add-hook 'doom-first-buffer-hook #'gcmh-mode)
|
||||||
|
|
||||||
;; Bootstrap the interactive session
|
;; Bootstrap the interactive session
|
||||||
(add-hook 'after-change-major-mode-hook #'doom-run-local-var-hooks-h)
|
(add-hook 'after-change-major-mode-hook #'doom-run-local-var-hooks-h)
|
||||||
|
|
|
@ -17,33 +17,28 @@
|
||||||
:branch ,straight-repository-branch
|
:branch ,straight-repository-branch
|
||||||
:local-repo "straight.el"
|
:local-repo "straight.el"
|
||||||
:files ("straight*.el"))
|
:files ("straight*.el"))
|
||||||
:pin "3277e1c9648b41dd5bfb239c067b8374ed2ec2bb")
|
:pin "f2cb888f088a790bac8731b95eeec3df068cac5f")
|
||||||
|
|
||||||
;; core-modules.el
|
;; core-modules.el
|
||||||
(package! use-package
|
(package! use-package
|
||||||
:type 'core
|
:type 'core
|
||||||
:pin "caa92f1d64fc25480551757d854b4b49981dfa6b")
|
:pin "317137b07687f16ea97a2493b0a6768c9df381a0")
|
||||||
|
|
||||||
;; core-ui.el
|
;; core-ui.el
|
||||||
(package! all-the-icons :pin "6917b08f64dd8487e23769433d6cb9ba11f4152f")
|
(package! all-the-icons :pin "5fa728399bd6233a82bbfd4f7cb203a1d7ede708")
|
||||||
(package! hide-mode-line :pin "88888825b5b27b300683e662fa3be88d954b1cea")
|
(package! hide-mode-line :pin "88888825b5b27b300683e662fa3be88d954b1cea")
|
||||||
(package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307")
|
(package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307")
|
||||||
(package! rainbow-delimiters :pin "f43d48a24602be3ec899345a3326ed0247b960c6")
|
(package! rainbow-delimiters :pin "f43d48a24602be3ec899345a3326ed0247b960c6")
|
||||||
(package! restart-emacs :pin "e5707491d7ac20879465bb52e282ad1416748378")
|
(package! restart-emacs :pin "1607da2bc657fe05ae01f7fdf26f716eafead02c")
|
||||||
|
|
||||||
;; core-editor.el
|
;; core-editor.el
|
||||||
(package! better-jumper :pin "fe548d22c9228b60d9c8a2a452a6c2e03dfdf238")
|
(package! better-jumper :pin "411ecdf6e7a3e1b4ced7605070d2309e5fc46556")
|
||||||
(package! dtrt-indent :pin "a7ade6d244eeeda2ada9f7eca565491cea4b622a")
|
(package! dtrt-indent :pin "854b9a1ce93d9926018a0eb18e6e552769c5407d")
|
||||||
(package! helpful :pin "584ecc887bb92133119f93a6716cdf7af0b51dca")
|
(package! helpful :pin "584ecc887bb92133119f93a6716cdf7af0b51dca")
|
||||||
(package! pcre2el :pin "0b5b2a2c173aab3fd14aac6cf5e90ad3bf58fa7d")
|
(package! pcre2el :pin "0b5b2a2c173aab3fd14aac6cf5e90ad3bf58fa7d")
|
||||||
(package! smartparens :pin "7f5825dd655942c3d56d14acabab1ffab1aa2ae2")
|
(package! smartparens :pin "63695c64233d215a92bf08e762f643cdb595bdd9")
|
||||||
(package! so-long
|
;; DEPRECATED Built into Emacs 27+; remove when we drop 26 support
|
||||||
:built-in 'prefer ; included in Emacs 27+
|
(package! so-long :built-in 'prefer :pin "a5d445de4829b2327bd51dad2fb04291c7a0ec5f")
|
||||||
;; REVIEW so-long is slated to be published to ELPA eventually, but until then
|
|
||||||
;; I've created my own mirror for it because git.savannah.gnu.org runs
|
|
||||||
;; on a potato.
|
|
||||||
:recipe (:host github :repo "hlissner/emacs-so-long")
|
|
||||||
:pin "ed666b0716f60e8988c455804de24b55919e71ca")
|
|
||||||
(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).
|
||||||
|
@ -51,8 +46,8 @@
|
||||||
:pin "2bb49d3ee7d2cba133bc7e9cdac416cd1c5e4fe0")
|
:pin "2bb49d3ee7d2cba133bc7e9cdac416cd1c5e4fe0")
|
||||||
|
|
||||||
;; core-projects.el
|
;; core-projects.el
|
||||||
(package! projectile :pin "d1cfad008b1719a6bee17fbe9479db414c0dc5d9")
|
(package! projectile :pin "fd5994762a90c2311e8aa40c37373f24e1743a55")
|
||||||
|
|
||||||
;; core-keybinds.el
|
;; core-keybinds.el
|
||||||
(package! general :pin "a0b17d207badf462311b2eef7c065b884462cb7c")
|
(package! general :pin "a0b17d207badf462311b2eef7c065b884462cb7c")
|
||||||
(package! which-key :pin "ca268fd313d3fb2bd03a8b5e4bdcca675ce58ca7")
|
(package! which-key :pin "c0608e812a8d1bc7aefeacdfaeb56a7272eabf44")
|
||||||
|
|
|
@ -50,7 +50,7 @@ us know!
|
||||||
- [[#installing-packages-from-external-sources][Installing packages from external sources]]
|
- [[#installing-packages-from-external-sources][Installing packages from external sources]]
|
||||||
- [[#pinning-packages-to-specific-commits][Pinning packages to specific commits]]
|
- [[#pinning-packages-to-specific-commits][Pinning packages to specific commits]]
|
||||||
- [[#disabling-packages][Disabling packages]]
|
- [[#disabling-packages][Disabling packages]]
|
||||||
- [[#changing-a-recipe-for-a-included-package][Changing a recipe for a included package]]
|
- [[#changing-a-recipe-for-an-included-package][Changing a recipe for an included package]]
|
||||||
- [[#usingloading-local-packages][Using/loading local packages]]
|
- [[#usingloading-local-packages][Using/loading local packages]]
|
||||||
- [[#configuring-doom][Configuring Doom]]
|
- [[#configuring-doom][Configuring Doom]]
|
||||||
- [[#configuring-packages][Configuring packages]]
|
- [[#configuring-packages][Configuring packages]]
|
||||||
|
@ -886,7 +886,7 @@ packages:
|
||||||
ensure your changes take effect.
|
ensure your changes take effect.
|
||||||
#+end_quote
|
#+end_quote
|
||||||
|
|
||||||
*** Changing a recipe for a included package
|
*** Changing a recipe for an included package
|
||||||
If a Doom module installs package X from one place, but you'd like to install it
|
If a Doom module installs package X from one place, but you'd like to install it
|
||||||
from another (say, a superior fork), add a ~package!~ declaration for it in your
|
from another (say, a superior fork), add a ~package!~ declaration for it in your
|
||||||
=DOOMDIR/packages.el=. Your private declarations always have precedence over
|
=DOOMDIR/packages.el=. Your private declarations always have precedence over
|
||||||
|
@ -932,9 +932,9 @@ live testing. To do this specify a ~:local-repo~ in that package's recipe:
|
||||||
;; you want:
|
;; you want:
|
||||||
:files ("*.el" "src/lisp/*.el")
|
:files ("*.el" "src/lisp/*.el")
|
||||||
|
|
||||||
;; With ':no-byte-compile t' you can avoid having to run 'doom sync'
|
;; With this you can avoid having to run 'doom sync' every time you
|
||||||
;; every time you change the package.
|
;; change the package.
|
||||||
:no-byte-compile t))
|
:build (:not compile)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Alternatively, add the package's location to Emacs' ~load-path~. Do this if you
|
Alternatively, add the package's location to Emacs' ~load-path~. Do this if you
|
||||||
|
@ -1176,7 +1176,7 @@ Placing this on top of a lisp form will do one of two things:
|
||||||
=~/.emacs.d/.local/autoloads.el=, which is read very early in the startup
|
=~/.emacs.d/.local/autoloads.el=, which is read very early in the startup
|
||||||
process).
|
process).
|
||||||
2. Or copy that lisp form to Doom's autoload file verbatim (usually the case for
|
2. Or copy that lisp form to Doom's autoload file verbatim (usually the case for
|
||||||
anything other then ~def*~ forms, like ~defun~ or ~defmacro~).
|
anything other than ~def*~ forms, like ~defun~ or ~defmacro~).
|
||||||
|
|
||||||
Doom's autoload file is generated by scanning these files when you execute ~doom
|
Doom's autoload file is generated by scanning these files when you execute ~doom
|
||||||
sync~.
|
sync~.
|
||||||
|
@ -1414,9 +1414,9 @@ org module documentation]] for details on how to add support for it.
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
These two lines are a common sight in Emacs configs, but they are unnecessary
|
These two lines are a common sight in Emacs configs, but they are unnecessary
|
||||||
for Doom Emacs. We already use the more sophisticated =wsbutler= to manage
|
for Doom Emacs. We already use the more sophisticated =ws-butler= to manage
|
||||||
extraneous whitespace. However, you might have the impression that it isn't
|
extraneous whitespace. However, you might have the impression that it isn't
|
||||||
working. That's because =wsbutler= works in two unusual ways, meant to be less
|
working. That's because =ws-butler= works in two unusual ways, meant to be less
|
||||||
imposing than its alternatives:
|
imposing than its alternatives:
|
||||||
|
|
||||||
1. It only cleans up trailing whitespace /on lines that you've touched/ (but
|
1. It only cleans up trailing whitespace /on lines that you've touched/ (but
|
||||||
|
@ -1431,7 +1431,7 @@ imposing than its alternatives:
|
||||||
However, if it's truly deliberate, ~M-x delete-trailing-whitespaces~ and ~M-x
|
However, if it's truly deliberate, ~M-x delete-trailing-whitespaces~ and ~M-x
|
||||||
whitespace-cleanup~ are available to be called =deliberately=, instead.
|
whitespace-cleanup~ are available to be called =deliberately=, instead.
|
||||||
|
|
||||||
2. =wsbutler= replaces trailing whitespace and newlines with *virtual*
|
2. =ws-butler= replaces trailing whitespace and newlines with *virtual*
|
||||||
whitespace. This is whitespace that only exists in the Emacs buffer, but
|
whitespace. This is whitespace that only exists in the Emacs buffer, but
|
||||||
isn't actually written to the file.
|
isn't actually written to the file.
|
||||||
|
|
||||||
|
@ -1470,7 +1470,7 @@ provide tools to make this easier. Here are a few things you can try, first:
|
||||||
issues that originate from upstream.
|
issues that originate from upstream.
|
||||||
|
|
||||||
+ If you happen to know what module(s) are relevant to your issue, check their
|
+ If you happen to know what module(s) are relevant to your issue, check their
|
||||||
documentation (press =<leader> h m= to jump to a module's documentation). Your
|
documentation (press =<leader> h d m= to jump to a module's documentation). Your
|
||||||
issue may be documented.
|
issue may be documented.
|
||||||
|
|
||||||
+ If possible, see if the issue can be reproduced in vanilla Emacs (Emacs
|
+ If possible, see if the issue can be reproduced in vanilla Emacs (Emacs
|
||||||
|
@ -1559,9 +1559,9 @@ and before the subcommand. This will be fixed eventually.
|
||||||
Often, you may find it helpful for debugging to evaluate some Emacs Lisp. Here
|
Often, you may find it helpful for debugging to evaluate some Emacs Lisp. Here
|
||||||
are couple things you can do:
|
are couple things you can do:
|
||||||
|
|
||||||
+ Use =M-;= (bound to ~eval-expression~),
|
+ Use =M-:= (bound to ~eval-expression~),
|
||||||
+ =SPC x= will open a scratch buffer. ~M-x emacs-lisp-mode~ will change it to
|
+ =SPC x= will open a scratch buffer. ~M-x emacs-lisp-mode~ will change it to
|
||||||
the appropriate major mode, then use ~+eval:region~ (=gr=) and ~+eval:buffer~
|
the appropriate major mode, then use ~+eval:region~ (=gr=) and ~+eval/buffer~
|
||||||
(=gR=) to evaluate code,
|
(=gR=) to evaluate code,
|
||||||
|
|
||||||
** How to determine the origin of a bug
|
** How to determine the origin of a bug
|
||||||
|
@ -1571,7 +1571,7 @@ in a fresh instance of Emacs with varying amounts of Doom loaded (none at all,
|
||||||
all of it, or somewhere in between). This can be helpful for isolating bugs to
|
all of it, or somewhere in between). This can be helpful for isolating bugs to
|
||||||
determine who you should report a bug to.
|
determine who you should report a bug to.
|
||||||
|
|
||||||
If you can recreate a bug in vanilla Emacs than it should be reported to the
|
If you can recreate a bug in vanilla Emacs then it should be reported to the
|
||||||
developers of the relevant packages or, perhaps, the Emacs devs themselves.
|
developers of the relevant packages or, perhaps, the Emacs devs themselves.
|
||||||
|
|
||||||
Otherwise, it is best to bring it up on the Doom Emacs issue list, rather than
|
Otherwise, it is best to bring it up on the Doom Emacs issue list, rather than
|
||||||
|
|
|
@ -1,28 +1,43 @@
|
||||||
;;; early-init.el -*- lexical-binding: t; -*-
|
;;; early-init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Emacs HEAD (27+) introduces early-init.el, which is run before init.el,
|
;; Emacs 27.1 introduced early-init.el, which is run before init.el, before
|
||||||
;; before package and UI initialization happens.
|
;; package and UI initialization happens, and before site files are loaded.
|
||||||
|
|
||||||
;; Defer garbage collection further back in the startup process
|
;; A big contributor to startup times is garbage collection. We up the gc
|
||||||
|
;; threshold to temporarily prevent it from running, then reset it later by
|
||||||
|
;; enabling `gcmh-mode'. Not resetting it will cause stuttering/freezes.
|
||||||
(setq gc-cons-threshold most-positive-fixnum)
|
(setq gc-cons-threshold most-positive-fixnum)
|
||||||
|
|
||||||
|
;; In noninteractive sessions, prioritize non-byte-compiled source files to
|
||||||
|
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
|
||||||
|
;; to skip the mtime checks on every *.elc file.
|
||||||
|
(setq load-prefer-newer noninteractive)
|
||||||
|
|
||||||
;; In Emacs 27+, package initialization occurs before `user-init-file' is
|
;; In Emacs 27+, package initialization occurs before `user-init-file' is
|
||||||
;; loaded, but after `early-init-file'. Doom handles package initialization, so
|
;; loaded, but after `early-init-file'. Doom handles package initialization, so
|
||||||
;; we must prevent Emacs from doing it early!
|
;; we must prevent Emacs from doing it early!
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
(fset #'package--ensure-init-file #'ignore) ; DEPRECATED Removed in 28
|
(fset #'package--ensure-init-file #'ignore) ; DEPRECATED Removed in 28
|
||||||
|
|
||||||
;; Prevent the glimpse of un-styled Emacs by disabling these UI elements early.
|
;; `file-name-handler-alist' is consulted on every `require', `load' and various
|
||||||
(push '(menu-bar-lines . 0) default-frame-alist)
|
;; path/io functions. You get a minor speed up by nooping this. However, this
|
||||||
(push '(tool-bar-lines . 0) default-frame-alist)
|
;; may cause problems on builds of Emacs where its site lisp files aren't
|
||||||
(push '(vertical-scroll-bars) default-frame-alist)
|
;; byte-compiled and we're forced to load the *.el.gz files (e.g. on Alpine)
|
||||||
|
(unless (daemonp)
|
||||||
|
(defvar doom--initial-file-name-handler-alist file-name-handler-alist)
|
||||||
|
(setq file-name-handler-alist nil)
|
||||||
|
;; Restore `file-name-handler-alist' later, because it is needed for handling
|
||||||
|
;; encrypted or compressed files, among other things.
|
||||||
|
(defun doom-reset-file-handler-alist-h ()
|
||||||
|
;; Re-add rather than `setq', because changes to `file-name-handler-alist'
|
||||||
|
;; since startup ought to be preserved.
|
||||||
|
(dolist (handler file-name-handler-alist)
|
||||||
|
(add-to-list 'doom--initial-file-name-handler-alist handler))
|
||||||
|
(setq file-name-handler-alist doom--initial-file-name-handler-alist))
|
||||||
|
(add-hook 'emacs-startup-hook #'doom-reset-file-handler-alist-h))
|
||||||
|
|
||||||
;; Resizing the Emacs frame can be a terribly expensive part of changing the
|
;; Ensure Doom is running out of this file's directory
|
||||||
;; font. By inhibiting this, we easily halve startup times with fonts that are
|
(setq user-emacs-directory (file-name-directory load-file-name))
|
||||||
;; larger than the system default.
|
|
||||||
(setq frame-inhibit-implied-resize t)
|
|
||||||
|
|
||||||
;; Prevent unwanted runtime builds in gccemacs (native-comp); packages are
|
;; Load the heart of Doom Emacs
|
||||||
;; compiled ahead-of-time when they are installed and site files are compiled
|
(load (concat user-emacs-directory "core/core") nil 'nomessage)
|
||||||
;; when gccemacs is installed.
|
|
||||||
(setq comp-deferred-compilation nil)
|
|
||||||
|
|
42
init.el
42
init.el
|
@ -27,43 +27,11 @@
|
||||||
;;
|
;;
|
||||||
;;; License: MIT
|
;;; License: MIT
|
||||||
|
|
||||||
(when (< emacs-major-version 26)
|
;; In the strange case that early-init.el wasn't loaded (e.g. you're using
|
||||||
(error "Detected Emacs v%s. Doom only supports Emacs 26 and newer"
|
;; Chemacs 1? Or you're loading this file directly?), we do it explicitly:
|
||||||
emacs-version))
|
(unless (boundp 'doom-version)
|
||||||
|
(load (concat (file-name-directory load-file-name) "early-init")
|
||||||
;; A big contributor to startup times is garbage collection. We up the gc
|
nil t))
|
||||||
;; threshold to temporarily prevent it from running, then reset it later by
|
|
||||||
;; enabling `gcmh-mode'. Not resetting it will cause stuttering/freezes.
|
|
||||||
(setq gc-cons-threshold most-positive-fixnum)
|
|
||||||
|
|
||||||
;; In noninteractive sessions, prioritize non-byte-compiled source files to
|
|
||||||
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
|
|
||||||
;; to skip the mtime checks on every *.elc file.
|
|
||||||
(setq load-prefer-newer noninteractive)
|
|
||||||
|
|
||||||
;; `file-name-handler-alist' is consulted on every `require', `load' and various
|
|
||||||
;; path/io functions. You get a minor speed up by nooping this. However, this
|
|
||||||
;; may cause problems on builds of Emacs where its site lisp files aren't
|
|
||||||
;; byte-compiled and we're forced to load the *.el.gz files (e.g. on Alpine)
|
|
||||||
(unless (daemonp)
|
|
||||||
(defvar doom--initial-file-name-handler-alist file-name-handler-alist)
|
|
||||||
(setq file-name-handler-alist nil)
|
|
||||||
;; Restore `file-name-handler-alist' later, because it is needed for handling
|
|
||||||
;; encrypted or compressed files, among other things.
|
|
||||||
(defun doom-reset-file-handler-alist-h ()
|
|
||||||
;; Re-add rather than `setq', because changes to `file-name-handler-alist'
|
|
||||||
;; since startup ought to be preserved.
|
|
||||||
(dolist (handler file-name-handler-alist)
|
|
||||||
(add-to-list 'doom--initial-file-name-handler-alist handler))
|
|
||||||
(setq file-name-handler-alist doom--initial-file-name-handler-alist))
|
|
||||||
(add-hook 'emacs-startup-hook #'doom-reset-file-handler-alist-h))
|
|
||||||
|
|
||||||
;; Ensure Doom is running out of this file's directory
|
|
||||||
(setq user-emacs-directory (file-name-directory load-file-name))
|
|
||||||
|
|
||||||
;; Load the heart of Doom Emacs
|
|
||||||
(load (concat user-emacs-directory "core/core")
|
|
||||||
nil 'nomessage)
|
|
||||||
|
|
||||||
;; And let 'er rip!
|
;; And let 'er rip!
|
||||||
(doom-initialize)
|
(doom-initialize)
|
||||||
|
|
|
@ -65,6 +65,7 @@ with anything other than =aspell= yet.
|
||||||
|
|
||||||
** Aspell
|
** Aspell
|
||||||
+ Ubuntu: ~apt-get install aspell aspell-en~
|
+ Ubuntu: ~apt-get install aspell aspell-en~
|
||||||
|
+ macOS: ~brew install aspell~
|
||||||
+ Arch Linux: ~pacman -S aspell aspell-en~
|
+ Arch Linux: ~pacman -S aspell aspell-en~
|
||||||
+ NixOS:
|
+ NixOS:
|
||||||
#+BEGIN_SRC nix
|
#+BEGIN_SRC nix
|
||||||
|
@ -75,10 +76,22 @@ with anything other than =aspell= yet.
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** TODO Hunspell
|
** Hunspell
|
||||||
|
+ Ubuntu: ~apt-get install hunspell~
|
||||||
|
+ macOS: ~brew install hunspell~
|
||||||
|
+ Arch Linux: ~pacman -S hunspell~
|
||||||
|
+ NixOS:
|
||||||
|
#+BEGIN_SRC nix
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
hunspell
|
||||||
|
];
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** Enchant
|
** Enchant
|
||||||
+ Ubuntu: ~apt-get install enchant-2~
|
+ Ubuntu: ~apt-get install enchant-2~
|
||||||
|
+ macOS: ~brew install enchant~
|
||||||
+ Arch Linux: ~pacman -S enchant~
|
+ Arch Linux: ~pacman -S enchant~
|
||||||
+ NixOS:
|
+ NixOS:
|
||||||
#+BEGIN_SRC nix
|
#+BEGIN_SRC nix
|
||||||
|
|
|
@ -65,7 +65,8 @@
|
||||||
(featurep! :completion helm)))
|
(featurep! :completion helm)))
|
||||||
(call-interactively #'ispell-word)
|
(call-interactively #'ispell-word)
|
||||||
(cl-destructuring-bind (start . end)
|
(cl-destructuring-bind (start . end)
|
||||||
(bounds-of-thing-at-point 'word)
|
(or (bounds-of-thing-at-point 'word)
|
||||||
|
(user-error "No word at point"))
|
||||||
(let ((word (thing-at-point 'word t))
|
(let ((word (thing-at-point 'word t))
|
||||||
(orig-pt (point))
|
(orig-pt (point))
|
||||||
poss ispell-filter)
|
poss ispell-filter)
|
||||||
|
|
|
@ -32,8 +32,6 @@
|
||||||
ispell-extra-args '("--sug-mode=ultra"
|
ispell-extra-args '("--sug-mode=ultra"
|
||||||
"--run-together"))
|
"--run-together"))
|
||||||
|
|
||||||
(unless ispell-dictionary
|
|
||||||
(setq ispell-dictionary "english"))
|
|
||||||
(unless ispell-aspell-dict-dir
|
(unless ispell-aspell-dict-dir
|
||||||
(setq ispell-aspell-dict-dir
|
(setq ispell-aspell-dict-dir
|
||||||
(ispell-get-aspell-config-value "dict-dir")))
|
(ispell-get-aspell-config-value "dict-dir")))
|
||||||
|
@ -147,7 +145,7 @@
|
||||||
(add-hook! 'spell-fu-mode-hook
|
(add-hook! 'spell-fu-mode-hook
|
||||||
(defun +spell-init-excluded-faces-h ()
|
(defun +spell-init-excluded-faces-h ()
|
||||||
"Set `spell-fu-faces-exclude' according to `+spell-excluded-faces-alist'."
|
"Set `spell-fu-faces-exclude' according to `+spell-excluded-faces-alist'."
|
||||||
(when-let (excluded (alist-get major-mode +spell-excluded-faces-alist))
|
(when-let (excluded (cdr (cl-find-if #'derived-mode-p +spell-excluded-faces-alist :key #'car)))
|
||||||
(setq-local spell-fu-faces-exclude excluded))))
|
(setq-local spell-fu-faces-exclude excluded))))
|
||||||
|
|
||||||
;; TODO custom `spell-fu-check-range' function to reduce false positives
|
;; TODO custom `spell-fu-check-range' function to reduce false positives
|
||||||
|
@ -199,7 +197,10 @@ e.g. proselint and langtool."
|
||||||
(add-hook 'flyspell-mode-hook #'+spell-init-flyspell-predicate-h)
|
(add-hook 'flyspell-mode-hook #'+spell-init-flyspell-predicate-h)
|
||||||
|
|
||||||
(let ((flyspell-correct
|
(let ((flyspell-correct
|
||||||
(cmds! (and (not (or mark-active (ignore-errors (evil-insert-state-p))))
|
(cmds! (and (not mark-active)
|
||||||
|
(not (and (bound-and-true-p evil-local-mode)
|
||||||
|
(or (evil-insert-state-p)
|
||||||
|
(evil-emacs-state-p))))
|
||||||
(memq 'flyspell-incorrect (face-at-point nil t)))
|
(memq 'flyspell-incorrect (face-at-point nil t)))
|
||||||
#'flyspell-correct-at-point)))
|
#'flyspell-correct-at-point)))
|
||||||
(map! :map flyspell-mouse-map
|
(map! :map flyspell-mouse-map
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
:config
|
:config
|
||||||
(setq flycheck-emacs-lisp-load-path 'inherit)
|
(setq flycheck-emacs-lisp-load-path 'inherit)
|
||||||
|
|
||||||
;; Check only when saving or opening files. Newline & idle checks are a mote
|
;; Rerunning checks on every newline is a mote excessive.
|
||||||
;; excessive and can catch code in an incomplete state, producing false
|
(delq 'new-line flycheck-check-syntax-automatically)
|
||||||
;; positives, so we removed them.
|
;; And don't recheck on idle as often
|
||||||
(setq flycheck-check-syntax-automatically '(save mode-enabled idle-buffer-switch))
|
(setq flycheck-idle-change-delay 1.0)
|
||||||
|
|
||||||
;; For the above functionality, check syntax in a buffer that you switched to
|
;; For the above functionality, check syntax in a buffer that you switched to
|
||||||
;; only briefly. This allows "refreshing" the syntax check state for several
|
;; only briefly. This allows "refreshing" the syntax check state for several
|
||||||
|
@ -24,7 +24,9 @@
|
||||||
|
|
||||||
;; Don't commandeer input focus if the error message pops up (happens when
|
;; Don't commandeer input focus if the error message pops up (happens when
|
||||||
;; tooltips and childframes are disabled).
|
;; tooltips and childframes are disabled).
|
||||||
(set-popup-rule! "^\\*Flycheck error messages\\*" :select nil)
|
(set-popup-rules!
|
||||||
|
'(("^\\*Flycheck error messages\\*" :select nil)
|
||||||
|
("^\\*Flycheck errors\\*" :size 0.25)))
|
||||||
|
|
||||||
(add-hook! 'doom-escape-hook :append
|
(add-hook! 'doom-escape-hook :append
|
||||||
(defun +syntax-check-buffer-h ()
|
(defun +syntax-check-buffer-h ()
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defvar +company-backend-alist
|
(defvar +company-backend-alist
|
||||||
'((text-mode company-dabbrev company-yasnippet company-ispell)
|
'((text-mode (:separate company-dabbrev company-yasnippet company-ispell))
|
||||||
(prog-mode company-capf company-yasnippet)
|
(prog-mode company-capf company-yasnippet)
|
||||||
(conf-mode company-capf company-dabbrev-code company-yasnippet))
|
(conf-mode company-capf company-dabbrev-code company-yasnippet))
|
||||||
"An alist matching modes to company backends. The backends for any mode is
|
"An alist matching modes to company backends. The backends for any mode is
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
(when (featurep! +fuzzy)
|
(when (featurep! +fuzzy)
|
||||||
(package! helm-flx :pin "6640fac5cb16bee73c95b8ed1248a4e5e113690e"))
|
(package! helm-flx :pin "6640fac5cb16bee73c95b8ed1248a4e5e113690e"))
|
||||||
(when (featurep! +childframe)
|
(when (featurep! +childframe)
|
||||||
(package! posframe :pin "e1552c82dffaadc5e7de09a44880a498197ffbee"))
|
(package! posframe :pin "efd7ea490defc53a5b78e7469a3a35d225b766cc"))
|
||||||
(when (featurep! :lang org)
|
(when (featurep! :lang org)
|
||||||
(package! helm-org :pin "b7a18dfc17e8b933956d61d68c435eee03a96c24"))
|
(package! helm-org :pin "b7a18dfc17e8b933956d61d68c435eee03a96c24"))
|
||||||
(package! helm-descbinds :pin "b72515982396b6e336ad7beb6767e95a80fca192")
|
(package! helm-descbinds :pin "b72515982396b6e336ad7beb6767e95a80fca192")
|
||||||
|
|
|
@ -59,6 +59,8 @@ results buffer.")
|
||||||
(setq ivy-height 17
|
(setq ivy-height 17
|
||||||
ivy-wrap t
|
ivy-wrap t
|
||||||
ivy-fixed-height-minibuffer t
|
ivy-fixed-height-minibuffer t
|
||||||
|
ivy-read-action-function #'ivy-hydra-read-action
|
||||||
|
ivy-read-action-format-function #'ivy-read-action-format-columns
|
||||||
projectile-completion-system 'ivy
|
projectile-completion-system 'ivy
|
||||||
;; don't show recent files in switch-buffer
|
;; don't show recent files in switch-buffer
|
||||||
ivy-use-virtual-buffers nil
|
ivy-use-virtual-buffers nil
|
||||||
|
@ -83,22 +85,22 @@ results buffer.")
|
||||||
|
|
||||||
(add-hook! 'minibuffer-exit-hook
|
(add-hook! 'minibuffer-exit-hook
|
||||||
(defun +ivy--set-jump-point-maybe-h ()
|
(defun +ivy--set-jump-point-maybe-h ()
|
||||||
(and (markerp (bound-and-true-p +ivy--origin))
|
(when (markerp (bound-and-true-p +ivy--origin))
|
||||||
(not (equal (ignore-errors (with-ivy-window (point-marker)))
|
(unless (equal (ignore-errors (with-ivy-window (point-marker)))
|
||||||
+ivy--origin))
|
+ivy--origin)
|
||||||
(with-current-buffer (marker-buffer +ivy--origin)
|
(with-current-buffer (marker-buffer +ivy--origin)
|
||||||
(better-jumper-set-jump +ivy--origin)))
|
(better-jumper-set-jump +ivy--origin)))
|
||||||
|
(set-marker +ivy--origin nil))
|
||||||
(setq +ivy--origin nil)))
|
(setq +ivy--origin nil)))
|
||||||
|
|
||||||
(after! yasnippet
|
(after! yasnippet
|
||||||
(add-hook 'yas-prompt-functions #'+ivy-yas-prompt-fn))
|
(add-hook 'yas-prompt-functions #'+ivy-yas-prompt-fn))
|
||||||
|
|
||||||
(defadvice! +ivy--inhibit-completion-in-region-a (orig-fn &rest args)
|
(after! ivy-hydra
|
||||||
"`ivy-completion-in-region' struggles with completing certain
|
;; Ensure `ivy-dispatching-done' and `hydra-ivy/body' hydras can be
|
||||||
evil-ex-specific constructs, so we disable it solely in evil-ex."
|
;; exited / toggled by the same key binding they were opened
|
||||||
:around #'evil-ex
|
(add-to-list 'ivy-dispatching-done-hydra-exit-keys '("C-o" nil))
|
||||||
(let ((completion-in-region-function #'completion--in-region))
|
(defhydra+ hydra-ivy () ("M-o" nil)))
|
||||||
(apply orig-fn args)))
|
|
||||||
|
|
||||||
(define-key! ivy-minibuffer-map
|
(define-key! ivy-minibuffer-map
|
||||||
[remap doom/delete-backward-word] #'ivy-backward-kill-word
|
[remap doom/delete-backward-word] #'ivy-backward-kill-word
|
||||||
|
@ -182,6 +184,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
[remap describe-face] #'counsel-faces
|
[remap describe-face] #'counsel-faces
|
||||||
[remap describe-function] #'counsel-describe-function
|
[remap describe-function] #'counsel-describe-function
|
||||||
[remap describe-variable] #'counsel-describe-variable
|
[remap describe-variable] #'counsel-describe-variable
|
||||||
|
[remap describe-symbol] #'counsel-describe-symbol
|
||||||
[remap evil-ex-registers] #'counsel-evil-registers
|
[remap evil-ex-registers] #'counsel-evil-registers
|
||||||
[remap evil-show-marks] #'counsel-mark-ring
|
[remap evil-show-marks] #'counsel-mark-ring
|
||||||
[remap execute-extended-command] #'counsel-M-x
|
[remap execute-extended-command] #'counsel-M-x
|
||||||
|
@ -220,19 +223,14 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
(when (stringp counsel-rg-base-command)
|
(when (stringp counsel-rg-base-command)
|
||||||
(setq counsel-rg-base-command (split-string counsel-rg-base-command)))
|
(setq counsel-rg-base-command (split-string counsel-rg-base-command)))
|
||||||
|
|
||||||
;; REVIEW Fix #3215: prevents mingw on Windows throwing an error trying to
|
|
||||||
;; expand / to an absolute path. Remove this when it is fixed upstream
|
|
||||||
;; in counsel.
|
|
||||||
(when (and (memq system-type '(windows-nt ms-dos))
|
|
||||||
(listp counsel-rg-base-command)
|
|
||||||
(member "--path-separator" counsel-rg-base-command))
|
|
||||||
(setf (cadr (member "--path-separator" counsel-rg-base-command))
|
|
||||||
"/"))
|
|
||||||
|
|
||||||
;; Integrate with `helpful'
|
;; Integrate with `helpful'
|
||||||
(setq counsel-describe-function-function #'helpful-callable
|
(setq counsel-describe-function-function #'helpful-callable
|
||||||
counsel-describe-variable-function #'helpful-variable)
|
counsel-describe-variable-function #'helpful-variable)
|
||||||
|
|
||||||
|
;; Decorate `doom/help-custom-variable' results the same way as
|
||||||
|
;; `counsel-describe-variable' (adds value and docstring columns).
|
||||||
|
(ivy-configure 'doom/help-custom-variable :parent 'counsel-describe-variable)
|
||||||
|
|
||||||
;; Record in jumplist when opening files via counsel-{ag,rg,pt,git-grep}
|
;; Record in jumplist when opening files via counsel-{ag,rg,pt,git-grep}
|
||||||
(add-hook 'counsel-grep-post-action-hook #'better-jumper-set-jump)
|
(add-hook 'counsel-grep-post-action-hook #'better-jumper-set-jump)
|
||||||
(add-hook 'counsel-grep-post-action-hook #'recenter)
|
(add-hook 'counsel-grep-post-action-hook #'recenter)
|
||||||
|
@ -285,15 +283,15 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
"Change `counsel-file-jump' to use fd or ripgrep, if they are available."
|
"Change `counsel-file-jump' to use fd or ripgrep, if they are available."
|
||||||
:override #'counsel--find-return-list
|
:override #'counsel--find-return-list
|
||||||
(cl-destructuring-bind (find-program . args)
|
(cl-destructuring-bind (find-program . args)
|
||||||
(cond ((when-let (fd (executable-find (or doom-projectile-fd-binary "fd")))
|
(cond ((when-let (fd (executable-find (or doom-projectile-fd-binary "fd") t))
|
||||||
(append (list fd "-H" "--color=never" "--type" "file" "--type" "symlink" "--follow")
|
(append (list fd "-H" "--color=never" "--type" "file" "--type" "symlink" "--follow")
|
||||||
(if IS-WINDOWS '("--path-separator=/")))))
|
(if IS-WINDOWS '("--path-separator=/")))))
|
||||||
((executable-find "rg")
|
((executable-find "rg" t)
|
||||||
(append (list "rg" "--files" "--follow" "--color=never" "--hidden" "-g!.git" "--no-messages")
|
(append (list "rg" "--files" "--follow" "--color=never" "--hidden" "-g!.git" "--no-messages")
|
||||||
(cl-loop for dir in projectile-globally-ignored-directories
|
(cl-loop for dir in projectile-globally-ignored-directories
|
||||||
collect "--glob"
|
collect "--glob"
|
||||||
collect (concat "!" dir))
|
collect (concat "!" dir))
|
||||||
(if IS-WINDOWS (list "--path-separator" "/"))))
|
(if IS-WINDOWS '("--path-separator=/"))))
|
||||||
((cons find-program args)))
|
((cons find-program args)))
|
||||||
(unless (listp args)
|
(unless (listp args)
|
||||||
(user-error "`counsel-file-jump-args' is a list now, please customize accordingly."))
|
(user-error "`counsel-file-jump-args' is a list now, please customize accordingly."))
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; completion/ivy/packages.el
|
;;; completion/ivy/packages.el
|
||||||
|
|
||||||
(package! swiper :pin "778d8bffa33ae0bf432aa23370bb2a535d2132ce")
|
(package! swiper :pin "d2891aab7b816aebf21ebd01ce33933a6ac6244f")
|
||||||
(package! ivy)
|
(package! ivy)
|
||||||
(package! ivy-hydra)
|
(package! ivy-hydra)
|
||||||
(package! ivy-avy)
|
(package! ivy-avy)
|
||||||
|
@ -9,16 +9,16 @@
|
||||||
|
|
||||||
(package! amx :pin "ccfc92c600df681df5e8b5fecec328c462ceb71e")
|
(package! amx :pin "ccfc92c600df681df5e8b5fecec328c462ceb71e")
|
||||||
(package! counsel-projectile :pin "06b03c1080d3ccc3fa9b9c41b1ccbcf13f058e4b")
|
(package! counsel-projectile :pin "06b03c1080d3ccc3fa9b9c41b1ccbcf13f058e4b")
|
||||||
(package! ivy-rich :pin "c0a164ce42920df0629c87dad5ea1bddc79ceac3")
|
(package! ivy-rich :pin "f8a1f5c90d2a113b597ef5903634c089fce3365b")
|
||||||
(package! wgrep :pin "f0ef9bfa44db503cdb2f83fcfbd2fa4e2382ef1f")
|
(package! wgrep :pin "f0ef9bfa44db503cdb2f83fcfbd2fa4e2382ef1f")
|
||||||
|
|
||||||
(if (featurep! +prescient)
|
(if (featurep! +prescient)
|
||||||
(package! ivy-prescient :pin "5d139e5b1fe03ccaddff8c250ab8e9d795071b95")
|
(package! ivy-prescient :pin "42adc802d3ba6c747bed7ea1f6e3ffbbdfc7192d")
|
||||||
(when (featurep! +fuzzy)
|
(when (featurep! +fuzzy)
|
||||||
(package! flx :pin "647cb2f92f9936c62e277d7a74ad54a80502d255")))
|
(package! flx :pin "647cb2f92f9936c62e277d7a74ad54a80502d255")))
|
||||||
|
|
||||||
(when (featurep! +childframe)
|
(when (featurep! +childframe)
|
||||||
(package! ivy-posframe :pin "08a00b81747c6b623dd1adc7491a1e2a4c3a3d2a"))
|
(package! ivy-posframe :pin "83047d440ff132d5a45acde5955f71853edeefb9"))
|
||||||
|
|
||||||
(when (featurep! +icons)
|
(when (featurep! +icons)
|
||||||
(package! all-the-icons-ivy :pin "a70cbfa1effe36efc946a823a580cec686d5e88d"))
|
(package! all-the-icons-ivy :pin "a70cbfa1effe36efc946a823a580cec686d5e88d"))
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
:desc "Find file from here" "F" #'+default/find-file-under-here
|
:desc "Find file from here" "F" #'+default/find-file-under-here
|
||||||
:desc "Locate file" "l" #'locate
|
:desc "Locate file" "l" #'locate
|
||||||
:desc "Rename/move this file" "m" #'doom/move-this-file
|
:desc "Rename/move this file" "m" #'doom/move-this-file
|
||||||
:desc "Find file in private config" "p" #'doom/open-private-config
|
:desc "Find file in private config" "p" #'doom/find-file-in-private-config
|
||||||
:desc "Browse private config" "P" #'doom/open-private-config
|
:desc "Browse private config" "P" #'doom/open-private-config
|
||||||
:desc "Recent files" "r" #'recentf-open-files
|
:desc "Recent files" "r" #'recentf-open-files
|
||||||
:desc "Recent project files" "R" #'projectile-recentf
|
:desc "Recent project files" "R" #'projectile-recentf
|
||||||
|
@ -307,6 +307,7 @@
|
||||||
:desc "Jump to previous hunk" "p" #'git-gutter:previous-hunk)
|
:desc "Jump to previous hunk" "p" #'git-gutter:previous-hunk)
|
||||||
(:when (featurep! :tools magit)
|
(:when (featurep! :tools magit)
|
||||||
:desc "Magit dispatch" "/" #'magit-dispatch
|
:desc "Magit dispatch" "/" #'magit-dispatch
|
||||||
|
:desc "Magit file dispatch" "." #'magit-file-dispatch
|
||||||
:desc "Forge dispatch" "'" #'forge-dispatch
|
:desc "Forge dispatch" "'" #'forge-dispatch
|
||||||
:desc "Magit status" "g" #'magit-status
|
:desc "Magit status" "g" #'magit-status
|
||||||
:desc "Magit status here" "G" #'magit-status-here
|
:desc "Magit status here" "G" #'magit-status-here
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
(use-package! expand-region
|
(use-package! expand-region
|
||||||
:commands (er/contract-region er/mark-symbol er/mark-word)
|
:commands (er/contract-region er/mark-symbol er/mark-word)
|
||||||
:config
|
:config
|
||||||
(defadvice! doom--quit-expand-region-a ()
|
(defadvice! doom--quit-expand-region-a (&rest _)
|
||||||
"Properly abort an expand-region region."
|
"Properly abort an expand-region region."
|
||||||
:before '(evil-escape doom/escape)
|
:before '(evil-escape doom/escape)
|
||||||
(when (memq last-command '(er/expand-region er/contract-region))
|
(when (memq last-command '(er/expand-region er/contract-region))
|
||||||
|
|
|
@ -411,6 +411,7 @@
|
||||||
:desc "Jump to previous hunk" "[" #'git-gutter:previous-hunk)
|
:desc "Jump to previous hunk" "[" #'git-gutter:previous-hunk)
|
||||||
(:when (featurep! :tools magit)
|
(:when (featurep! :tools magit)
|
||||||
:desc "Magit dispatch" "/" #'magit-dispatch
|
:desc "Magit dispatch" "/" #'magit-dispatch
|
||||||
|
:desc "Magit file dispatch" "." #'magit-file-dispatch
|
||||||
:desc "Forge dispatch" "'" #'forge-dispatch
|
:desc "Forge dispatch" "'" #'forge-dispatch
|
||||||
:desc "Magit switch branch" "b" #'magit-branch-checkout
|
:desc "Magit switch branch" "b" #'magit-branch-checkout
|
||||||
:desc "Magit status" "g" #'magit-status
|
:desc "Magit status" "g" #'magit-status
|
||||||
|
|
|
@ -45,9 +45,16 @@ If prefix ARG is non-nil, prompt for the search path."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(if arg
|
(if arg
|
||||||
(call-interactively #'projectile-discover-projects-in-directory)
|
(call-interactively #'projectile-discover-projects-in-directory)
|
||||||
(if projectile-project-search-path
|
(if (not projectile-project-search-path)
|
||||||
(mapc #'projectile-discover-projects-in-directory projectile-project-search-path)
|
(user-error "`projectile-project-search-path' is empty; don't know where to search")
|
||||||
(user-error "`projectile-project-search-path' is empty; don't know where to search"))))
|
(letf! (defun projectile-add-known-project (project-root)
|
||||||
|
(unless (projectile-ignored-project-p project-root)
|
||||||
|
(funcall projectile-add-known-project project-root)
|
||||||
|
(message "Added %S to known project roots" project-root)))
|
||||||
|
(dolist (dir projectile-project-search-path)
|
||||||
|
(if (not (file-accessible-directory-p dir))
|
||||||
|
(message "%S was inaccessible and couldn't searched" dir)
|
||||||
|
(projectile-discover-projects-in-directory dir)))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default/dired (arg)
|
(defun +default/dired (arg)
|
||||||
|
|
|
@ -310,7 +310,7 @@ Continues comments if executed from a commented line. Consults
|
||||||
"M" #'doom/describe-active-minor-mode
|
"M" #'doom/describe-active-minor-mode
|
||||||
"O" #'+lookup/online
|
"O" #'+lookup/online
|
||||||
"T" #'doom/toggle-profiler
|
"T" #'doom/toggle-profiler
|
||||||
"V" #'set-variable
|
"V" #'doom/help-custom-variable
|
||||||
"W" #'+default/man-or-woman
|
"W" #'+default/man-or-woman
|
||||||
"C-k" #'describe-key-briefly
|
"C-k" #'describe-key-briefly
|
||||||
"C-l" #'describe-language-environment
|
"C-l" #'describe-language-environment
|
||||||
|
|
|
@ -106,7 +106,7 @@ more information on modifiers."
|
||||||
(cond ((sp-point-in-comment pos)
|
(cond ((sp-point-in-comment pos)
|
||||||
(setq evil-auto-indent nil)
|
(setq evil-auto-indent nil)
|
||||||
(if comment-line-break-function
|
(if comment-line-break-function
|
||||||
(funcall comment-line-break-function)
|
(funcall comment-line-break-function nil)
|
||||||
(comment-indent-new-line)))
|
(comment-indent-new-line)))
|
||||||
;; TODO Find a better way to do this
|
;; TODO Find a better way to do this
|
||||||
((and (eq major-mode 'haskell-mode)
|
((and (eq major-mode 'haskell-mode)
|
||||||
|
@ -121,7 +121,8 @@ more information on modifiers."
|
||||||
(defun +evil--insert-newline-below-and-respect-comments-a (orig-fn count)
|
(defun +evil--insert-newline-below-and-respect-comments-a (orig-fn count)
|
||||||
(if (or (not +evil-want-o/O-to-continue-comments)
|
(if (or (not +evil-want-o/O-to-continue-comments)
|
||||||
(not (eq this-command 'evil-open-below))
|
(not (eq this-command 'evil-open-below))
|
||||||
(evil-insert-state-p))
|
(evil-insert-state-p)
|
||||||
|
(evil-emacs-state-p))
|
||||||
(funcall orig-fn count)
|
(funcall orig-fn count)
|
||||||
(letf! (defun evil-insert-newline-below () (+evil--insert-newline))
|
(letf! (defun evil-insert-newline-below () (+evil--insert-newline))
|
||||||
(let ((evil-auto-indent evil-auto-indent))
|
(let ((evil-auto-indent evil-auto-indent))
|
||||||
|
@ -131,7 +132,8 @@ more information on modifiers."
|
||||||
(defun +evil--insert-newline-above-and-respect-comments-a (orig-fn count)
|
(defun +evil--insert-newline-above-and-respect-comments-a (orig-fn count)
|
||||||
(if (or (not +evil-want-o/O-to-continue-comments)
|
(if (or (not +evil-want-o/O-to-continue-comments)
|
||||||
(not (eq this-command 'evil-open-above))
|
(not (eq this-command 'evil-open-above))
|
||||||
(evil-insert-state-p))
|
(evil-insert-state-p)
|
||||||
|
(evil-emacs-state-p))
|
||||||
(funcall orig-fn count)
|
(funcall orig-fn count)
|
||||||
(letf! (defun evil-insert-newline-above () (+evil--insert-newline 'above))
|
(letf! (defun evil-insert-newline-above () (+evil--insert-newline 'above))
|
||||||
(let ((evil-auto-indent evil-auto-indent))
|
(let ((evil-auto-indent evil-auto-indent))
|
||||||
|
@ -188,6 +190,7 @@ From https://github.com/emacs-evil/evil/issues/606"
|
||||||
(let* ((count (count-lines beg end))
|
(let* ((count (count-lines beg end))
|
||||||
(count (if (> count 1) (1- count) count))
|
(count (if (> count 1) (1- count) count))
|
||||||
(fixup-mark (make-marker)))
|
(fixup-mark (make-marker)))
|
||||||
|
(unwind-protect
|
||||||
(dotimes (var count)
|
(dotimes (var count)
|
||||||
(if (and (bolp) (eolp))
|
(if (and (bolp) (eolp))
|
||||||
(join-line 1)
|
(join-line 1)
|
||||||
|
@ -197,7 +200,7 @@ From https://github.com/emacs-evil/evil/issues/606"
|
||||||
(fill-region-as-paragraph beg end nil t)
|
(fill-region-as-paragraph beg end nil t)
|
||||||
(goto-char fixup-mark)
|
(goto-char fixup-mark)
|
||||||
(fixup-whitespace))))
|
(fixup-whitespace))))
|
||||||
(set-marker fixup-mark nil)))
|
(set-marker fixup-mark nil))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +evil--fix-dabbrev-in-minibuffer-h ()
|
(defun +evil--fix-dabbrev-in-minibuffer-h ()
|
||||||
|
|
|
@ -15,18 +15,18 @@
|
||||||
;;; Interactive commands
|
;;; Interactive commands
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +evil/visual-indent ()
|
(defun +evil/shift-right ()
|
||||||
"vnoremap < <gv"
|
"vnoremap < <gv"
|
||||||
(interactive)
|
(interactive)
|
||||||
(evil-shift-right (region-beginning) (region-end))
|
(call-interactively #'evil-shift-right)
|
||||||
(evil-normal-state)
|
(evil-normal-state)
|
||||||
(evil-visual-restore))
|
(evil-visual-restore))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +evil/visual-dedent ()
|
(defun +evil/shift-left ()
|
||||||
"vnoremap > >gv"
|
"vnoremap > >gv"
|
||||||
(interactive)
|
(interactive)
|
||||||
(evil-shift-left (region-beginning) (region-end))
|
(call-interactively #'evil-shift-left)
|
||||||
(evil-normal-state)
|
(evil-normal-state)
|
||||||
(evil-visual-restore))
|
(evil-visual-restore))
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
|
||||||
"Wrapper around `doom/retab'."
|
"Wrapper around `doom/retab'."
|
||||||
:motion nil :move-point nil :type line
|
:motion nil :move-point nil :type line
|
||||||
(interactive "<r>")
|
(interactive "<r>")
|
||||||
(doom/retab beg end))
|
(doom/retab nil beg end))
|
||||||
|
|
||||||
;;;###autoload (autoload '+evil:narrow-buffer "editor/evil/autoload/evil" nil t)
|
;;;###autoload (autoload '+evil:narrow-buffer "editor/evil/autoload/evil" nil t)
|
||||||
(evil-define-operator +evil:narrow-buffer (beg end &optional bang)
|
(evil-define-operator +evil:narrow-buffer (beg end &optional bang)
|
||||||
|
|
|
@ -20,7 +20,7 @@ directives. By default, this only recognizes C directives.")
|
||||||
;; Set these defaults before `evil'; use `defvar' so they can be changed prior
|
;; Set these defaults before `evil'; use `defvar' so they can be changed prior
|
||||||
;; to loading.
|
;; to loading.
|
||||||
(defvar evil-want-C-g-bindings t)
|
(defvar evil-want-C-g-bindings t)
|
||||||
(defvar evil-want-C-i-jump (or (daemonp) (display-graphic-p)))
|
(defvar evil-want-C-i-jump nil) ; we do this ourselves
|
||||||
(defvar evil-want-C-u-scroll t) ; moved the universal arg to <leader> u
|
(defvar evil-want-C-u-scroll t) ; moved the universal arg to <leader> u
|
||||||
(defvar evil-want-C-u-delete t)
|
(defvar evil-want-C-u-delete t)
|
||||||
(defvar evil-want-C-w-scroll t)
|
(defvar evil-want-C-w-scroll t)
|
||||||
|
@ -66,7 +66,7 @@ directives. By default, this only recognizes C directives.")
|
||||||
(put 'evil-define-key* 'lisp-indent-function 'defun)
|
(put 'evil-define-key* 'lisp-indent-function 'defun)
|
||||||
|
|
||||||
;; stop copying each visual state move to the clipboard:
|
;; stop copying each visual state move to the clipboard:
|
||||||
;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
|
;; https://github.com/emacs-evil/evil/issues/336
|
||||||
;; grokked from:
|
;; grokked from:
|
||||||
;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
|
;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
|
||||||
(advice-add #'evil-visual-update-x-selection :override #'ignore)
|
(advice-add #'evil-visual-update-x-selection :override #'ignore)
|
||||||
|
@ -419,6 +419,8 @@ directives. By default, this only recognizes C directives.")
|
||||||
;; zu{q,w} - undo last marking
|
;; zu{q,w} - undo last marking
|
||||||
|
|
||||||
(map! :v "@" #'+evil:apply-macro
|
(map! :v "@" #'+evil:apply-macro
|
||||||
|
:m [C-i] #'evil-jump-forward
|
||||||
|
:m [tab] #'evil-jump-item
|
||||||
|
|
||||||
;; implement dictionary keybinds
|
;; implement dictionary keybinds
|
||||||
;; evil already defines 'z=' to `ispell-word' = correct word at point
|
;; evil already defines 'z=' to `ispell-word' = correct word at point
|
||||||
|
@ -516,8 +518,8 @@ directives. By default, this only recognizes C directives.")
|
||||||
:n "zx" #'kill-current-buffer
|
:n "zx" #'kill-current-buffer
|
||||||
:n "ZX" #'doom/save-and-kill-buffer
|
:n "ZX" #'doom/save-and-kill-buffer
|
||||||
;; don't leave visual mode after shifting
|
;; don't leave visual mode after shifting
|
||||||
:v "<" #'+evil/visual-dedent ; vnoremap < <gv
|
:v "<" #'+evil/shift-left ; vnoremap < <gv
|
||||||
:v ">" #'+evil/visual-indent ; vnoremap > >gv
|
:v ">" #'+evil/shift-right ; vnoremap > >gv
|
||||||
|
|
||||||
;; window management (prefix "C-w")
|
;; window management (prefix "C-w")
|
||||||
(:map evil-window-map
|
(:map evil-window-map
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
elisp-mode
|
elisp-mode
|
||||||
ert
|
ert
|
||||||
free-keys
|
free-keys
|
||||||
help
|
|
||||||
helm
|
helm
|
||||||
indent
|
indent
|
||||||
image
|
image
|
||||||
|
@ -95,6 +94,7 @@ variable for an explanation of the defaults (in comments). See
|
||||||
comint
|
comint
|
||||||
company
|
company
|
||||||
compile
|
compile
|
||||||
|
consult
|
||||||
(custom cus-edit)
|
(custom cus-edit)
|
||||||
cus-theme
|
cus-theme
|
||||||
daemons
|
daemons
|
||||||
|
@ -102,6 +102,7 @@ variable for an explanation of the defaults (in comments). See
|
||||||
deadgrep
|
deadgrep
|
||||||
debbugs
|
debbugs
|
||||||
debug
|
debug
|
||||||
|
dictionary
|
||||||
diff-mode
|
diff-mode
|
||||||
dired
|
dired
|
||||||
dired-sidebar
|
dired-sidebar
|
||||||
|
@ -187,10 +188,12 @@ variable for an explanation of the defaults (in comments). See
|
||||||
python
|
python
|
||||||
quickrun
|
quickrun
|
||||||
racer
|
racer
|
||||||
|
racket-describe
|
||||||
realgud
|
realgud
|
||||||
reftex
|
reftex
|
||||||
restclient
|
restclient
|
||||||
rg
|
rg
|
||||||
|
ripgrep
|
||||||
rjsx-mode
|
rjsx-mode
|
||||||
robe
|
robe
|
||||||
rtags
|
rtags
|
||||||
|
@ -263,10 +266,15 @@ and complains if a module is loaded too early (during startup)."
|
||||||
"q" #'kill-current-buffer
|
"q" #'kill-current-buffer
|
||||||
"d" #'process-menu-delete-process)
|
"d" #'process-menu-delete-process)
|
||||||
|
|
||||||
(mapc #'+evil-collection-init '(comint custom help)))
|
(mapc #'+evil-collection-init '(comint custom)))
|
||||||
|
|
||||||
;; ...or on first invokation of their associated major/minor modes.
|
;; ...or on first invokation of their associated major/minor modes.
|
||||||
(after! evil
|
(after! evil
|
||||||
|
;; Emacs loads these two packages immediately, at startup, which needlessly
|
||||||
|
;; convolutes load order for evil-collection-help.
|
||||||
|
(defer-feature! help help-mode)
|
||||||
|
(defer-feature! help-mode help-mode)
|
||||||
|
|
||||||
(add-transient-hook! 'Buffer-menu-mode
|
(add-transient-hook! 'Buffer-menu-mode
|
||||||
(+evil-collection-init '(buff-menu "buff-menu")))
|
(+evil-collection-init '(buff-menu "buff-menu")))
|
||||||
(add-transient-hook! 'image-mode
|
(add-transient-hook! 'image-mode
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; editor/evil/packages.el
|
;;; editor/evil/packages.el
|
||||||
|
|
||||||
(package! evil :pin "d6cf6680ec52733ea78dc530ed75fadc5171c758")
|
(package! evil :pin "cc9d6886b418389752a0591b9fcb270e83234cf9")
|
||||||
(package! evil-args :pin "758ad5ae54ad34202064fec192c88151c08cb387")
|
(package! evil-args :pin "758ad5ae54ad34202064fec192c88151c08cb387")
|
||||||
(package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9")
|
(package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9")
|
||||||
(package! evil-embrace :pin "4379adea032b25e359d01a36301b4a5afdd0d1b7")
|
(package! evil-embrace :pin "4379adea032b25e359d01a36301b4a5afdd0d1b7")
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
(package! evil-snipe :pin "6dcac7f2516c6137a2de532fc2c052f242559ee3")
|
(package! evil-snipe :pin "6dcac7f2516c6137a2de532fc2c052f242559ee3")
|
||||||
(package! evil-surround :pin "346d4d85fcf1f9517e9c4991c1efe68b4130f93a")
|
(package! evil-surround :pin "346d4d85fcf1f9517e9c4991c1efe68b4130f93a")
|
||||||
(package! evil-textobj-anyblock :pin "ff00980f0634f95bf2ad9956b615a155ea8743be")
|
(package! evil-textobj-anyblock :pin "ff00980f0634f95bf2ad9956b615a155ea8743be")
|
||||||
(package! evil-traces :pin "bc25cae9fa5ab0ba1507827f0944f52ce0ca7462")
|
(package! evil-traces :pin "290b5323542c46af364ec485c8ec9000040acf90")
|
||||||
(package! evil-visualstar :pin "06c053d8f7381f91c53311b1234872ca96ced752")
|
(package! evil-visualstar :pin "06c053d8f7381f91c53311b1234872ca96ced752")
|
||||||
(package! exato :pin "aee7af7b7a0e7551478f453d1de7d5b9cb2e06c4")
|
(package! exato :pin "aee7af7b7a0e7551478f453d1de7d5b9cb2e06c4")
|
||||||
(package! evil-quick-diff
|
(package! evil-quick-diff
|
||||||
|
@ -33,4 +33,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 "ab5bb7c39199518d98035ef201096704a21a97ea"))
|
(package! evil-collection :pin "e6824e2ad2f2ee7ddccf6f54db655a4cd37a13dc"))
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
;;; `(file-name-nondirectory buffer-file-name)`${1: --- ${2:description}} -*- lexical-binding: t; -*-
|
;;; `(file-name-nondirectory buffer-file-name)`${1: --- ${2:Description}} -*- lexical-binding: t; -*-
|
||||||
;;
|
;;
|
||||||
;; Copyright (C) `(format-time-string "%Y")` `user-full-name`
|
;; Copyright (C) `(format-time-string "%Y")` `user-full-name`
|
||||||
;;
|
;;
|
||||||
;; Author: `user-full-name` <http://github/`user-login-name`>
|
;; Author: `user-full-name` <https://github.com/`(cl-find-if-not #'string-empty-p (list (cdr (doom-call-process "git" "config" "github.user")) user-login-name))`>
|
||||||
;; Maintainer: `user-full-name` <`user-mail-address`>
|
;; Maintainer: `user-full-name` <`user-mail-address`>
|
||||||
;; Created: `(format-time-string "%B %d, %Y")`
|
;; Created: `(format-time-string "%B %d, %Y")`
|
||||||
;; Modified: `(format-time-string "%B %d, %Y")`
|
;; Modified: `(format-time-string "%B %d, %Y")`
|
||||||
;; Version: 0.0.1
|
;; Version: 0.0.1
|
||||||
;; Keywords:
|
;; Keywords: `(mapconcat #'symbol-name (mapcar #'car finder-known-keywords) " ")`
|
||||||
;; Homepage: https://github.com/`user-login-name`/`(file-name-base buffer-file-name)`
|
;; Homepage: https://github.com/`user-login-name`/`(file-name-base buffer-file-name)`
|
||||||
;; Package-Requires: ((emacs `emacs-version`) (cl-lib "0.5"))
|
;; Package-Requires: ((emacs "24.3"))
|
||||||
;;
|
;;
|
||||||
;; This file is not part of GNU Emacs.
|
;; This file is not part of GNU Emacs.
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -20,8 +20,8 @@ marker, indent and syntax-based code folding for as many languages as possible.
|
||||||
This module provides no flags.
|
This module provides no flags.
|
||||||
|
|
||||||
** Plugins
|
** Plugins
|
||||||
+[[https://github.com/alexmurray/evil-vimish-fold][evil-vimish-fold]]
|
+ [[https://github.com/alexmurray/evil-vimish-fold][evil-vimish-fold]]
|
||||||
+[[https://github.com/matsievskiysv/vimish-fold][vimish-fold]]
|
+ [[https://github.com/matsievskiysv/vimish-fold][vimish-fold]]
|
||||||
|
|
||||||
* Prerequisites
|
* Prerequisites
|
||||||
This module has no prerequisites.
|
This module has no prerequisites.
|
||||||
|
|
|
@ -225,9 +225,9 @@ If nil, BEG and/or END will default to the boundaries of the src block at point.
|
||||||
(defun +format/buffer ()
|
(defun +format/buffer ()
|
||||||
"Reformat the current buffer using LSP or `format-all-buffer'."
|
"Reformat the current buffer using LSP or `format-all-buffer'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (and (eq major-mode 'org-mode)
|
(if (eq major-mode 'org-mode)
|
||||||
(org-in-src-block-p t))
|
(when (org-in-src-block-p t)
|
||||||
(+format--org-region nil nil)
|
(+format--org-region nil nil))
|
||||||
(call-interactively
|
(call-interactively
|
||||||
(cond ((and +format-with-lsp
|
(cond ((and +format-with-lsp
|
||||||
(bound-and-true-p lsp-mode)
|
(bound-and-true-p lsp-mode)
|
||||||
|
|
|
@ -168,7 +168,7 @@
|
||||||
(defun +multiple-cursors-compat-back-to-previous-state-h ()
|
(defun +multiple-cursors-compat-back-to-previous-state-h ()
|
||||||
(when +mc--compat-evil-prev-state
|
(when +mc--compat-evil-prev-state
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(case +mc--compat-evil-prev-state
|
(cl-case +mc--compat-evil-prev-state
|
||||||
((normal visual) (evil-force-normal-state))
|
((normal visual) (evil-force-normal-state))
|
||||||
(t (message "Don't know how to handle previous state: %S"
|
(t (message "Don't know how to handle previous state: %S"
|
||||||
+mc--compat-evil-prev-state)))
|
+mc--compat-evil-prev-state)))
|
||||||
|
|
|
@ -33,6 +33,15 @@ ignored. This makes it easy to override built-in snippets with private ones."
|
||||||
(make-directory dir t)
|
(make-directory dir t)
|
||||||
(error "%S doesn't exist" (abbreviate-file-name dir)))))
|
(error "%S doesn't exist" (abbreviate-file-name dir)))))
|
||||||
|
|
||||||
|
(defun +snippet--get-template-by-uuid (uuid &optional mode)
|
||||||
|
"Look up the template by uuid in child-most to parent-most mode order.
|
||||||
|
Finds correctly active snippets from parent modes (based on Yas' logic)."
|
||||||
|
(cl-loop with mode = (or mode major-mode)
|
||||||
|
for active-mode in (yas--modes-to-activate mode)
|
||||||
|
if (gethash active-mode yas--tables)
|
||||||
|
if (gethash uuid (yas--table-uuidhash it))
|
||||||
|
return it))
|
||||||
|
|
||||||
(defun +snippet--completing-read-uuid (prompt all-snippets &rest args)
|
(defun +snippet--completing-read-uuid (prompt all-snippets &rest args)
|
||||||
(plist-get
|
(plist-get
|
||||||
(text-properties-at
|
(text-properties-at
|
||||||
|
@ -169,7 +178,7 @@ buggy behavior when <delete> is pressed in an empty field."
|
||||||
(interactive
|
(interactive
|
||||||
(list
|
(list
|
||||||
(+snippet--completing-read-uuid "Visit snippet: " current-prefix-arg)))
|
(+snippet--completing-read-uuid "Visit snippet: " current-prefix-arg)))
|
||||||
(if-let* ((template (yas--get-template-by-uuid major-mode template-uuid))
|
(if-let* ((template (+snippet--get-template-by-uuid template-uuid major-mode))
|
||||||
(template-path (yas--template-load-file template)))
|
(template-path (yas--template-load-file template)))
|
||||||
(progn
|
(progn
|
||||||
(unless (file-readable-p template-path)
|
(unless (file-readable-p template-path)
|
||||||
|
@ -242,7 +251,7 @@ shadow the default snippet)."
|
||||||
(if-let* ((major-mode (if (eq major-mode 'snippet-mode)
|
(if-let* ((major-mode (if (eq major-mode 'snippet-mode)
|
||||||
(intern (file-name-base (directory-file-name default-directory)))
|
(intern (file-name-base (directory-file-name default-directory)))
|
||||||
major-mode))
|
major-mode))
|
||||||
(template (yas--get-template-by-uuid major-mode template-uuid))
|
(template (+snippet--get-template-by-uuid template-uuid major-mode))
|
||||||
(template-path (yas--template-load-file template)))
|
(template-path (yas--template-load-file template)))
|
||||||
(if (file-in-directory-p template-path +snippets-dir)
|
(if (file-in-directory-p template-path +snippets-dir)
|
||||||
(find-file template-path)
|
(find-file template-path)
|
||||||
|
@ -312,5 +321,7 @@ is."
|
||||||
(defun region-end () evil-visual-end))
|
(defun region-end () evil-visual-end))
|
||||||
(funcall orig-fn no-condition)))
|
(funcall orig-fn no-condition)))
|
||||||
(when (and (bound-and-true-p evil-local-mode)
|
(when (and (bound-and-true-p evil-local-mode)
|
||||||
|
(not (or (evil-emacs-state-p)
|
||||||
|
(evil-insert-state-p)))
|
||||||
(yas-active-snippets))
|
(yas-active-snippets))
|
||||||
(evil-insert-state +1)))
|
(evil-insert-state +1)))
|
||||||
|
|
|
@ -93,6 +93,7 @@ info in the `header-line-format' is a more visible indicator."
|
||||||
"Start git-commit-mode in insert state if in a blank commit message,
|
"Start git-commit-mode in insert state if in a blank commit message,
|
||||||
otherwise in default state."
|
otherwise in default state."
|
||||||
(when (and (bound-and-true-p evil-mode)
|
(when (and (bound-and-true-p evil-mode)
|
||||||
|
(not (evil-emacs-state-p))
|
||||||
(bobp) (eolp))
|
(bobp) (eolp))
|
||||||
(evil-insert-state)))))
|
(evil-insert-state)))))
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
(package! smerge-mode :built-in t)
|
(package! smerge-mode :built-in t)
|
||||||
|
|
||||||
(package! browse-at-remote :pin "fadf99d6d8e891f3b112e36c772e0eea0b9bc7f2")
|
(package! browse-at-remote :pin "fadf99d6d8e891f3b112e36c772e0eea0b9bc7f2")
|
||||||
(package! git-commit :pin "2fb3bf782ccf5652b98f8de989f014749473eacf")
|
(package! git-commit :pin "acfe22ab60a56c61aae3ca6d4f2b7b826fe3b071")
|
||||||
(package! git-timemachine :pin "8d675750e921a047707fcdc36d84f8439b19a907")
|
(package! git-timemachine :pin "8d675750e921a047707fcdc36d84f8439b19a907")
|
||||||
(package! gitconfig-mode :pin "55468314a5f6b77d2c96be62c7005ac94545e217")
|
(package! gitconfig-mode :pin "55468314a5f6b77d2c96be62c7005ac94545e217")
|
||||||
(package! gitignore-mode :pin "55468314a5f6b77d2c96be62c7005ac94545e217")
|
(package! gitignore-mode :pin "55468314a5f6b77d2c96be62c7005ac94545e217")
|
||||||
|
|
|
@ -86,6 +86,11 @@ This module requires:
|
||||||
| =<localleader> n N= | =cider-browse-ns-all= |
|
| =<localleader> n N= | =cider-browse-ns-all= |
|
||||||
| =<localleader> n n= | =cider-browse-ns= |
|
| =<localleader> n n= | =cider-browse-ns= |
|
||||||
| =<localleader> n r= | =cider-ns-refresh= |
|
| =<localleader> n r= | =cider-ns-refresh= |
|
||||||
|
| =<localleader> p d= | =cider-pprint-eval-defun-at-point= |
|
||||||
|
| =<localleader> p D= | =cider-pprint-eval-defun-to-comment= |
|
||||||
|
| =<localleader> p p= | =cider-pprint-eval-last-sexp= |
|
||||||
|
| =<localleader> p P= | =cider-pprint-eval-last-sexp-to-comment= |
|
||||||
|
| =<localleader> p r= | =cider-pprint-eval-last-sexp-to-repl= |
|
||||||
| =<localleader> r B= | =+clojure/cider-switch-to-repl-buffer-and-switch-ns= |
|
| =<localleader> r B= | =+clojure/cider-switch-to-repl-buffer-and-switch-ns= |
|
||||||
| =<localleader> r L= | =cider-load-buffer-and-switch-to-repl-buffer= |
|
| =<localleader> r L= | =cider-load-buffer-and-switch-to-repl-buffer= |
|
||||||
| =<localleader> r R= | =cider-restart= |
|
| =<localleader> r R= | =cider-restart= |
|
||||||
|
|
|
@ -126,6 +126,12 @@
|
||||||
"n" #'cider-browse-ns
|
"n" #'cider-browse-ns
|
||||||
"N" #'cider-browse-ns-all
|
"N" #'cider-browse-ns-all
|
||||||
"r" #'cider-ns-refresh)
|
"r" #'cider-ns-refresh)
|
||||||
|
(:prefix ("p" . "print")
|
||||||
|
"p" #'cider-pprint-eval-last-sexp
|
||||||
|
"P" #'cider-pprint-eval-last-sexp-to-comment
|
||||||
|
"d" #'cider-pprint-eval-defun-at-point
|
||||||
|
"D" #'cider-pprint-eval-defun-to-comment
|
||||||
|
"r" #'cider-pprint-eval-last-sexp-to-repl)
|
||||||
(:prefix ("r" . "repl")
|
(:prefix ("r" . "repl")
|
||||||
"n" #'cider-repl-set-ns
|
"n" #'cider-repl-set-ns
|
||||||
"q" #'cider-quit
|
"q" #'cider-quit
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
;;; lang/clojure/packages.el
|
;;; lang/clojure/packages.el
|
||||||
|
|
||||||
(package! clojure-mode :pin "53ef8ac076ae7811627fbdd408e519ab7fca9a0b")
|
(package! clojure-mode :pin "53ef8ac076ae7811627fbdd408e519ab7fca9a0b")
|
||||||
(package! cider :pin "ef47c1de151c212b8d2ddeb9af6c8b0dfc0e300f")
|
(package! cider :pin "1a34f893e1fe81982fb5099192122a72ee8e94ea")
|
||||||
(package! clj-refactor :pin "6db85b37b57497b56d97d5e5512160e5db85f798")
|
(package! clj-refactor :pin "9dcc50da7ce6f3c10276c87f09022e80c03e8bef")
|
||||||
|
|
||||||
(when (featurep! :checkers syntax)
|
(when (featurep! :checkers syntax)
|
||||||
(package! flycheck-clj-kondo :pin "a558bda44c4cb65b69fa53df233e8941ebd195c5"))
|
(package! flycheck-clj-kondo :pin "a558bda44c4cb65b69fa53df233e8941ebd195c5"))
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
;;; lang/common-lisp/doctor.el -*- lexical-binding: t; -*-
|
;;; lang/common-lisp/doctor.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(when (require 'sly nil t)
|
(when (require 'sly nil t)
|
||||||
(unless (executable-find inferior-lisp-program)
|
(let ((prog-name (car (split-string inferior-lisp-program))))
|
||||||
|
(unless (executable-find prog-name)
|
||||||
(warn! "Couldn't find your `inferior-lisp-program' (%s). Is it installed?"
|
(warn! "Couldn't find your `inferior-lisp-program' (%s). Is it installed?"
|
||||||
inferior-lisp-program)))
|
inferior-lisp-program))))
|
||||||
|
|
|
@ -7,6 +7,26 @@
|
||||||
(set-rotate-patterns! 'csharp-mode
|
(set-rotate-patterns! 'csharp-mode
|
||||||
:symbols '(("public" "protected" "private")
|
:symbols '(("public" "protected" "private")
|
||||||
("class" "struct")))
|
("class" "struct")))
|
||||||
|
(set-ligatures! 'csharp-mode
|
||||||
|
;; Functional
|
||||||
|
:lambda "() =>"
|
||||||
|
;; Types
|
||||||
|
:null "null"
|
||||||
|
:true "true"
|
||||||
|
:false "false"
|
||||||
|
:int "int"
|
||||||
|
:float "float"
|
||||||
|
:str "string"
|
||||||
|
:bool "bool"
|
||||||
|
:list "List"
|
||||||
|
;; Flow
|
||||||
|
:not "!"
|
||||||
|
:in "in"
|
||||||
|
:and "&&"
|
||||||
|
:or "||"
|
||||||
|
:for "for"
|
||||||
|
:return "return"
|
||||||
|
:yield "yield")
|
||||||
|
|
||||||
(sp-local-pair 'csharp-mode "<" ">"
|
(sp-local-pair 'csharp-mode "<" ">"
|
||||||
:when '(+csharp-sp-point-in-type-p)
|
:when '(+csharp-sp-point-in-type-p)
|
||||||
|
|
|
@ -61,7 +61,9 @@ to a pop up buffer."
|
||||||
(defun +emacs-lisp-lookup-definition (_thing)
|
(defun +emacs-lisp-lookup-definition (_thing)
|
||||||
"Lookup definition of THING."
|
"Lookup definition of THING."
|
||||||
(if-let (module (+emacs-lisp--module-at-point))
|
(if-let (module (+emacs-lisp--module-at-point))
|
||||||
(doom/help-modules (car module) (cadr module) 'visit-dir)
|
;; FIXME: this is probably a bug in `counsel'. See
|
||||||
|
;; https://github.com/abo-abo/swiper/pull/2752.
|
||||||
|
(progn (doom/help-modules (car module) (cadr module) 'visit-dir) 'deferred)
|
||||||
(call-interactively #'elisp-def)))
|
(call-interactively #'elisp-def)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
@ -99,6 +99,7 @@ employed so that flycheck still does *some* helpful linting.")
|
||||||
"Display variable value next to documentation in eldoc."
|
"Display variable value next to documentation in eldoc."
|
||||||
:around #'elisp-get-var-docstring
|
:around #'elisp-get-var-docstring
|
||||||
(when-let (ret (funcall orig-fn sym))
|
(when-let (ret (funcall orig-fn sym))
|
||||||
|
(if (fboundp sym)
|
||||||
(concat ret " "
|
(concat ret " "
|
||||||
(let* ((truncated " [...]")
|
(let* ((truncated " [...]")
|
||||||
(print-escape-newlines t)
|
(print-escape-newlines t)
|
||||||
|
@ -107,7 +108,8 @@ employed so that flycheck still does *some* helpful linting.")
|
||||||
(limit (- (frame-width) (length ret) (length truncated) 1)))
|
(limit (- (frame-width) (length ret) (length truncated) 1)))
|
||||||
(format (format "%%0.%ds%%s" (max limit 0))
|
(format (format "%%0.%ds%%s" (max limit 0))
|
||||||
(propertize str 'face 'warning)
|
(propertize str 'face 'warning)
|
||||||
(if (< (length str) limit) "" truncated))))))
|
(if (< (length str) limit) "" truncated))))
|
||||||
|
ret)))
|
||||||
|
|
||||||
(map! :localleader
|
(map! :localleader
|
||||||
:map emacs-lisp-mode-map
|
:map emacs-lisp-mode-map
|
||||||
|
@ -181,12 +183,12 @@ employed so that flycheck still does *some* helpful linting.")
|
||||||
"Add Doom's own demos to help buffers."
|
"Add Doom's own demos to help buffers."
|
||||||
:around #'elisp-demos--search
|
:around #'elisp-demos--search
|
||||||
(or (funcall orig-fn symbol)
|
(or (funcall orig-fn symbol)
|
||||||
(when-let (demos-file (doom-glob doom-docs-dir "api.org"))
|
(when-let (demos-file (doom-module-locate-path :lang 'emacs-lisp "demos.org"))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents demos-file)
|
(insert-file-contents demos-file)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(when (re-search-forward
|
(when (re-search-forward
|
||||||
(format "^\\*\\*\\* %s$" (regexp-quote (symbol-name symbol)))
|
(format "^\\*\\* %s$" (regexp-quote (symbol-name symbol)))
|
||||||
nil t)
|
nil t)
|
||||||
(let (beg end)
|
(let (beg end)
|
||||||
(forward-line 1)
|
(forward-line 1)
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#+TITLE: API Demos
|
#+TITLE: API Demos
|
||||||
#+PROPERTY: header-args:elisp :results pp
|
#+PROPERTY: header-args:elisp :results pp
|
||||||
|
|
||||||
This appendix serves as a reference on how to use Doom Emacs' standard library.
|
This file contains demos of Doom's public API; its core library, macros, and
|
||||||
It is integrated into Helpful, in Doom.
|
autodefs. It is used by the =elisp-demos= package to display examples of their
|
||||||
|
usage from their documentation (e.g. =SPC h f add-hook\!=).
|
||||||
|
|
||||||
* Table of Contents :TOC_3:
|
* Table of Contents :TOC_3:
|
||||||
- [[#examples-for-dooms-library][Examples for Doom's library]]
|
- [[#core-lib][core-lib]]
|
||||||
- [[#core-lib][core-lib]]
|
|
||||||
- [[#add-hook][add-hook!]]
|
- [[#add-hook][add-hook!]]
|
||||||
- [[#add-transient-hook][add-transient-hook!]]
|
- [[#add-transient-hook][add-transient-hook!]]
|
||||||
- [[#after][after!]]
|
- [[#after][after!]]
|
||||||
|
@ -20,6 +20,8 @@ It is integrated into Helpful, in Doom.
|
||||||
- [[#file-exists-p][file-exists-p!]]
|
- [[#file-exists-p][file-exists-p!]]
|
||||||
- [[#cmd][cmd!]]
|
- [[#cmd][cmd!]]
|
||||||
- [[#cmd-1][cmd!!]]
|
- [[#cmd-1][cmd!!]]
|
||||||
|
- [[#cmds][cmds!]]
|
||||||
|
- [[#kbd][kbd!]]
|
||||||
- [[#letenv][letenv!]]
|
- [[#letenv][letenv!]]
|
||||||
- [[#load][load!]]
|
- [[#load][load!]]
|
||||||
- [[#map][map!]]
|
- [[#map][map!]]
|
||||||
|
@ -32,15 +34,9 @@ It is integrated into Helpful, in Doom.
|
||||||
- [[#setq-hook][setq-hook!]]
|
- [[#setq-hook][setq-hook!]]
|
||||||
- [[#unsetq-hook][unsetq-hook!]]
|
- [[#unsetq-hook][unsetq-hook!]]
|
||||||
- [[#use-package][use-package!]]
|
- [[#use-package][use-package!]]
|
||||||
- [[#interesting-snippets][Interesting snippets]]
|
|
||||||
- [[#center-emacs-initial-frame-with-a-fixed-size][Center Emacs' initial frame with a fixed size]]
|
|
||||||
- [[#persist-emacs-initial-frame-position-dimensions-andor-full-screen-state-across-sessions][Persist Emacs' initial frame position, dimensions and/or full-screen state across sessions]]
|
|
||||||
- [[#update-cursor-shape-under-terminal-emacs][Update cursor shape under terminal Emacs]]
|
|
||||||
- [[#create-a-paste-transient-state-to-cycle-through-kill-ring-on-paste][Create a paste-transient-state to cycle through kill ring on paste]]
|
|
||||||
|
|
||||||
* Examples for Doom's library
|
* core-lib
|
||||||
** core-lib
|
** add-hook!
|
||||||
*** add-hook!
|
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
;; With only one hook and one function, this is identical to `add-hook'. In that
|
;; With only one hook and one function, this is identical to `add-hook'. In that
|
||||||
;; case, use that instead.
|
;; case, use that instead.
|
||||||
|
@ -68,8 +64,8 @@ It is integrated into Helpful, in Doom.
|
||||||
...))
|
...))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** TODO add-transient-hook!
|
** TODO add-transient-hook!
|
||||||
*** after!
|
** after!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
;;; `after!' will take:
|
;;; `after!' will take:
|
||||||
|
|
||||||
|
@ -95,7 +91,7 @@ It is integrated into Helpful, in Doom.
|
||||||
(after! rustic ...)
|
(after! rustic ...)
|
||||||
(after! python ...)
|
(after! python ...)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** appendq!
|
** appendq!
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(let ((x '(a b c)))
|
(let ((x '(a b c)))
|
||||||
(appendq! x '(c d e))
|
(appendq! x '(c d e))
|
||||||
|
@ -116,7 +112,7 @@ It is integrated into Helpful, in Doom.
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: (a b c c d e f g h)
|
: (a b c c d e f g h)
|
||||||
|
|
||||||
*** custom-set-faces!
|
** custom-set-faces!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
(custom-set-faces!
|
(custom-set-faces!
|
||||||
'(outline-1 :weight normal)
|
'(outline-1 :weight normal)
|
||||||
|
@ -150,7 +146,7 @@ It is integrated into Helpful, in Doom.
|
||||||
`(outline-2 :background ,(doom-color 'blue)))
|
`(outline-2 :background ,(doom-color 'blue)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** custom-theme-set-faces!
|
** custom-theme-set-faces!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
(custom-theme-set-faces! 'doom-one
|
(custom-theme-set-faces! 'doom-one
|
||||||
'(outline-1 :weight normal)
|
'(outline-1 :weight normal)
|
||||||
|
@ -184,15 +180,15 @@ It is integrated into Helpful, in Doom.
|
||||||
`(outline-2 :background ,(doom-color 'blue)))
|
`(outline-2 :background ,(doom-color 'blue)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** TODO defer-feature!
|
** TODO defer-feature!
|
||||||
*** TODO defer-until!
|
** TODO defer-until!
|
||||||
*** disable-packages!
|
** disable-packages!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
;; Disable packages enabled by DOOM
|
;; Disable packages enabled by DOOM
|
||||||
(disable-packages! some-package second-package)
|
(disable-packages! some-package second-package)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** doom!
|
** doom!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
(doom! :completion
|
(doom! :completion
|
||||||
company
|
company
|
||||||
|
@ -222,7 +218,7 @@ It is integrated into Helpful, in Doom.
|
||||||
(default +bindings +smartparens))
|
(default +bindings +smartparens))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** file-exists-p!
|
** file-exists-p!
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(file-exists-p! "init.el" doom-emacs-dir)
|
(file-exists-p! "init.el" doom-emacs-dir)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
@ -239,12 +235,12 @@ It is integrated into Helpful, in Doom.
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: /home/hlissner/.emacs.d/LICENSE
|
: /home/hlissner/.emacs.d/LICENSE
|
||||||
|
|
||||||
*** cmd!
|
** cmd!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
(map! "C-j" (cmd! (newline) (indent-according-to-mode)))
|
(map! "C-j" (cmd! (newline) (indent-according-to-mode)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** cmd!!
|
** cmd!!
|
||||||
When ~newline~ is passed a numerical prefix argument (=C-u 5 M-x newline=), it
|
When ~newline~ is passed a numerical prefix argument (=C-u 5 M-x newline=), it
|
||||||
inserts N newlines. We can use ~cmd!!~ to easily create a keybinds that bakes in
|
inserts N newlines. We can use ~cmd!!~ to easily create a keybinds that bakes in
|
||||||
the prefix arg into the command call:
|
the prefix arg into the command call:
|
||||||
|
@ -263,7 +259,33 @@ Or to create aliases for functions that behave differently:
|
||||||
(fset 'org-reset-global-visibility (cmd!! #'org-global-cycle '(4))
|
(fset 'org-reset-global-visibility (cmd!! #'org-global-cycle '(4))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** letenv!
|
** cmds!
|
||||||
|
#+BEGIN_SRC elisp :eval no
|
||||||
|
(map! :i [tab] (cmds! (and (featurep! :editor snippets)
|
||||||
|
(bound-and-true-p yas-minor-mode)
|
||||||
|
(yas-maybe-expand-abbrev-key-filter 'yas-expand))
|
||||||
|
#'yas-expand
|
||||||
|
(featurep! :completion company +tng)
|
||||||
|
#'company-indent-or-complete-common)
|
||||||
|
:m [tab] (cmds! (and (bound-and-true-p yas-minor-mode)
|
||||||
|
(evil-visual-state-p)
|
||||||
|
(or (eq evil-visual-selection 'line)
|
||||||
|
(not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\))))))
|
||||||
|
#'yas-insert-snippet
|
||||||
|
(and (featurep! :editor fold)
|
||||||
|
(save-excursion (end-of-line) (invisible-p (point))))
|
||||||
|
#'+fold/toggle
|
||||||
|
(fboundp 'evil-jump-item)
|
||||||
|
#'evil-jump-item))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** kbd!
|
||||||
|
#+BEGIN_SRC elisp :eval no
|
||||||
|
(map! "," (kbd! "SPC")
|
||||||
|
";" (kbd! ":"))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** letenv!
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(letenv! (("SHELL" "/bin/sh"))
|
(letenv! (("SHELL" "/bin/sh"))
|
||||||
(shell-command-to-string "echo $SHELL"))
|
(shell-command-to-string "echo $SHELL"))
|
||||||
|
@ -272,7 +294,7 @@ Or to create aliases for functions that behave differently:
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: "/bin/sh\n"
|
: "/bin/sh\n"
|
||||||
|
|
||||||
*** load!
|
** load!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
;;; Lets say we're in ~/.doom.d/config.el
|
;;; Lets say we're in ~/.doom.d/config.el
|
||||||
(load! "lisp/module") ; loads ~/.doom.d/lisp/module.el
|
(load! "lisp/module") ; loads ~/.doom.d/lisp/module.el
|
||||||
|
@ -283,7 +305,7 @@ Or to create aliases for functions that behave differently:
|
||||||
(load! "~/.maynotexist" nil t)
|
(load! "~/.maynotexist" nil t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** map!
|
** map!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
(map! :map magit-mode-map
|
(map! :map magit-mode-map
|
||||||
:m "C-r" 'do-something ; C-r in motion state
|
:m "C-r" 'do-something ; C-r in motion state
|
||||||
|
@ -378,7 +400,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||||
(:map go-lisp-mode :n "C-x x" #'do-something-else))
|
(:map go-lisp-mode :n "C-x x" #'do-something-else))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** package!
|
** package!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
;; To install a package that can be found on ELPA or any of the sources
|
;; To install a package that can be found on ELPA or any of the sources
|
||||||
;; specified in `straight-recipe-repositories':
|
;; specified in `straight-recipe-repositories':
|
||||||
|
@ -410,7 +432,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||||
(package! evil :ignore (not (equal system-name "my-desktop")))
|
(package! evil :ignore (not (equal system-name "my-desktop")))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** pushnew!
|
** pushnew!
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(let ((list '(a b c)))
|
(let ((list '(a b c)))
|
||||||
(pushnew! list 'c 'd 'e)
|
(pushnew! list 'c 'd 'e)
|
||||||
|
@ -420,7 +442,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: (e d a b c)
|
: (e d a b c)
|
||||||
|
|
||||||
*** prependq!
|
** prependq!
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(let ((x '(a b c)))
|
(let ((x '(a b c)))
|
||||||
(prependq! x '(c d e))
|
(prependq! x '(c d e))
|
||||||
|
@ -441,12 +463,12 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: (c d e f g h a b c)
|
: (c d e f g h a b c)
|
||||||
|
|
||||||
*** quiet!
|
** quiet!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
;; Enters recentf-mode without extra output
|
;; Enters recentf-mode without extra output
|
||||||
(quiet! (recentf-mode +1))
|
(quiet! (recentf-mode +1))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** remove-hook!
|
** remove-hook!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
;; With only one hook and one function, this is identical to `remove-hook'. In
|
;; With only one hook and one function, this is identical to `remove-hook'. In
|
||||||
;; that case, use that instead.
|
;; that case, use that instead.
|
||||||
|
@ -464,7 +486,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||||
;; Removing arbitrary forms (must be exactly the same as the definition)
|
;; Removing arbitrary forms (must be exactly the same as the definition)
|
||||||
(remove-hook! (one-mode second-mode) (setq v 5) (setq a 2))
|
(remove-hook! (one-mode second-mode) (setq v 5) (setq a 2))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** setq!
|
** setq!
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
;; Each of these have a setter associated with them, which must be triggered in
|
;; Each of these have a setter associated with them, which must be triggered in
|
||||||
;; order for their new values to have an effect.
|
;; order for their new values to have an effect.
|
||||||
|
@ -472,7 +494,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||||
evil-want-C-u-scroll nil
|
evil-want-C-u-scroll nil
|
||||||
evil-want-C-d-scroll nil)
|
evil-want-C-d-scroll nil)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** setq-hook!
|
** setq-hook!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
;; Set multiple variables after a hook
|
;; Set multiple variables after a hook
|
||||||
(setq-hook! 'markdown-mode-hook
|
(setq-hook! 'markdown-mode-hook
|
||||||
|
@ -484,7 +506,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||||
hscroll-margin 0)
|
hscroll-margin 0)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** unsetq-hook!
|
** unsetq-hook!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
(unsetq-hook! 'markdown-mode-hook line-spacing)
|
(unsetq-hook! 'markdown-mode-hook line-spacing)
|
||||||
|
|
||||||
|
@ -498,7 +520,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||||
(unsetq-hook! (one-mode second-mode) enable-something)
|
(unsetq-hook! (one-mode second-mode) enable-something)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** use-package!
|
** use-package!
|
||||||
#+BEGIN_SRC elisp :eval no
|
#+BEGIN_SRC elisp :eval no
|
||||||
;; Use after-call to load package before hook
|
;; Use after-call to load package before hook
|
||||||
(use-package! projectile
|
(use-package! projectile
|
||||||
|
@ -513,79 +535,3 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||||
(use-package! abc
|
(use-package! abc
|
||||||
:defer-incrementally t)
|
:defer-incrementally t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Interesting snippets
|
|
||||||
** Center Emacs' initial frame with a fixed size
|
|
||||||
#+BEGIN_SRC elisp
|
|
||||||
(let ((width 500)
|
|
||||||
(height 250)
|
|
||||||
(display-height (display-pixel-height))
|
|
||||||
(display-width (display-pixel-width)))
|
|
||||||
(pushnew! initial-frame-alist
|
|
||||||
`(left . ,(- (/ display-width 2) (/ width 2)))
|
|
||||||
`(top . ,(- (/ display-height 2) (/ height 2)))
|
|
||||||
`(width text-pixels ,width)
|
|
||||||
`(height text-pixels ,height)))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
** Persist Emacs' initial frame position, dimensions and/or full-screen state across sessions
|
|
||||||
#+BEGIN_SRC elisp
|
|
||||||
;; add to ~/.doom.d/config.el
|
|
||||||
(when-let (dims (doom-store-get 'last-frame-size))
|
|
||||||
(cl-destructuring-bind ((left . top) width height fullscreen) dims
|
|
||||||
(setq initial-frame-alist
|
|
||||||
(append initial-frame-alist
|
|
||||||
`((left . ,left)
|
|
||||||
(top . ,top)
|
|
||||||
(width . ,width)
|
|
||||||
(height . ,height)
|
|
||||||
(fullscreen . ,fullscreen))))))
|
|
||||||
|
|
||||||
(defun save-frame-dimensions ()
|
|
||||||
(doom-store-put 'last-frame-size
|
|
||||||
(list (frame-position)
|
|
||||||
(frame-width)
|
|
||||||
(frame-height)
|
|
||||||
(frame-parameter nil 'fullscreen))))
|
|
||||||
|
|
||||||
(add-hook 'kill-emacs-hook #'save-frame-dimensions)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
** Update cursor shape under terminal Emacs
|
|
||||||
Install [[https://github.com/7696122/evil-terminal-cursor-changer][evil-terminal-cursor-changer]]. The package isn't included in Doom because
|
|
||||||
it is not maintained, unreasonably buggy, and lacks support for a number of
|
|
||||||
terminals. Where it fails, it inserts unexpected characters into the buffer. To
|
|
||||||
uphold the principle of least surprise, an unchanging cursor is less surprising
|
|
||||||
than unwarranted characters.
|
|
||||||
|
|
||||||
#+BEGIN_SRC elisp
|
|
||||||
;; ~/.doom.d/packages.el
|
|
||||||
(package! evil-terminal-cursor-changer)
|
|
||||||
|
|
||||||
;; ~/.doom.d/config.el
|
|
||||||
(use-package! evil-terminal-cursor-changer
|
|
||||||
:hook (tty-setup . evil-terminal-cursor-changer-activate))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
Alternatively, an updated version exists at
|
|
||||||
[[https://github.com/amosbird/evil-terminal-cursor-changer][amosbird/evil-terminal-cursor-changer]], with support for urxvt and tmux.
|
|
||||||
|
|
||||||
** Create a paste-transient-state to cycle through kill ring on paste
|
|
||||||
Replaces the default evil-paste binding to paste then let you cycle through entries in your kill ring. Gives you more flexibility when copying to your clipboard, making edits, then deciding to paste after.
|
|
||||||
|
|
||||||
You will need to enable the `hydra` module first.
|
|
||||||
|
|
||||||
#+BEGIN_SRC elisp
|
|
||||||
(defhydra hydra-paste (:color red
|
|
||||||
:hint nil)
|
|
||||||
"\n[%s(length kill-ring-yank-pointer)/%s(length kill-ring)] \
|
|
||||||
[_C-j_/_C-k_] cycles through yanked text, [_p_/_P_] pastes the same text \
|
|
||||||
above or below. Anything else exits."
|
|
||||||
("C-j" evil-paste-pop)
|
|
||||||
("C-k" evil-paste-pop-next)
|
|
||||||
("p" evil-paste-after)
|
|
||||||
("P" evil-paste-before))
|
|
||||||
|
|
||||||
(map! :nv "p" #'hydra-paste/evil-paste-after
|
|
||||||
:nv "P" #'hydra-paste/evil-paste-before)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
|
@ -31,9 +31,9 @@ This module adds [[https://fsharp.org/][F#]] support.
|
||||||
** Module Flags
|
** Module Flags
|
||||||
+ =+lsp= Enables lsp-fsharp (this requires ~:tools lsp~ to be enabled).
|
+ =+lsp= Enables lsp-fsharp (this requires ~:tools lsp~ to be enabled).
|
||||||
** Plugins
|
** Plugins
|
||||||
+ [[https://github.com/fsharp/emacs-fsharp-mod+e][fsharp-mode]]
|
+ [[https://github.com/fsharp/emacs-fsharp-mode][fsharp-mode]]
|
||||||
+ =+lsp=
|
+ =+lsp=
|
||||||
+ [[https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-fsharp.el][lsp-fsharp]]
|
+ [[https://github.com/emacs-lsp/lsp-mode/blob/master/clients/lsp-fsharp.el][lsp-fsharp]]
|
||||||
** Hacks
|
** Hacks
|
||||||
None so far.
|
None so far.
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ Do *NOT* install mono via brew. See this [[https://github.com/fsharp/FsAutoCompl
|
||||||
sudo pacman -S mono
|
sudo pacman -S mono
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** LSP
|
** LSP
|
||||||
The language server is automatically installed by [[https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-fsharp.el][lsp-fsharp]].
|
The language server is automatically installed by [[https://github.com/emacs-lsp/lsp-mode/blob/master/clients/lsp-fsharp.el][lsp-fsharp]].
|
||||||
* Features
|
* Features
|
||||||
An in-depth list of features, how to use them, and their dependencies.
|
An in-depth list of features, how to use them, and their dependencies.
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
;; Major modes
|
;; Major modes
|
||||||
(package! coffee-mode :pin "35a41c7d8233eac0b267d9593e67fb8b6235e134")
|
(package! coffee-mode :pin "35a41c7d8233eac0b267d9593e67fb8b6235e134")
|
||||||
(package! js2-mode :pin "ffb70990c1a4d4616034cb810b4ce36953aecb47")
|
(package! js2-mode :pin "f7816bdd3e8e84ed1d64b6a13c9ba488363b7e91")
|
||||||
(package! rjsx-mode :pin "b697fe4d92cc84fa99a7bcb476f815935ea0d919")
|
(package! rjsx-mode :pin "b697fe4d92cc84fa99a7bcb476f815935ea0d919")
|
||||||
(package! typescript-mode :pin "54f14c482701c4f937bf51469f70812624e07f87")
|
(package! typescript-mode :pin "54f14c482701c4f937bf51469f70812624e07f87")
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
(set-repl-handler! 'julia-mode #'+julia/open-repl)
|
(set-repl-handler! 'julia-mode #'+julia/open-repl)
|
||||||
|
|
||||||
;; Borrow matlab.el's fontification of math operators. From
|
;; Borrow matlab.el's fontification of math operators. From
|
||||||
;; <https://ogbe.net/emacsconfig.html>
|
;; <https://web.archive.org/web/20170326183805/https://ogbe.net/emacsconfig.html>
|
||||||
(dolist (mode '(julia-mode ess-julia-mode))
|
(dolist (mode '(julia-mode ess-julia-mode))
|
||||||
(font-lock-add-keywords
|
(font-lock-add-keywords
|
||||||
mode
|
mode
|
||||||
|
|
|
@ -39,19 +39,28 @@ This module has no dedicated maintainers.
|
||||||
|
|
||||||
* Prerequisites
|
* Prerequisites
|
||||||
** Language Server Protocol servers
|
** Language Server Protocol servers
|
||||||
Currently the servers supported depend on the =:tools lsp= flavor you are using
|
LSP server support depends on which flavor of the =:tools lsp= module you have
|
||||||
|
installed (Eglot or LSP-mode).
|
||||||
|
|
||||||
*** LSP-mode
|
*** LSP-mode
|
||||||
This server is built in Java, so a ~java~ environment will be necessary
|
Three servers are supported, ordered from highest to lowest priority:
|
||||||
+ [[https://github.com/EmmyLua/EmmyLua-LanguageServer][EmmyLua-LanguageServer]] must be installed and configured to use the
|
|
||||||
configuration provided by emacs-lsp.
|
+ [[https://github.com/EmmyLua/EmmyLua-LanguageServer][EmmyLua-LanguageServer]] :: Must be in =~/.emacs.d/.local/etc/lsp/EmmyLua-LS-all.jar=. See ~lsp-clients-emmy-lua-jar-path~ variable to change this.
|
||||||
|
+ [[https://github.com/sumneko/lua-language-server][Sumneko language server]] (lua-language-server) :: Must be in
|
||||||
|
=~/.config/emacs/.local/etc/lsp/lua-language-server/=. See
|
||||||
|
~lsp-clients-lua-language-server-bin~ variable to change this.
|
||||||
|
+ [[https://github.com/Alloyed/lua-lsp][lua-lsp]] :: Must be available in =~/.luarocks/bin/lua-lsp=. See
|
||||||
|
~lsp-clients-lua-lsp-server-install-dir~ variable to change this.
|
||||||
|
|
||||||
[[https://emacs-lsp.github.io/lsp-mode/page/lsp-emmy-lua/][LSP-mode documentation]] has more information about setting up the server and the
|
[[https://emacs-lsp.github.io/lsp-mode/page/lsp-emmy-lua/][LSP-mode documentation]] has more information about setting up the server and the
|
||||||
configuration variables correctly (use a bare ~(setq
|
configuration variables correctly.
|
||||||
lsp-clients-emmy-lua-java-path value)~ in your =config.el=)
|
|
||||||
*** Eglot
|
*** Eglot
|
||||||
This server is built in Lua, so a =lua= environment will be necessary
|
Eglot currently only supports one of the above servers out of the box:
|
||||||
+ [[https://github.com/sumneko/lua-language-server][lua-language-server]] must be installed and built locally, with =+lua-lsp-dir=
|
|
||||||
variable pointing to the root of the repository
|
+ [[https://github.com/sumneko/lua-language-server][Sumneko language server]] (lua-language-server) :: Must be in
|
||||||
|
=~/.config/emacs/.local/etc/lsp/lua-language-server/=. See
|
||||||
|
~+lua-lsp-dir~ variable to change this.
|
||||||
|
|
||||||
* TODO Features
|
* TODO Features
|
||||||
# An in-depth list of features, how to use them, and their dependencies.
|
# An in-depth list of features, how to use them, and their dependencies.
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defvar +lua-lsp-dir (concat doom-etc-dir "lsp/lua-language-server/")
|
|
||||||
"Absolute path to the directory of sumneko's lua-language-server.
|
|
||||||
|
|
||||||
This directory MUST contain the 'main.lua' file and be the in-source build of
|
|
||||||
lua-language-server.")
|
|
||||||
|
|
||||||
;; sp's default rules are obnoxious, so disable them
|
;; sp's default rules are obnoxious, so disable them
|
||||||
(provide 'smartparens-lua)
|
(provide 'smartparens-lua)
|
||||||
|
|
||||||
|
@ -25,27 +19,29 @@ lua-language-server.")
|
||||||
(set-company-backend! 'lua-mode '(company-lua company-yasnippet))
|
(set-company-backend! 'lua-mode '(company-lua company-yasnippet))
|
||||||
|
|
||||||
(when (featurep! +lsp)
|
(when (featurep! +lsp)
|
||||||
|
(add-hook 'lua-mode-local-vars-hook #'lsp!)
|
||||||
|
|
||||||
|
(when (featurep! :tools lsp +eglot)
|
||||||
|
(defvar +lua-lsp-dir (concat doom-etc-dir "lsp/lua-language-server/")
|
||||||
|
"Absolute path to the directory of sumneko's lua-language-server.
|
||||||
|
|
||||||
|
This directory MUST contain the 'main.lua' file and be the in-source build of
|
||||||
|
lua-language-server.")
|
||||||
|
|
||||||
(defun +lua-generate-lsp-server-command ()
|
(defun +lua-generate-lsp-server-command ()
|
||||||
;; The absolute path to lua-language-server binary is necessary because
|
;; The absolute path to lua-language-server binary is necessary because
|
||||||
;; the bundled dependencies aren't found otherwise. The only reason this
|
;; the bundled dependencies aren't found otherwise. The only reason this
|
||||||
;; is a function is to dynamically change when/if `+lua-lsp-dir' does
|
;; is a function is to dynamically change when/if `+lua-lsp-dir' does
|
||||||
(list (doom-path +lua-lsp-dir
|
(list (or (executable-find "lua-language-server")
|
||||||
|
(doom-path +lua-lsp-dir
|
||||||
(cond (IS-MAC "bin/macOS")
|
(cond (IS-MAC "bin/macOS")
|
||||||
(IS-LINUX "bin/Linux")
|
(IS-LINUX "bin/Linux")
|
||||||
(IS-WINDOWS "bin/Windows"))
|
(IS-WINDOWS "bin/Windows"))
|
||||||
"lua-language-server")
|
"lua-language-server"))
|
||||||
"-E" "-e" "LANG=en"
|
"-E" "-e" "LANG=en"
|
||||||
(doom-path +lua-lsp-dir "main.lua")))
|
(doom-path +lua-lsp-dir "main.lua")))
|
||||||
|
|
||||||
(if (featurep! :tools lsp +eglot)
|
(set-eglot-client! 'lua-mode (+lua-generate-lsp-server-command)))))
|
||||||
(set-eglot-client! 'lua-mode (+lua-generate-lsp-server-command))
|
|
||||||
(after! lsp-mode
|
|
||||||
(lsp-register-client
|
|
||||||
(make-lsp-client :new-connection (lsp-stdio-connection '+lua-generate-lsp-server-command)
|
|
||||||
:major-modes '(lua-mode)
|
|
||||||
:priority -1
|
|
||||||
:server-id 'lua-langserver))))
|
|
||||||
(add-hook 'lua-mode-local-vars-hook #'lsp!)))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package! moonscript
|
(use-package! moonscript
|
||||||
|
|
|
@ -2,31 +2,37 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +markdown-flyspell-word-p ()
|
(defun +markdown-flyspell-word-p ()
|
||||||
"Return t if `flyspell' should check work before point.
|
"Return t if `flyspell' should check word before point.
|
||||||
|
|
||||||
Used for `flyspell-generic-check-word-predicate'. Augments
|
Used for `flyspell-generic-check-word-predicate'. Like
|
||||||
`markdown-flyspell-check-word-p' to:
|
`markdown-flyspell-check-word-p', but also:
|
||||||
|
|
||||||
a) Do spell check in code comments and
|
a) Performs spell check in code comments and
|
||||||
b) Inhibit spell check in html markup"
|
b) Inhibits spell check in html markup"
|
||||||
(and (markdown-flyspell-check-word-p)
|
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (1- (point)))
|
(goto-char (1- (point)))
|
||||||
(if (or
|
(if (or (and (markdown-code-block-at-point-p)
|
||||||
;; Spell check in code comments
|
(not (or (markdown-text-property-at-point 'markdown-yaml-metadata-section)
|
||||||
(not (and (markdown-code-block-at-point-p)
|
(markdown--face-p (point) '(font-lock-comment-face)))))
|
||||||
(markdown--face-p (point) '(font-lock-comment-face))))
|
(markdown-inline-code-at-point-p)
|
||||||
;; Don't spell check in html markup
|
(markdown-in-comment-p)
|
||||||
(markdown--face-p (point) '(markdown-html-attr-name-face
|
(markdown--face-p (point) '(markdown-reference-face
|
||||||
|
markdown-markup-face
|
||||||
|
markdown-plain-url-face
|
||||||
|
markdown-inline-code-face
|
||||||
|
markdown-url-face
|
||||||
|
markdown-html-attr-name-face
|
||||||
markdown-html-attr-value-face
|
markdown-html-attr-value-face
|
||||||
markdown-html-tag-name-face)))
|
markdown-html-tag-name-face)))
|
||||||
(prog1 nil
|
(prog1 nil
|
||||||
;; If flyspell overlay is put, then remove it
|
;; If flyspell overlay is put, then remove it
|
||||||
(when-let (bounds (bounds-of-thing-at-point 'word))
|
(let ((bounds (bounds-of-thing-at-point 'word)))
|
||||||
|
(when bounds
|
||||||
(cl-loop for ov in (overlays-in (car bounds) (cdr bounds))
|
(cl-loop for ov in (overlays-in (car bounds) (cdr bounds))
|
||||||
when (overlay-get ov 'flyspell-overlay)
|
when (overlay-get ov 'flyspell-overlay)
|
||||||
do (delete-overlay ov))))
|
do
|
||||||
t))))
|
(delete-overlay ov)))))
|
||||||
|
t)))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -88,10 +88,33 @@ capture, the end position, and the output buffer.")
|
||||||
(:when (featurep! +grip)
|
(:when (featurep! +grip)
|
||||||
"p" #'grip-mode)
|
"p" #'grip-mode)
|
||||||
(:prefix ("i" . "insert")
|
(:prefix ("i" . "insert")
|
||||||
"t" #'markdown-toc-generate-toc
|
:desc "Table Of Content" "T" #'markdown-toc-generate-toc
|
||||||
"i" #'markdown-insert-image
|
:desc "Image" "i" #'markdown-insert-image
|
||||||
"l" #'markdown-insert-link)))
|
:desc "Link" "l" #'markdown-insert-link
|
||||||
|
:desc "<hr>" "-" #'markdown-insert-hr
|
||||||
|
:desc "Heading 1" "1" #'markdown-insert-header-atx-1
|
||||||
|
:desc "Heading 2" "2" #'markdown-insert-header-atx-2
|
||||||
|
:desc "Heading 3" "3" #'markdown-insert-header-atx-3
|
||||||
|
:desc "Heading 4" "4" #'markdown-insert-header-atx-4
|
||||||
|
:desc "Heading 5" "5" #'markdown-insert-header-atx-5
|
||||||
|
:desc "Heading 6" "6" #'markdown-insert-header-atx-6
|
||||||
|
:desc "Code block" "C" #'markdown-insert-gfm-code-block
|
||||||
|
:desc "Pre region" "P" #'markdown-pre-region
|
||||||
|
:desc "Blockquote region" "Q" #'markdown-blockquote-region
|
||||||
|
:desc "Checkbox" "[" #'markdown-insert-gfm-checkbox
|
||||||
|
:desc "Bold" "b" #'markdown-insert-bold
|
||||||
|
:desc "Inline code" "c" #'markdown-insert-code
|
||||||
|
:desc "Italic" "e" #'markdown-insert-italic
|
||||||
|
:desc "Footnote" "f" #'markdown-insert-footnote
|
||||||
|
:desc "Header dwim" "h" #'markdown-insert-header-dwim
|
||||||
|
:desc "Italic" "i" #'markdown-insert-italic
|
||||||
|
:desc "Kbd" "k" #'markdown-insert-kbd
|
||||||
|
:desc "Link" "l" #'markdown-insert-link
|
||||||
|
:desc "Pre" "p" #'markdown-insert-pre
|
||||||
|
:desc "New blockquote" "q" #'markdown-insert-blockquote
|
||||||
|
:desc "Strike through" "s" #'markdown-insert-strike-through
|
||||||
|
:desc "Table" "t" #'markdown-insert-table
|
||||||
|
:desc "Wiki link" "w" #'markdown-insert-wiki-link)))
|
||||||
|
|
||||||
(use-package! evil-markdown
|
(use-package! evil-markdown
|
||||||
:when (featurep! :editor evil +everywhere)
|
:when (featurep! :editor evil +everywhere)
|
||||||
|
|
|
@ -53,7 +53,8 @@
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(if (not (re-search-forward "#! *\\(?:cached-\\)?nix-shell +-i +\\([^ \n]+\\)" 256 t))
|
(if (not (and (re-search-forward "\\_<nix-shell " (line-end-position 2) t)
|
||||||
|
(re-search-forward "-i +\"?\\([^ \"\n]+\\)" (line-end-position) t)))
|
||||||
(message "Couldn't determine mode for this script")
|
(message "Couldn't determine mode for this script")
|
||||||
(let* ((interp (match-string 1))
|
(let* ((interp (match-string 1))
|
||||||
(mode
|
(mode
|
||||||
|
@ -67,4 +68,8 @@
|
||||||
(when mode
|
(when mode
|
||||||
(prog1 (set-auto-mode-0 mode)
|
(prog1 (set-auto-mode-0 mode)
|
||||||
(when (eq major-mode 'sh-mode)
|
(when (eq major-mode 'sh-mode)
|
||||||
(sh-set-shell interp)))))))))
|
(sh-set-shell interp))
|
||||||
|
;; HACK Without this, quickrun tries to evaluate code directly
|
||||||
|
;; with (cached)?nix-shell.
|
||||||
|
;; TODO Use the nix-shell/cached-nix-shell-given interpreter
|
||||||
|
(setq-local quickrun-option-shebang nil))))))))
|
||||||
|
|
|
@ -10,6 +10,14 @@
|
||||||
(use-package! nix-mode
|
(use-package! nix-mode
|
||||||
:interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
|
:interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
|
||||||
:mode "\\.nix\\'"
|
:mode "\\.nix\\'"
|
||||||
|
: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
|
||||||
|
(cons "/flake\\.lock\\'"
|
||||||
|
(if (featurep! :lang json)
|
||||||
|
'json-mode
|
||||||
|
'js-mode)))
|
||||||
:config
|
:config
|
||||||
(set-repl-handler! 'nix-mode #'+nix/open-repl)
|
(set-repl-handler! 'nix-mode #'+nix/open-repl)
|
||||||
(set-company-backend! 'nix-mode 'company-nixos-options)
|
(set-company-backend! 'nix-mode 'company-nixos-options)
|
||||||
|
|
|
@ -75,13 +75,13 @@ tools.
|
||||||
* Appendix
|
* Appendix
|
||||||
** Commands
|
** Commands
|
||||||
| Command | Key | Description |
|
| Command | Key | Description |
|
||||||
|------------------------------+-----------+-----------------------------------------------------------|
|
|------------------------------+-------------------+-----------------------------------------------------------|
|
||||||
| =merlin-type-enclosing= | =SPC m t= | display type under point |
|
| =merlin-type-enclosing= | =<localleader> t= | display type under point |
|
||||||
| =tuareg-find-alternate-file= | =SPC m a= | switch between =.ml= and =.mli= |
|
| =tuareg-find-alternate-file= | =<localleader> a= | switch between =.ml= and =.mli= |
|
||||||
| =merlin-locate= | =gd= | lookup definition |
|
| =merlin-locate= | =g d= | lookup definition |
|
||||||
| =merlin-occurences= | =SPC c D= | lookup references |
|
| =merlin-occurences= | =SPC c D= | lookup references |
|
||||||
| =merlin-document= | =K= | lookup documentation |
|
| =merlin-document= | =K= | lookup documentation |
|
||||||
| =merlin-imenu= | =SPC / i= | symbol lookup in file |
|
| =merlin-imenu= | =SPC s i= | symbol lookup in file |
|
||||||
| =merlin-iedit-occurrences= | =v R= | visual refactor identifier under point (multiple cursors) |
|
| =merlin-iedit-occurrences= | =v R= | visual refactor identifier under point (multiple cursors) |
|
||||||
| =utop= | =SPC o r= | open =utop= as REPL |
|
| =utop= | =SPC o r= | open =utop= as REPL |
|
||||||
| =utop-eval-region= | =SPC c e= | evaluate selected region in =utop= |
|
| =utop-eval-region= | =SPC c e= | evaluate selected region in =utop= |
|
||||||
|
|
|
@ -173,6 +173,8 @@ esoteric features:
|
||||||
+ To execute babel code blocks, you need whatever dependencies those languages
|
+ To execute babel code blocks, you need whatever dependencies those languages
|
||||||
need. It is recommended you enable the associated =:lang= module and ensure
|
need. It is recommended you enable the associated =:lang= module and ensure
|
||||||
its dependencies are met, e.g. install the =ruby= executable for ruby support.
|
its dependencies are met, e.g. install the =ruby= executable for ruby support.
|
||||||
|
To use ~jupyter kernels~ you need the =+jupyter= flag, the associated kernel as
|
||||||
|
well as the ~jupyter~ program.
|
||||||
+ =org-roam= (with the =+roam= flag) requires =sqlite3= to be installed.
|
+ =org-roam= (with the =+roam= flag) requires =sqlite3= to be installed.
|
||||||
|
|
||||||
** MacOS
|
** MacOS
|
||||||
|
@ -185,6 +187,7 @@ brew install gnuplot
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
pacman -S texlive-core texlive-bin texlive-science
|
pacman -S texlive-core texlive-bin texlive-science
|
||||||
pacman -S gnuplot
|
pacman -S gnuplot
|
||||||
|
pacman -S jupyter # required by +jupyter
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** NixOS
|
** NixOS
|
||||||
|
@ -192,6 +195,8 @@ pacman -S gnuplot
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# any less than medium isn't guaranteed to work
|
# any less than medium isn't guaranteed to work
|
||||||
texlive.combined.scheme-medium
|
texlive.combined.scheme-medium
|
||||||
|
# required by +jupyter
|
||||||
|
(python38.withPackages(ps: with ps; [jupyter]))
|
||||||
];
|
];
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,8 @@ another level of headings on each invocation."
|
||||||
Made for `org-tab-first-hook' in evil-mode."
|
Made for `org-tab-first-hook' in evil-mode."
|
||||||
(interactive)
|
(interactive)
|
||||||
(cond ((not (and (bound-and-true-p evil-local-mode)
|
(cond ((not (and (bound-and-true-p evil-local-mode)
|
||||||
(evil-insert-state-p)))
|
(or (evil-insert-state-p)
|
||||||
|
(evil-emacs-state-p))))
|
||||||
nil)
|
nil)
|
||||||
((org-at-item-p)
|
((org-at-item-p)
|
||||||
(if (eq this-command 'org-shifttab)
|
(if (eq this-command 'org-shifttab)
|
||||||
|
@ -424,7 +425,8 @@ Made for `org-tab-first-hook'."
|
||||||
;; in the few cases where it does.
|
;; in the few cases where it does.
|
||||||
(yas-indent-line 'fixed))
|
(yas-indent-line 'fixed))
|
||||||
(cond ((and (or (not (bound-and-true-p evil-local-mode))
|
(cond ((and (or (not (bound-and-true-p evil-local-mode))
|
||||||
(evil-insert-state-p))
|
(evil-insert-state-p)
|
||||||
|
(evil-emacs-state-p))
|
||||||
(yas--templates-for-key-at-point))
|
(yas--templates-for-key-at-point))
|
||||||
(yas-expand)
|
(yas-expand)
|
||||||
t)
|
t)
|
||||||
|
|
|
@ -541,12 +541,6 @@ the exported output (i.e. formatters)."
|
||||||
:before-while #'org-fix-tags-on-the-fly
|
:before-while #'org-fix-tags-on-the-fly
|
||||||
org-auto-align-tags)
|
org-auto-align-tags)
|
||||||
|
|
||||||
;; HACK Org is known to use a lot of unicode symbols (and large org files tend
|
|
||||||
;; to be especially memory hungry). Compounded with
|
|
||||||
;; `inhibit-compacting-font-caches' being non-nil, org needs more memory
|
|
||||||
;; to be performant.
|
|
||||||
(setq-hook! 'org-mode-hook gcmh-high-cons-threshold (* 2 gcmh-high-cons-threshold))
|
|
||||||
|
|
||||||
(defadvice! +org--recenter-after-follow-link-a (&rest _args)
|
(defadvice! +org--recenter-after-follow-link-a (&rest _args)
|
||||||
"Recenter after following a link, but only internal or file links."
|
"Recenter after following a link, but only internal or file links."
|
||||||
:after '(org-footnote-action
|
:after '(org-footnote-action
|
||||||
|
@ -556,20 +550,14 @@ the exported output (i.e. formatters)."
|
||||||
(when (get-buffer-window)
|
(when (get-buffer-window)
|
||||||
(recenter)))
|
(recenter)))
|
||||||
|
|
||||||
(defadvice! +org--strip-properties-from-outline-a (orig-fn path &optional width prefix separator)
|
(defadvice! +org--strip-properties-from-outline-a (orig-fn &rest args)
|
||||||
"Remove link syntax and fix variable height text (e.g. org headings) in the
|
"Fix variable height faces in eldoc breadcrumbs."
|
||||||
eldoc string."
|
|
||||||
:around #'org-format-outline-path
|
:around #'org-format-outline-path
|
||||||
(funcall orig-fn
|
(let ((org-level-faces
|
||||||
(cl-loop for part in path
|
(cl-loop for face in org-level-faces
|
||||||
;; Remove full link syntax
|
collect `(:foreground ,(face-foreground face nil t)
|
||||||
for fixedpart = (replace-regexp-in-string org-link-any-re "\\4" (or part ""))
|
:weight bold))))
|
||||||
for n from 0
|
(apply orig-fn args)))
|
||||||
for face = (nth (% n org-n-level-faces) org-level-faces)
|
|
||||||
collect
|
|
||||||
(org-add-props fixedpart
|
|
||||||
nil 'face `(:foreground ,(face-foreground face nil t) :weight bold)))
|
|
||||||
width prefix separator))
|
|
||||||
|
|
||||||
(after! org-eldoc
|
(after! org-eldoc
|
||||||
;; HACK Fix #2972: infinite recursion when eldoc kicks in in 'org' or
|
;; HACK Fix #2972: infinite recursion when eldoc kicks in in 'org' or
|
||||||
|
@ -588,8 +576,7 @@ eldoc string."
|
||||||
|
|
||||||
(add-hook! 'org-agenda-finalize-hook
|
(add-hook! 'org-agenda-finalize-hook
|
||||||
(defun +org-exclude-agenda-buffers-from-workspace-h ()
|
(defun +org-exclude-agenda-buffers-from-workspace-h ()
|
||||||
"Prevent temporary agenda buffers being associated with current
|
"Don't associate temporary agenda buffers with current workspace."
|
||||||
workspace."
|
|
||||||
(when (and org-agenda-new-buffers
|
(when (and org-agenda-new-buffers
|
||||||
(bound-and-true-p persp-mode)
|
(bound-and-true-p persp-mode)
|
||||||
(not org-agenda-sticky))
|
(not org-agenda-sticky))
|
||||||
|
@ -598,11 +585,12 @@ workspace."
|
||||||
(get-current-persp)
|
(get-current-persp)
|
||||||
nil))))
|
nil))))
|
||||||
(defun +org-defer-mode-in-agenda-buffers-h ()
|
(defun +org-defer-mode-in-agenda-buffers-h ()
|
||||||
"Org agenda opens temporary agenda incomplete org-mode buffers.
|
"`org-agenda' opens temporary, incomplete org-mode buffers.
|
||||||
These are great for extracting agenda information from, but what if the user
|
I've disabled a lot of org-mode's startup processes for these invisible buffers
|
||||||
tries to visit one of these buffers? Then we remove it from the to-be-cleaned
|
to speed them up (in `+org--exclude-agenda-buffers-from-recentf-a'). However, if
|
||||||
queue and restart `org-mode' so they can grow up to be full-fledged org-mode
|
the user tries to visit one of these buffers they'll see a gimped, half-broken
|
||||||
buffers."
|
org buffer. To avoid that, restart `org-mode' when they're switched to so they
|
||||||
|
can grow up to be fully-fledged org-mode buffers."
|
||||||
(dolist (buffer org-agenda-new-buffers)
|
(dolist (buffer org-agenda-new-buffers)
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(add-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
|
(add-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
|
||||||
|
@ -612,7 +600,7 @@ buffers."
|
||||||
"Prevent temporarily opened agenda buffers from polluting recentf."
|
"Prevent temporarily opened agenda buffers from polluting recentf."
|
||||||
:around #'org-get-agenda-file-buffer
|
:around #'org-get-agenda-file-buffer
|
||||||
(let ((recentf-exclude (list (lambda (_file) t)))
|
(let ((recentf-exclude (list (lambda (_file) t)))
|
||||||
(doom-large-file-p t)
|
(doom-inhibit-large-file-detection t)
|
||||||
find-file-hook
|
find-file-hook
|
||||||
org-mode-hook)
|
org-mode-hook)
|
||||||
(funcall orig-fn file)))
|
(funcall orig-fn file)))
|
||||||
|
@ -1128,7 +1116,9 @@ compelling reason, so..."
|
||||||
(run-hooks 'org-load-hook))
|
(run-hooks 'org-load-hook))
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(set-company-backend! 'org-mode 'company-capf 'company-dabbrev)
|
(add-to-list 'doom-debug-variables 'org-export-async-debug)
|
||||||
|
|
||||||
|
(set-company-backend! 'org-mode 'company-capf)
|
||||||
(set-eval-handler! 'org-mode #'+org-eval-handler)
|
(set-eval-handler! 'org-mode #'+org-eval-handler)
|
||||||
(set-lookup-handlers! 'org-mode
|
(set-lookup-handlers! 'org-mode
|
||||||
:definition #'+org-lookup-definition-handler
|
:definition #'+org-lookup-definition-handler
|
||||||
|
|
|
@ -45,6 +45,8 @@
|
||||||
|
|
||||||
(set-popup-rule! "^\\*Org-journal search" :select t :quit t)
|
(set-popup-rule! "^\\*Org-journal search" :select t :quit t)
|
||||||
|
|
||||||
|
(set-company-backend! 'org-journal-mode 'company-capf 'company-dabbrev)
|
||||||
|
|
||||||
(map! (:map org-journal-mode-map
|
(map! (:map org-journal-mode-map
|
||||||
:n "]f" #'org-journal-next-entry
|
:n "]f" #'org-journal-next-entry
|
||||||
:n "[f" #'org-journal-previous-entry
|
:n "[f" #'org-journal-previous-entry
|
||||||
|
|
|
@ -21,4 +21,5 @@
|
||||||
|
|
||||||
(use-package! org-fancy-priorities ; priority icons
|
(use-package! org-fancy-priorities ; priority icons
|
||||||
:hook (org-mode . org-fancy-priorities-mode)
|
:hook (org-mode . org-fancy-priorities-mode)
|
||||||
|
:hook (org-agenda-mode . org-fancy-priorities-mode)
|
||||||
:config (setq org-fancy-priorities-list '("⚑" "⬆" "■")))
|
:config (setq org-fancy-priorities-list '("⚑" "⬆" "■")))
|
||||||
|
|
|
@ -9,4 +9,20 @@
|
||||||
(unless (executable-find "sqlite3")
|
(unless (executable-find "sqlite3")
|
||||||
(warn! "Couldn't find the sqlite3 executable. org-roam will not work."))
|
(warn! "Couldn't find the sqlite3 executable. org-roam will not work."))
|
||||||
(unless (executable-find "dot")
|
(unless (executable-find "dot")
|
||||||
(warn! "Couldn't find the dot executable (from graphviz). org-roam will not be able to generate graph visuallizations.")))
|
(warn! "Couldn't find the dot executable (from graphviz). org-roam will not be able to generate graph visualizations.")))
|
||||||
|
|
||||||
|
(when (featurep! +dragndrop)
|
||||||
|
(when IS-MAC
|
||||||
|
(unless (executable-find "pngpaste")
|
||||||
|
(warn! "Couldn't find the pngpaste executable. org-download-clipboard will not work.")))
|
||||||
|
(when IS-LINUX
|
||||||
|
(unless (or (executable-find "maim") (executable-find "scrot") (executable-find "gnome-screenshot"))
|
||||||
|
(warn! "Couldn't find the maim, scrot or gnome-screenshot executable. org-download-clipboard will not work."))
|
||||||
|
(if (string= "wayland" (getenv "XDG_SESSION_TYPE"))
|
||||||
|
(unless (executable-find "wl-paste")
|
||||||
|
(warn! "Couldn't find the wl-paste executable (from wl-clipboard). org-download-clipboard will not work."))
|
||||||
|
(unless (executable-find "xclip")
|
||||||
|
(warn! "Couldn't find the xclip executable. org-download-clipboard will not work."))))
|
||||||
|
(when IS-WINDOWS
|
||||||
|
(unless (executable-find "convert")
|
||||||
|
(warn! "Couldn't find the convert program (from ImageMagick). org-download-clipboard will not work."))))
|
||||||
|
|
|
@ -14,11 +14,12 @@
|
||||||
;; root. Of course, this command won't work in a sparse clone,
|
;; root. Of course, this command won't work in a sparse clone,
|
||||||
;; and more than that, initiating these compilation step is a
|
;; and more than that, initiating these compilation step is a
|
||||||
;; hassle, so...
|
;; hassle, so...
|
||||||
:build (with-temp-file (expand-file-name "org-version.el" (straight--repos-dir "org-mode"))
|
:pre-build
|
||||||
|
(with-temp-file (doom-path (straight--repos-dir "org-mode") "org-version.el")
|
||||||
(insert "(fset 'org-release (lambda () \"9.5\"))\n"
|
(insert "(fset 'org-release (lambda () \"9.5\"))\n"
|
||||||
"(fset 'org-git-version #'ignore)\n"
|
"(fset 'org-git-version #'ignore)\n"
|
||||||
"(provide 'org-version)\n")))
|
"(provide 'org-version)\n")))
|
||||||
:pin "7c8dce72bd5d86157dd1dda2ba0a21ac86084426"
|
:pin "6b83c6e4eaec4af47a90d05c3410d4637d8cb8da"
|
||||||
;; Prevents built-in Org from sneaking into the byte-compilation of
|
;; Prevents built-in Org from sneaking into the byte-compilation of
|
||||||
;; `org-plus-contrib', and inform other packages that `org-mode' satisfies the
|
;; `org-plus-contrib', and inform other packages that `org-mode' satisfies the
|
||||||
;; `org' dependency: https://github.com/raxod502/straight.el/issues/352
|
;; `org' dependency: https://github.com/raxod502/straight.el/issues/352
|
||||||
|
@ -38,22 +39,22 @@
|
||||||
:recipe (:host github :repo "hlissner/evil-org-mode")
|
:recipe (:host github :repo "hlissner/evil-org-mode")
|
||||||
:pin "a9706da260c45b98601bcd72b1d2c0a24a017700"))
|
:pin "a9706da260c45b98601bcd72b1d2c0a24a017700"))
|
||||||
(when (featurep! :tools pdf)
|
(when (featurep! :tools pdf)
|
||||||
(package! org-pdftools :pin "3c2b9a413eb841c781cfb49d8c343bf07aa0ad1f"))
|
(package! org-pdftools :pin "bcf0084883ede36e91c72be73c0fbd7098439c99"))
|
||||||
(when (featurep! :tools magit)
|
(when (featurep! :tools magit)
|
||||||
(package! orgit :pin "ac9b1a42863a864fde9d225890ef5464bffdc646"))
|
(package! orgit :pin "ac9b1a42863a864fde9d225890ef5464bffdc646"))
|
||||||
(when (featurep! +brain)
|
(when (featurep! +brain)
|
||||||
(package! org-brain :pin "1ae4fd46165fc56f34f36ce38cb2ae816b07e207"))
|
(package! org-brain :pin "f7939ef5071895930eebccf490ea7cb25cc54b2c"))
|
||||||
(when (featurep! +dragndrop)
|
(when (featurep! +dragndrop)
|
||||||
(package! org-download :pin "42ac361ef5502017e6fc1bceb00333eba90402f4"))
|
(package! org-download :pin "97bec7412e1a4d6e9031c7a0568d0f065cd9fd00"))
|
||||||
(when (featurep! +gnuplot)
|
(when (featurep! +gnuplot)
|
||||||
(package! gnuplot :pin "f0001c30010b2899e36d7d89046322467e923088")
|
(package! gnuplot :pin "116cad8e09024223f97e81b0a4503cef20de9bf5")
|
||||||
(package! gnuplot-mode :pin "601f6392986f0cba332c87678d31ae0d0a496ce7"))
|
(package! gnuplot-mode :pin "601f6392986f0cba332c87678d31ae0d0a496ce7"))
|
||||||
(when (featurep! +ipython) ; DEPRECATED
|
(when (featurep! +ipython) ; DEPRECATED
|
||||||
(package! ob-ipython :pin "7147455230841744fb5b95dcbe03320313a77124"))
|
(package! ob-ipython :pin "7147455230841744fb5b95dcbe03320313a77124"))
|
||||||
(when (featurep! +jupyter)
|
(when (featurep! +jupyter)
|
||||||
(package! jupyter :pin "360cae2c70ab28c7a7848c0c56473d984f0243e5"))
|
(package! jupyter :pin "360cae2c70ab28c7a7848c0c56473d984f0243e5"))
|
||||||
(when (featurep! +journal)
|
(when (featurep! +journal)
|
||||||
(package! org-journal :pin "14ce0119fe2d89f2f2207788be2edce0b9372822"))
|
(package! org-journal :pin "c0836483ae43e525bf7547b7a789d171eda84c84"))
|
||||||
(when (featurep! +noter)
|
(when (featurep! +noter)
|
||||||
(package! org-noter :pin "9ead81d42dd4dd5074782d239b2efddf9b8b7b3d"))
|
(package! org-noter :pin "9ead81d42dd4dd5074782d239b2efddf9b8b7b3d"))
|
||||||
(when (featurep! +pomodoro)
|
(when (featurep! +pomodoro)
|
||||||
|
@ -65,14 +66,14 @@
|
||||||
(package! centered-window
|
(package! centered-window
|
||||||
:recipe (:host github :repo "anler/centered-window-mode")
|
:recipe (:host github :repo "anler/centered-window-mode")
|
||||||
:pin "f50859941ab5c7cbeaee410f2d38716252b552ac")
|
:pin "f50859941ab5c7cbeaee410f2d38716252b552ac")
|
||||||
(package! org-tree-slide :pin "18034c476038adcc1c4697168b8068f4d0ce62fe")
|
(package! org-tree-slide :pin "d6e8e91433dfe4968f1343b483f2680f45a77d52")
|
||||||
(package! org-re-reveal :pin "0062756e9a5b6ec96c7de5ca94372cc6495296a1")
|
(package! org-re-reveal :pin "47339ef6772c79849a9764716df8361649ea7bdc")
|
||||||
(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 "0582f57517c97a4c7bfeb58762138c78883f94c5"))
|
:pin "0582f57517c97a4c7bfeb58762138c78883f94c5"))
|
||||||
(when (featurep! +roam)
|
(when (featurep! +roam)
|
||||||
(package! org-roam :pin "be95b42d32d9707309ab373f1d8182c84db41c5c"))
|
(package! org-roam :pin "15d864a500d90c9dc2e16d888e93343528ec3941"))
|
||||||
|
|
||||||
;;; Babel
|
;;; Babel
|
||||||
(package! ob-async :pin "de1cd6c93242a4cb8773bbe115b7be3d4dd6b97e")
|
(package! ob-async :pin "de1cd6c93242a4cb8773bbe115b7be3d4dd6b97e")
|
||||||
|
@ -89,7 +90,7 @@
|
||||||
:recipe (:host github :repo "DEADB17/ob-racket")
|
:recipe (:host github :repo "DEADB17/ob-racket")
|
||||||
:pin "d8fd51bddb019b0eb68755255f88fc800cfe03cb"))
|
:pin "d8fd51bddb019b0eb68755255f88fc800cfe03cb"))
|
||||||
(when (featurep! :lang rest)
|
(when (featurep! :lang rest)
|
||||||
(package! ob-restclient :pin "f7449b2068498fe9d8ab9589e0a638148861533f"))
|
(package! ob-restclient :pin "0ebfc7c5ebf96d2fe1a476439831363a5a43b9b6"))
|
||||||
(when (featurep! :lang scala)
|
(when (featurep! :lang scala)
|
||||||
(package! ob-ammonite :pin "39937dff395e70aff76a4224fa49cf2ec6c57cca"))
|
(package! ob-ammonite :pin "39937dff395e70aff76a4224fa49cf2ec6c57cca"))
|
||||||
|
|
||||||
|
@ -99,6 +100,6 @@
|
||||||
(when (featurep! +hugo)
|
(when (featurep! +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 "f24c9bd522ae22bee2327c2b53858d0a5066707d"))
|
:pin "6bc8ee08023695fa167ac0ddf1fc61e1975fa1ce"))
|
||||||
(when (featurep! :lang rst)
|
(when (featurep! :lang rst)
|
||||||
(package! ox-rst :pin "99fa790da55b57a3f2e9aa187493ba434a64250e"))
|
(package! ox-rst :pin "99fa790da55b57a3f2e9aa187493ba434a64250e"))
|
||||||
|
|
|
@ -100,29 +100,41 @@ sudo zypper install nodejs npm
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Dependencies
|
** Dependencies
|
||||||
The features in this module optionally depend on the following php packages:
|
This module has no required dependencies, but it has a couple optional ones.
|
||||||
|
|
||||||
+ ~boris~ (REPL)
|
+ ~boris~ (REPL)
|
||||||
+ ~phpctags~ (better code completion)
|
+ ~phpctags~ (better code completion)
|
||||||
+ ~phpunit~ (unit test commands)
|
+ ~phpunit~ (unit test commands)
|
||||||
+ ~php-cs-fixer~ (for code formatting)
|
+ ~php-cs-fixer~ and ~@prettier/plugin-php~ (for code formatting)
|
||||||
|
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
composer global require \
|
composer global require \
|
||||||
d11wtq/boris \
|
d11wtq/boris \
|
||||||
phpunit/phpunit \
|
phpunit/phpunit \
|
||||||
techlivezheng/phpctags
|
techlivezheng/phpctags \
|
||||||
|
friendsofphp/php-cs-fixer
|
||||||
|
|
||||||
|
# Needed by php-cs-fixer, otherwise you'll get "Couldn't resolve parser
|
||||||
|
# 'php'" errors
|
||||||
|
npm install -g @prettier/plugin-php
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Ensure that ~\~/.composer/vendor/bin~ is in ~PATH~:
|
You must ensure that ~\~/.composer/vendor/bin~ is in ~PATH~, so these
|
||||||
|
executables are visible to Emacs:
|
||||||
|
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
# place this in your profile file, like ~/.bash_profile or ~/.zshenv
|
# place this in your profile file, like ~/.bash_profile or ~/.zshenv
|
||||||
export PATH="~/.composer/vendor/bin:$PATH"
|
export PATH="~/.composer/vendor/bin:$PATH"
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
By the way, if you use intelephense, running =M-x lsp-install-server= and
|
You may also need to regenerate your envvar file by running ~doom env~ on the
|
||||||
choose ~iph~ to install lsp-intelephense.
|
command line.
|
||||||
|
|
||||||
|
#+begin_quote
|
||||||
|
To use intelephense instead of , run =M-x lsp-install-server= and choose ~iph~ to
|
||||||
|
install lsp-intelephense.
|
||||||
|
#+end_quote
|
||||||
|
|
||||||
* TODO Features
|
* TODO Features
|
||||||
# An in-depth list of features, how to use them, and their dependencies.
|
# An in-depth list of features, how to use them, and their dependencies.
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ Adds Python support to Doom Emacs.
|
||||||
+ [[https://github.com/pythonic-emacs/anaconda-mode][anaconda-mode]]*
|
+ [[https://github.com/pythonic-emacs/anaconda-mode][anaconda-mode]]*
|
||||||
+ [[https://github.com/Wilfred/pyimport][pyimport]]*
|
+ [[https://github.com/Wilfred/pyimport][pyimport]]*
|
||||||
+ [[https://github.com/paetzke/py-isort.el][py-isort]]*
|
+ [[https://github.com/paetzke/py-isort.el][py-isort]]*
|
||||||
+ [[https://melpa.org/#/nose][nose]]*
|
+ [[https://github.com/emacsattic/nose/][nose]]*
|
||||||
+ [[https://github.com/wbolster/emacs-python-pytest][python-pytest]]*
|
+ [[https://github.com/wbolster/emacs-python-pytest][python-pytest]]*
|
||||||
+ [[https://github.com/Wilfred/pip-requirements.el][pip-requirements]]*
|
+ [[https://github.com/Wilfred/pip-requirements.el][pip-requirements]]*
|
||||||
+ [[https://github.com/pwalsh/pipenv.el][pipenv]]*
|
+ [[https://github.com/pwalsh/pipenv.el][pipenv]]*
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
(unless (or (bound-and-true-p lsp-mode)
|
(unless (or (bound-and-true-p lsp-mode)
|
||||||
(bound-and-true-p eglot--managed-mode)
|
(bound-and-true-p eglot--managed-mode)
|
||||||
(bound-and-true-p lsp--buffer-deferred)
|
(bound-and-true-p lsp--buffer-deferred)
|
||||||
(not (executable-find python-shell-interpreter)))
|
(not (executable-find python-shell-interpreter t)))
|
||||||
(anaconda-mode +1))))
|
(anaconda-mode +1))))
|
||||||
:config
|
:config
|
||||||
(set-company-backend! 'anaconda-mode '(company-anaconda))
|
(set-company-backend! 'anaconda-mode '(company-anaconda))
|
||||||
|
@ -207,7 +207,7 @@
|
||||||
(set-eval-handler! 'python-mode
|
(set-eval-handler! 'python-mode
|
||||||
'((:command . (lambda () python-shell-interpreter))
|
'((:command . (lambda () python-shell-interpreter))
|
||||||
(:exec (lambda ()
|
(:exec (lambda ()
|
||||||
(if-let* ((bin (executable-find "pipenv"))
|
(if-let* ((bin (executable-find "pipenv" t))
|
||||||
(_ (pipenv-project-p)))
|
(_ (pipenv-project-p)))
|
||||||
(format "PIPENV_MAX_DEPTH=9999 %s run %%c %%o %%s %%a" bin)
|
(format "PIPENV_MAX_DEPTH=9999 %s run %%c %%o %%s %%a" bin)
|
||||||
"%c %o %s %a")))
|
"%c %o %s %a")))
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
(featurep! :tools lsp))
|
(featurep! :tools lsp))
|
||||||
"This module requires (:tools lsp)")
|
"This module requires (:tools lsp)")
|
||||||
|
|
||||||
(if (not (executable-find "python"))
|
(if (not (or (executable-find "python")
|
||||||
|
(executable-find "python3")))
|
||||||
(error! "Couldn't find python in your PATH")
|
(error! "Couldn't find python in your PATH")
|
||||||
(unless (featurep! +lsp)
|
(unless (featurep! +lsp)
|
||||||
(unless (zerop (shell-command "python -c 'import setuptools'"))
|
(unless (or (zerop (shell-command "python -c 'import setuptools'"))
|
||||||
|
(zerop (shell-command "python3 -c 'import setuptools'")))
|
||||||
(warn! "setuptools wasn't detected, which anaconda-mode requires"))))
|
(warn! "setuptools wasn't detected, which anaconda-mode requires"))))
|
||||||
|
|
||||||
(when (featurep! +pyenv)
|
(when (featurep! +pyenv)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
;; Major modes
|
;; Major modes
|
||||||
(package! pip-requirements :pin "216cd1690f80cc965d4ae47b8753fc185f778ff6")
|
(package! pip-requirements :pin "216cd1690f80cc965d4ae47b8753fc185f778ff6")
|
||||||
(when (featurep! +cython)
|
(when (featurep! +cython)
|
||||||
(package! cython-mode :pin "21b4e533747507c4dad5e6908df1f157dff4de89")
|
(package! cython-mode :pin "17e03b8658a07b6d6da49300b39b57ed9c59ddb1")
|
||||||
(when (featurep! :checkers syntax)
|
(when (featurep! :checkers syntax)
|
||||||
(package! flycheck-cython :pin "ecc4454d35ab5317ab66a04406f36f0c1dbc0b76")))
|
(package! flycheck-cython :pin "ecc4454d35ab5317ab66a04406f36f0c1dbc0b76")))
|
||||||
|
|
||||||
|
@ -12,21 +12,21 @@
|
||||||
(when (featurep! +lsp)
|
(when (featurep! +lsp)
|
||||||
(unless (featurep! :tools lsp +eglot)
|
(unless (featurep! :tools lsp +eglot)
|
||||||
(if (featurep! +pyright)
|
(if (featurep! +pyright)
|
||||||
(package! lsp-pyright :pin "d9e7d3cf1bdc8ee0395c8df4408b05ee3ba9c22a")
|
(package! lsp-pyright :pin "71ff088ac4c93b0edd012f305a3dfd1602c5d21e")
|
||||||
(package! lsp-python-ms :pin "c4ebc7a11398733055a1dc07f9cffacd04d1c2dc"))))
|
(package! lsp-python-ms :pin "5470ada6cde6e68fe6ce13ff1146c89c3bae0cc8"))))
|
||||||
|
|
||||||
;; Programming environment
|
;; Programming environment
|
||||||
(package! anaconda-mode :pin "39b1cf88c8c459901630d248d6135d8644075648")
|
(package! anaconda-mode :pin "b1875a5d0ec9885c1c42558c126b93ee6bcedaa6")
|
||||||
(when (featurep! :completion company)
|
(when (featurep! :completion company)
|
||||||
(package! company-anaconda :pin "da1566db41a68809ef7f91ebf2de28118067c89b"))
|
(package! company-anaconda :pin "da1566db41a68809ef7f91ebf2de28118067c89b"))
|
||||||
|
|
||||||
;; Environment management
|
;; Environment management
|
||||||
(package! pipenv :pin "b730bb509e8b60af9f5ab1f1e6c3458d1d95d789")
|
(package! pipenv :pin "f516a1a8677a6a1ce9683056e9f77b1e785e8431")
|
||||||
(package! pyvenv :pin "0bf4b87068e9040fc99afa85af1992247dd7aacd")
|
(package! pyvenv :pin "9b3678bc29192d2dba64df90fbdb17393ef8d877")
|
||||||
(when (featurep! +pyenv)
|
(when (featurep! +pyenv)
|
||||||
(package! pyenv-mode :pin "b818901b8eac0e260ced66a6a5acabdbf6f5ba99"))
|
(package! pyenv-mode :pin "b818901b8eac0e260ced66a6a5acabdbf6f5ba99"))
|
||||||
(when (featurep! +conda)
|
(when (featurep! +conda)
|
||||||
(package! conda :pin "9f7eea16e9ad3eb34fe3d1cbd9d6162b8046c2f8"))
|
(package! conda :pin "dce431b25f5a13af58cc7cacfa7968b5a888609c"))
|
||||||
(when (featurep! +poetry)
|
(when (featurep! +poetry)
|
||||||
(package! poetry :pin "d5163fe065239bb7b46ed8b3ff3b85b1f3229af3"))
|
(package! poetry :pin "d5163fe065239bb7b46ed8b3ff3b85b1f3229af3"))
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
;; REVIEW Remove this when emacsmirror/epkgs updates its emacsattic index
|
;; REVIEW Remove this when emacsmirror/epkgs updates its emacsattic index
|
||||||
:recipe (:host github :repo "emacsattic/nose")
|
:recipe (:host github :repo "emacsattic/nose")
|
||||||
:pin "f8528297519eba911696c4e68fa88892de9a7b72")
|
:pin "f8528297519eba911696c4e68fa88892de9a7b72")
|
||||||
(package! python-pytest :pin "4a1c4c8915c12e540d41aae1d4e326a2362da541")
|
(package! python-pytest :pin "3fadf1f8bc363d57c54eedd1bf98e6d9db9f0a62")
|
||||||
|
|
||||||
;; Import managements
|
;; Import managements
|
||||||
(package! pyimport :pin "a6f63cf7ed93f0c0f7c207e6595813966f8852b9")
|
(package! pyimport :pin "a6f63cf7ed93f0c0f7c207e6595813966f8852b9")
|
||||||
|
|
|
@ -97,7 +97,7 @@ selected by default. Modify ~rustic-lsp-server~ to change the default:
|
||||||
(setq rustic-lsp-server 'rls))
|
(setq rustic-lsp-server 'rls))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Enabling elgot support for Rust
|
** Enabling eglot support for Rust
|
||||||
Doom's =:tools lsp= module has an =+eglot= flag. Enable it and this module will
|
Doom's =:tools lsp= module has an =+eglot= flag. Enable it and this module will
|
||||||
use eglot instead.
|
use eglot instead.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; lang/rust/packages.el
|
;;; lang/rust/packages.el
|
||||||
|
|
||||||
(package! rustic :pin "91ad5db27b86bb2ba6f3019b764d0f45ec93f484")
|
(package! rustic :pin "f7d5ac0c930ae435421f3f5bc827e8c61ce73662")
|
||||||
(unless (featurep! +lsp)
|
(unless (featurep! +lsp)
|
||||||
(package! racer :pin "a0bdf778f01e8c4b8a92591447257422ac0b455b"))
|
(package! racer :pin "a0bdf778f01e8c4b8a92591447257422ac0b455b"))
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
(setq geiser-active-implementations '(guile chicken mit chibi chez)
|
(setq geiser-active-implementations '(guile chicken mit chibi chez)
|
||||||
geiser-autodoc-identifier-format "%s → %s"
|
geiser-autodoc-identifier-format "%s → %s"
|
||||||
geiser-repl-current-project-function 'doom-project-root)
|
geiser-repl-current-project-function 'doom-project-root)
|
||||||
(unless (featurep! :lang racket)
|
(if (featurep! :lang racket)
|
||||||
|
(setq auto-mode-alist
|
||||||
|
(remove '("\\.rkt\\'" . scheme-mode) auto-mode-alist))
|
||||||
(push 'racket geiser-active-implementations))
|
(push 'racket geiser-active-implementations))
|
||||||
(after! scheme ; built-in
|
(after! scheme ; built-in
|
||||||
(set-repl-handler! 'scheme-mode #'+scheme/open-repl)
|
(set-repl-handler! 'scheme-mode #'+scheme/open-repl)
|
||||||
|
|
|
@ -65,12 +65,9 @@
|
||||||
|
|
||||||
(add-to-list 'web-mode-engines-alist '("elixir" . "\\.eex\\'"))
|
(add-to-list 'web-mode-engines-alist '("elixir" . "\\.eex\\'"))
|
||||||
|
|
||||||
(let ((types '("javascript" "jsx")))
|
;; Use // instead of /* as the default comment delimited in JS
|
||||||
(setq web-mode-comment-formats
|
(setf (alist-get "javascript" web-mode-comment-formats nil nil #'equal)
|
||||||
(cl-remove-if (lambda (item) (member (car item) types))
|
"//")
|
||||||
web-mode-comment-formats))
|
|
||||||
(dolist (type types)
|
|
||||||
(push (cons type "//") web-mode-comment-formats)))
|
|
||||||
|
|
||||||
(add-hook! 'web-mode-hook
|
(add-hook! 'web-mode-hook
|
||||||
(defun +web--fix-js-comments-h ()
|
(defun +web--fix-js-comments-h ()
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
;; wl-copy, termux-clipboard-get, or getclip (cygwin); depending on what
|
;; wl-copy, termux-clipboard-get, or getclip (cygwin); depending on what
|
||||||
;; is available.
|
;; is available.
|
||||||
(and (require 'xclip nil t)
|
(and (require 'xclip nil t)
|
||||||
(xclip-mode +1)))))
|
(with-demoted-errors "%s" (xclip-mode +1))))))
|
||||||
|
|
||||||
(when (featurep! :editor evil)
|
(when (featurep! :editor evil)
|
||||||
;; Fix cursor shape-changing in the terminal. Only supported in XTerm, Gnome
|
;; Fix cursor shape-changing in the terminal. Only supported in XTerm, Gnome
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
(switch-to-buffer (doom-fallback-buffer)))
|
(switch-to-buffer (doom-fallback-buffer)))
|
||||||
(when +eshell-enable-new-shell-on-split
|
(when +eshell-enable-new-shell-on-split
|
||||||
(let ((default-directory directory))
|
(let ((default-directory directory))
|
||||||
(when-let (win (get-buffer-window (+eshell/here t)))
|
(when-let (win (get-buffer-window (+eshell/here)))
|
||||||
(set-window-dedicated-p win dedicated-p))))))
|
(set-window-dedicated-p win dedicated-p))))))
|
||||||
|
|
||||||
(defun +eshell--setup-window (window &optional flag)
|
(defun +eshell--setup-window (window &optional flag)
|
||||||
|
|
|
@ -103,6 +103,10 @@ You should use `set-eshell-alias!' to change this.")
|
||||||
;; or configure `+eshell-aliases' via elisp.
|
;; or configure `+eshell-aliases' via elisp.
|
||||||
(advice-add #'eshell-write-aliases-list :override #'ignore)
|
(advice-add #'eshell-write-aliases-list :override #'ignore)
|
||||||
|
|
||||||
|
;; REVIEW In Emacs 27 and newer, waiting for esh-module is unnecessary.
|
||||||
|
(after! esh-module
|
||||||
|
(add-to-list 'eshell-modules-list 'eshell-tramp))
|
||||||
|
|
||||||
;; Visual commands require a proper terminal. Eshell can't handle that, so
|
;; Visual commands require a proper terminal. Eshell can't handle that, so
|
||||||
;; it delegates these commands to a term buffer.
|
;; it delegates these commands to a term buffer.
|
||||||
(after! em-term
|
(after! em-term
|
||||||
|
|
|
@ -75,18 +75,3 @@ method to prepare vterm at the corresponding remote directory."
|
||||||
(vterm-send-string
|
(vterm-send-string
|
||||||
(concat "cd " path-localname))
|
(concat "cd " path-localname))
|
||||||
(vterm-send-return)))))
|
(vterm-send-return)))))
|
||||||
|
|
||||||
|
|
||||||
(defvar +vterm--insert-point nil)
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +vterm-remember-insert-point-h ()
|
|
||||||
"Remember point when leaving insert mode."
|
|
||||||
(setq-local +vterm--insert-point (point)))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +vterm-goto-insert-point-h ()
|
|
||||||
"Go to the point we were at when we left insert mode."
|
|
||||||
(when +vterm--insert-point
|
|
||||||
(goto-char +vterm--insert-point)
|
|
||||||
(setq-local +vterm--insert-point nil)))
|
|
||||||
|
|
|
@ -19,11 +19,4 @@
|
||||||
;; Don't prompt about dying processes when killing vterm
|
;; Don't prompt about dying processes when killing vterm
|
||||||
confirm-kill-processes nil
|
confirm-kill-processes nil
|
||||||
;; Prevent premature horizontal scrolling
|
;; Prevent premature horizontal scrolling
|
||||||
hscroll-margin 0)
|
hscroll-margin 0))
|
||||||
|
|
||||||
;; Restore the point's location when leaving and re-entering insert mode.
|
|
||||||
(when (featurep! :editor evil)
|
|
||||||
(add-hook! 'vterm-mode-hook
|
|
||||||
(defun +vterm-init-remember-point-h ()
|
|
||||||
(add-hook 'evil-insert-state-exit-hook #'+vterm-remember-insert-point-h nil t)
|
|
||||||
(add-hook 'evil-insert-state-entry-hook #'+vterm-goto-insert-point-h nil t)))))
|
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
|
|
||||||
(package! vterm
|
(package! vterm
|
||||||
:built-in 'prefer
|
:built-in 'prefer
|
||||||
:pin "101ff86d4d1c7ff8ca954ba59f666fd36f789aae")
|
:pin "fb12d7f49e2da121d9b17ed583d269166e0da087")
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
:config
|
:config
|
||||||
(setq ansible-section-face 'font-lock-variable-name-face
|
(setq ansible-section-face 'font-lock-variable-name-face
|
||||||
ansible-task-label-face 'font-lock-doc-face)
|
ansible-task-label-face 'font-lock-doc-face)
|
||||||
|
(when (featurep! :completion company)
|
||||||
|
(set-company-backend! 'ansible 'company-ansible))
|
||||||
(map! :map ansible-key-map
|
(map! :map ansible-key-map
|
||||||
:localleader
|
:localleader
|
||||||
:desc "Decrypt buffer" "d" #'ansible-decrypt-buffer
|
:desc "Decrypt buffer" "d" #'ansible-decrypt-buffer
|
||||||
|
|
5
modules/tools/ansible/doctor.el
Normal file
5
modules/tools/ansible/doctor.el
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||||
|
;;; tools/ansible/doctor.el
|
||||||
|
|
||||||
|
(unless (executable-find "ansible")
|
||||||
|
(warn! "Couldn't find ansible executable. Some features of the ansible module won't work"))
|
|
@ -1,7 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/ansible/packages.el
|
;;; tools/ansible/packages.el
|
||||||
|
|
||||||
(package! ansible :recipe (:nonrecursive t) :pin "cf6b8f06c2628357fc2a72ea9817a2c2d0ebf690")
|
(package! ansible :recipe (:nonrecursive t) :pin "40af0d2bbb6c5bbcf7aa9269ac9a07e22622d263")
|
||||||
(package! ansible-doc :pin "86083a7bb2ed0468ca64e52076b06441a2f8e9e0")
|
(package! ansible-doc :pin "86083a7bb2ed0468ca64e52076b06441a2f8e9e0")
|
||||||
(package! jinja2-mode :pin "ecd19a40b7832bb00f0a2244e3b0713d0bf3850d")
|
(package! jinja2-mode :pin "ecd19a40b7832bb00f0a2244e3b0713d0bf3850d")
|
||||||
(package! yaml-mode :pin "fc5e1c58f94472944c4aa838f00f6adcac6fa992")
|
(package! yaml-mode :pin "fc5e1c58f94472944c4aa838f00f6adcac6fa992")
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/biblio/packages.el
|
;;; tools/biblio/packages.el
|
||||||
|
|
||||||
(package! bibtex-completion :pin "8d84d8beb3bfafaa060d7e956fcc569ecf010d9c")
|
(package! bibtex-completion :pin "1bb81d77e08296a50de7ebfe5cf5b0c715b7f3d6")
|
||||||
(when (featurep! :completion ivy)
|
(when (featurep! :completion ivy)
|
||||||
(package! ivy-bibtex :pin "8d84d8beb3bfafaa060d7e956fcc569ecf010d9c"))
|
(package! ivy-bibtex :pin "1bb81d77e08296a50de7ebfe5cf5b0c715b7f3d6"))
|
||||||
(when (featurep! :completion helm)
|
(when (featurep! :completion helm)
|
||||||
(package! helm-bibtex :pin "8d84d8beb3bfafaa060d7e956fcc569ecf010d9c"))
|
(package! helm-bibtex :pin "1bb81d77e08296a50de7ebfe5cf5b0c715b7f3d6"))
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/debugger/packages.el
|
;;; tools/debugger/packages.el
|
||||||
|
|
||||||
(when (package! realgud :pin "ff660011c82c6af504915833e2d981a547b7ad58")
|
(when (package! realgud :pin "f73c039a340579a98e6716c901fd4e80e7eaa2eb")
|
||||||
(when (featurep! :lang javascript)
|
(when (featurep! :lang javascript)
|
||||||
(package! realgud-trepan-ni :pin "6e38cf838c7b47b5f1353d00901b939ffa36d707")))
|
(package! realgud-trepan-ni :pin "6e38cf838c7b47b5f1353d00901b939ffa36d707")))
|
||||||
|
|
||||||
(when (featurep! +lsp)
|
(when (featurep! +lsp)
|
||||||
(package! dap-mode :pin "e582ff90c104703ed65c1f3174d4c4690e9cf1fd")
|
(package! dap-mode :pin "612388d0b85e77972a9c28391bac6224a63408c7")
|
||||||
(package! posframe :pin "e1552c82dffaadc5e7de09a44880a498197ffbee"))
|
(package! posframe :pin "efd7ea490defc53a5b78e7469a3a35d225b766cc"))
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
|
|
||||||
(package! docker :pin "3773112eea3fc99704b5ca50c1e9a3db2cb8e4f3")
|
(package! docker :pin "3773112eea3fc99704b5ca50c1e9a3db2cb8e4f3")
|
||||||
(package! docker-tramp :pin "8e2b671eff7a81af43b76d9dfcf94ddaa8333a23")
|
(package! docker-tramp :pin "8e2b671eff7a81af43b76d9dfcf94ddaa8333a23")
|
||||||
(package! dockerfile-mode :pin "d31f7685ebc5832d957e25070a930aa42984327d")
|
(package! dockerfile-mode :pin "6a56c1cc1713b501040b08fdbf0c4159a4fe95f9")
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
|
|
||||||
(package! editorconfig
|
(package! editorconfig
|
||||||
:recipe (:nonrecursive t)
|
:recipe (:nonrecursive t)
|
||||||
:pin "da844718bfe1ca51919c63fdffedaba5d0cc1bba")
|
:pin "d73333c224de783e42acd225a20330a667fe5191")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/ein/packages.el
|
;;; tools/ein/packages.el
|
||||||
|
|
||||||
(package! ein :pin "a019ee3994585e4ed4700d2591d693fda3232616")
|
(package! ein :pin "917f2a0b6ca76ed9e966985ca6f19d8b57690d40")
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue