dev: merge branch 'master' of github.com:doomemacs

This commit is contained in:
Matt Nish-Lapidus 2024-08-23 11:55:16 -04:00
commit 1747a74198
27 changed files with 172 additions and 152 deletions

View file

@ -21,7 +21,7 @@
"^HOME$" "^\\(OLD\\)?PWD$" "^SHLVL$" "^PS1$" "^R?PROMPT$" "^TERM\\(CAP\\)?$"
"^USER$" "^GIT_CONFIG" "^INSIDE_EMACS$"
;; X server, Wayland, or services' env that shouldn't be persisted
"^DISPLAY$" "^WAYLAND_DISPLAY" "^DBUS_SESSION_BUS_ADDRESS$" "^XAUTHORITY$"
"^\\(WAYLAND_\\)?DISPLAY$" "^DBUS_SESSION_BUS_ADDRESS$" "^XAUTHORITY$"
;; Windows+WSL envvars that shouldn't be persisted
"^WSL_INTEROP$"
;; XDG variables that are best not persisted.

View file

@ -704,6 +704,31 @@ original state.")
;; noninteractive sessions.
(advice-add #'straight-vc-git--popup-raw :override #'straight--popup-raw)
;; HACK: `native-comp' only respects `native-comp-jit-compilation-deny-list'
;; when native-compiling packages in interactive sessions. It ignores the
;; variable when, say, straight is building packages. This advice forces it to
;; obey it, even when used by straight (but only in the CLI).
(defadvice! doom-cli--native--compile-async-skip-p (fn files &optional recursively load selector)
:around #'native-compile-async
(let (file-list)
(dolist (file-or-dir (ensure-list files))
(cond ((file-directory-p file-or-dir)
(dolist (file (if recursively
(directory-files-recursively
file-or-dir comp-valid-source-re)
(directory-files file-or-dir
t comp-valid-source-re)))
(push file file-list)))
((file-exists-p file-or-dir)
(push file-or-dir file-list))
((signal 'native-compiler-error
(list "Not a file nor directory" file-or-dir)))))
(funcall fn (seq-remove (lambda (file)
(seq-some (lambda (re) (string-match-p re file))
native-comp-deferred-compilation-deny-list))
file-list)
recursively load selector)))
;; HACK Replace GUI popup prompts (which hang indefinitely in tty Emacs) with
;; simple prompts.
(defadvice! doom-cli--straight-fallback-to-y-or-n-prompt-a (fn &optional prompt noprompt?)

View file

@ -140,7 +140,8 @@ uses a straight or package.el command directly).")
(after! comp
;; HACK Disable native-compilation for some troublesome packages
(mapc (doom-partial #'add-to-list 'native-comp-deferred-compilation-deny-list)
(list "/emacs-jupyter.*\\.el\\'"
(list "/seq-tests\\.el\\'"
"/emacs-jupyter.*\\.el\\'"
"/evil-collection-vterm\\.el\\'"
"/vterm\\.el\\'"
"/with-editor\\.el\\'"))))

View file

@ -170,7 +170,8 @@
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
:desc "Cancel current org-clock" "C" #'org-clock-cancel
:desc "Open deft" "d" #'deft
(:when (modulep! :ui deft)
:desc "Open deft" "d" #'deft)
(:when (modulep! :lang org +noter)
:desc "Org noter" "e" #'org-noter)

View file

@ -609,7 +609,8 @@
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
:desc "Cancel current org-clock" "C" #'org-clock-cancel
:desc "Open deft" "d" #'deft
(:when (modulep! :ui deft)
:desc "Open deft" "d" #'deft)
(:when (modulep! :lang org +noter)
:desc "Org noter" "e" #'org-noter)

View file

@ -8,6 +8,9 @@
;;;###autoload (autoload 'apheleia--get-formatters "apheleia-formatters")
;;;###autoload
(defvar +format--region-p nil)
;;;###autoload
(defun +format-region (start end &optional callback)
"Format from START to END with `apheleia'."
@ -41,6 +44,7 @@
(when (> indent 0)
(indent-rigidly (point-min) (point-max) (- indent)))
;;
(let ((+format--region-p (cons start end)))
(apheleia-format-buffer
command
(lambda ()
@ -51,12 +55,10 @@
(max 0 (- indent (+format--current-indentation)))))
(set-buffer-modified-p nil))
(with-current-buffer cur-buffer
(delete-region start end)
(goto-char start)
(save-excursion
(insert-buffer-substring-no-properties formatted-buffer)
(when callback (funcall callback)))
(kill-buffer formatted-buffer)))))
(with-silent-modifications
(replace-region-contents start end (lambda () formatted-buffer) 5))
(when callback (funcall callback))
(kill-buffer formatted-buffer))))))
(when (doom-region-active-p)
(setq deactivate-mark t)))))

View file

@ -46,40 +46,38 @@ mode unconditionally, call `+format-with-lsp-mode' instead."
(cl-defun +format-lsp-buffer (&rest plist &key buffer callback &allow-other-keys)
"Format the current buffer with any available lsp-mode or eglot formatter."
(if-let* ((fn (with-current-buffer buffer (+format--lsp-fn)))
((apply fn plist)))
((apply fn (car +format--region-p) (cdr +format--region-p)
plist)))
(funcall callback)
(funcall callback "LSP server doesn't support formatting")))
(cl-defun +format--with-lsp-mode (&key buffer scratch &allow-other-keys)
"Format the current buffer with any available lsp-mode formatter."
(cl-defun +format--with-lsp-mode (beg end &key buffer &allow-other-keys)
"Format the current buffer or region with any available lsp-mode formatter.
Won't forward the buffer to chained formatters if successful."
(with-current-buffer buffer
(let ((edits
(cond
((lsp-feature? "textDocument/formatting")
(cond ((and (null beg) (lsp-feature? "textDocument/formatting"))
(lsp-request "textDocument/formatting"
(lsp--make-document-formatting-params)))
((lsp-feature? "textDocument/rangeFormatting")
(lsp-request "textDocument/rangeFormatting"
(lsp--make-document-range-formatting-params
(point-min) (point-max))))
(:err))))
(unless (eq edits :err)
(or beg (point-min)) (or end (point-max)))))
;; try next chained formatter(s)
((cl-return (ignore (funcall callback)))))))
(unless (seq-empty-p edits)
(with-current-buffer scratch
(lsp--apply-text-edits edits 'format)))
t))))
(cl-defun +format--with-eglot (&key buffer scratch &allow-other-keys)
"Format the current buffer with any available eglot formatter."
(with-current-buffer scratch
(when (setq-local
eglot--cached-server
(with-current-buffer buffer
(when (or (eglot-server-capable :documentFormattingProvider)
(eglot-server-capable :documentRangeFormattingProvider))
(eglot-current-server))))
(let ((buffer-file-name (buffer-file-name buffer)))
(eglot-format-buffer))
(lsp--apply-text-edits edits 'format))
t)))
(cl-defun +format--with-eglot (beg end &key buffer callback &allow-other-keys)
"Format the current buffer or region with any available eglot formatter.
Won't forward the buffer to chained formatters if successful."
(with-current-buffer buffer
(or (with-demoted-errors "%s"
(always (eglot-format beg end)))
;; try next chained formatter(s)
(ignore (funcall callback)))))
;;; lsp.el ends here

View file

@ -4,6 +4,7 @@
'(sql-mode ; sqlformat is currently broken
tex-mode ; latexindent is broken
latex-mode
LaTeX-mode
org-msg-edit-mode) ; doesn't need a formatter
"A list of major modes in which to not reformat the buffer upon saving.

View file

@ -105,27 +105,29 @@ Fixes #3939: unsortable dired entries on Windows."
(setq dirvish-subtree-always-show-state t)
(appendq! dirvish-attributes '(nerd-icons subtree-state)))
;; HACK: Makes `dirvish-hide-details' accept a list of symbols to instruct
;; Dirvish in what contexts `dirvish-hide-details' should be enabled. The
;; accepted values are:
;; HACK: Makes `dirvish-hide-details' and `dirvish-hide-cursor' accept a list
;; of symbols to instruct Dirvish in what contexts they should be enabled.
;; The accepted values are:
;; - `dired': when opening a directory directly or w/o Dirvish's full UI.
;; - `dirvish': when opening full-frame Dirvish.
;; - `dirvish-side': when opening Dirvish in the sidebar.
;; REVIEW: Upstream this behavior later. (Maybe with similar treatment for
;; `dirvish-hide-cursor'?)
(setq dirvish-hide-details '(dirvish dirvish-side))
;; REVIEW: Upstream this behavior later.
(setq dirvish-hide-details '(dirvish dirvish-side)
dirvish-hide-cursor '(dirvish dirvish-side))
(defadvice! +dired--hide-details-maybe-a (fn &rest args)
:around #'dirvish-init-dired-buffer
(let ((dirvish-hide-details
(if (listp dirvish-hide-details)
(letf! (defun enabled? (val)
(if (listp val)
(cond ((if dirvish--this (memq 'side (dv-type dirvish--this)))
(memq 'dirvish-side dirvish-hide-details))
(memq 'dirvish-side val))
((or (null dirvish--this)
(null (car (dv-layout dirvish--this))))
(memq 'dired dirvish-hide-details))
((memq 'dirvish dirvish-hide-details)))
dirvish-hide-details)))
(apply fn args)))
(memq 'dired val))
((memq 'dirvish val)))
val))
(let ((dirvish-hide-details (enabled? dirvish-hide-details)))
(setq-local dirvish-hide-cursor (and (enabled? dirvish-hide-cursor) t))
(apply fn args))))
(when (modulep! :ui tabs)
(after! centaur-tabs
@ -143,6 +145,11 @@ Fixes #3939: unsortable dired entries on Windows."
:n "F" #'dirvish-layout-toggle
:n "z" #'dirvish-history-jump
:n "gh" #'dirvish-subtree-up
:n "gl" #'dirvish-subtree-toggle
:n "h" #'dired-up-directory
:n "l" #'dired-find-file
:gm [left] #'dired-up-directory
:gm [right] #'dired-find-file
:m "[h" #'dirvish-history-go-backward
:m "]h" #'dirvish-history-go-forward
:m "[e" #'dirvish-emerge-next-group

View file

@ -37,7 +37,10 @@
"f" #'flutter-run
"q" #'flutter-quit
"r" #'flutter-hot-reload
"R" #'flutter-hot-restart)))
"R" #'flutter-hot-restart))
:config
(set-popup-rule! (concat "^" (regexp-quote flutter-buffer-name))
:ttl 0 :quit t))
(use-package! lsp-dart

View file

@ -234,6 +234,7 @@ See `+emacs-lisp-non-package-mode' for details.")
:around #'elisp-demos--symbols
:around #'elisp-demos--syntax-highlight
(let ((org-inhibit-startup t)
(doom-inhibit-local-var-hooks t)
enable-dir-local-variables
org-mode-hook)
(apply fn args))))

View file

@ -13,7 +13,6 @@ This module adds [[https://golang.org][Go]] support, with optional (but recommen
- REPL (~gore~)
- Syntax-checking (~flycheck~)
- Auto-formatting on save (~gofmt~) (requires [[doom-module::editor format +onsave]])
- Code navigation & refactoring (~go-guru~)
- [[../../editor/file-templates/templates/go-mode][File templates]]
- [[https://github.com/hlissner/doom-snippets/tree/master/go-mode][Snippets]]
- Generate testing code (~go-gen-test~)
@ -36,7 +35,6 @@ This module adds [[https://golang.org][Go]] support, with optional (but recommen
- [[doom-package:flycheck-golangci-lint]] if [[doom-module::checkers syntax]]
- [[doom-package:go-eldoc]]
- [[doom-package:go-gen-test]]
- [[doom-package:go-guru]]
- [[doom-package:go-mode]]
- [[doom-package:gorepl-mode]]
- [[doom-package:go-tag]]
@ -64,7 +62,6 @@ below.
- ~godoc~ (for documentation lookup)
- ~gorename~ (for extra refactoring commands)
- ~gore~ (for the REPL)
- ~guru~ (for code navigation & refactoring commands)
- ~goimports~ (/optional/: for auto-formatting code on save & fixing imports)
- ~gotests~ (for generate test code)
- ~gomodifytags~ (for manipulating tags)
@ -77,7 +74,6 @@ go install github.com/stamblerre/gocode@latest
go install golang.org/x/tools/cmd/godoc@latest
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/cmd/gorename@latest
go install golang.org/x/tools/cmd/guru@latest
go install github.com/cweill/gotests/gotests@latest
go install github.com/fatih/gomodifytags@latest
#+end_src
@ -102,16 +98,6 @@ go install github.com/fatih/gomodifytags@latest
| [[kbd:][<localleader> b b]] | run ~$ go build~ |
| [[kbd:][<localleader> b r]] | run ~$ go run .~ |
| [[kbd:][<localleader> h .]] | lookup symbol at point in godoc |
| [[kbd:][<localleader> h d]] | describe symbol at point |
| [[kbd:][<localleader> h v]] | list free variables |
| [[kbd:][<localleader> h i]] | list implements relations for package types |
| [[kbd:][<localleader> h p]] | list peers for channel |
| [[kbd:][<localleader> h P]] | "what does this point to" |
| [[kbd:][<localleader> h r]] | list references to object |
| [[kbd:][<localleader> h e]] | which errors |
| [[kbd:][<localleader> h w]] | what query |
| [[kbd:][<localleader> h c]] | show callers of function at point |
| [[kbd:][<localleader> h C]] | show callees of function at point |
| [[kbd:][<localleader> t t]] | rerun last test |
| [[kbd:][<localleader> t a]] | run all tests in project |
| [[kbd:][<localleader> t f]] | run all tests in current file |

View file

@ -7,8 +7,6 @@
(set-docsets! 'go-mode "Go")
(set-repl-handler! 'go-mode #'gorepl-run)
(set-lookup-handlers! 'go-mode
:definition #'go-guru-definition
:references #'go-guru-referrers
:documentation #'godoc-at-point)
(if (modulep! +lsp)
@ -25,20 +23,9 @@
"e" #'+go/play-buffer-or-region
"i" #'go-goto-imports ; Go to imports
(:prefix ("h" . "help")
"." #'godoc-at-point ; Lookup in godoc
"d" #'go-guru-describe ; Describe this
"v" #'go-guru-freevars ; List free variables
"i" #'go-guru-implements ; Implements relations for package types
"p" #'go-guru-peers ; List peers for channel
"P" #'go-guru-pointsto ; What does this point to
"r" #'go-guru-referrers ; List references to object
"e" #'go-guru-whicherrs ; Which errors
"w" #'go-guru-what ; What query
"c" #'go-guru-callers ; Show callers of this function
"C" #'go-guru-callees) ; Show callees of this function
"." #'godoc-at-point) ; Lookup in godoc
(:prefix ("ri" . "imports")
"a" #'go-import-add
"r" #'go-remove-unused-imports)
"a" #'go-import-add)
(:prefix ("b" . "build")
:desc "go run ." "r" (cmd! (compile "go run ."))
:desc "go build" "b" (cmd! (compile "go build"))

View file

@ -9,9 +9,6 @@
(modulep! :tools tree-sitter))
"This module requires (:tools tree-sitter)")
(unless (executable-find "guru")
(warn! "Couldn't find guru. Refactoring commands (go-guru-*) won't work"))
(unless (executable-find "gore")
(warn! "Couldn't find gore. REPL will not work"))

View file

@ -2,7 +2,6 @@
;;; lang/go/packages.el
(package! go-eldoc :pin "cbbd2ea1e94a36004432a9ac61414cb5a95a39bd")
(package! go-guru :pin "636d36e37a0d2b6adb2e12d802ff4794ccbba336")
(package! go-mode :pin "636d36e37a0d2b6adb2e12d802ff4794ccbba336")
(package! gorepl-mode :pin "6a73bf352e8d893f89cad36c958c4db2b5e35e07")
(package! go-tag :pin "33f2059551d5298ca228d90f525b99d1a8d70364")

View file

@ -100,7 +100,8 @@ If no viewer is found, `latex-preview-pane-mode' is used.")
;; Hook LSP, if enabled.
(when (modulep! +lsp)
(add-hook! '(tex-mode-local-vars-hook
latex-mode-local-vars-hook)
latex-mode-local-vars-hook
LaTeX-mode-local-vars-hook)
:append #'lsp!))
;; Define a function to compile the project.
(defun +latex/compile ()

View file

@ -189,6 +189,8 @@ pacman -S texlive-core texlive-bin texlive-science texlive-latexextra
pacman -S gnuplot
#+end_src
For [[doom-module:+jupyter]], install =jupyterlab= or =jupyter-notebook= ([[https://wiki.archlinux.org/title/Jupyter][source]]).
** Debian & Ubuntu
#+begin_src sh
apt-get install texlive dvipng

View file

@ -116,9 +116,6 @@
(package! ob-async :pin "9aac486073f5c356ada20e716571be33a350a982")
(when (modulep! :lang clojure)
(package! ob-clojure-literate
:recipe (:type git
:host nil
:repo "https://repo.or.cz/ob-clojure-literate.el.git")
:pin "18c3ea15b872a43e67c899a9914182c35b00b7ee"))
(when (modulep! :lang crystal)
(package! ob-crystal :pin "d84c1adee4b269cdba06a97caedb8071561a09af"))

View file

@ -12,6 +12,7 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs.
- Code refactoring commands (~php-refactor-mode~)
- Unit-test commands (~phpunit~)
- Support for ~laravel~ and ~composer~ projects (with project-specific snippets)
- LSP support (via the [[doom-module:+lsp]] flag)
- [[../../editor/file-templates/templates/php-mode][File templates]]
- [[https://github.com/hlissner/doom-snippets/tree/master/php-mode][Snippets]]
@ -31,8 +32,8 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs.
- +hack ::
Add support for the [[https://hacklang.org/][Hack dialect of PHP]] by Facebook.
- +lsp ::
Enable LSP support for ~php-mode~. Requires [[doom-module::tools lsp]] and a langserver
(supports [[https://phpactor.readthedocs.io/en/develop/usage/standalone.html][phpactor]] and intelephense).
Enable LSP support for ~php-mode~. Requires [[doom-module::tools lsp]] and a
langserver (supports [[https://emacs-lsp.github.io/lsp-mode/page/lsp-phpactor/][phpactor]], [[https://emacs-lsp.github.io/lsp-mode/page/lsp-intelephense/][intelephense]], [[https://emacs-lsp.github.io/lsp-mode/page/lsp-serenata/][serenata]], [[https://emacs-lsp.github.io/lsp-mode/page/lsp-php/][php-language-server]]).
- +tree-sitter ::
Leverages tree-sitter for better syntax highlighting and structural text
editing. Requires [[doom-module::tools tree-sitter]].
@ -45,9 +46,6 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs.
- [[doom-package:php-mode]]
- [[doom-package:php-refactor-mode]]
- [[doom-package:phpunit]]
- if [[doom-module:+lsp]]
- [[doom-package:phpactor]]
- [[doom-package:company-phpactor]]
** Hacks
/No hacks documented for this module./

View file

@ -50,7 +50,7 @@
:yield "use")
(if (not (modulep! +lsp))
;; `+php-company-backend' uses `company-phpactor', `php-extras-company' or
;; `+php-company-backend' uses `php-extras-company' or
;; `company-dabbrev-code', in that order.
(when +php--company-backends
(set-company-backend! 'php-mode
@ -78,24 +78,6 @@
"s" #'phpunit-current-test))
(use-package! phpactor
:unless (modulep! +lsp)
:after php-mode
:init
(add-to-list '+php--company-backends #'company-phpactor nil 'eq)
:config
(set-lookup-handlers! 'php-mode
:definition #'phpactor-goto-definition)
(map! :localleader
:map php-mode-map
:prefix ("r" . "refactor")
"cc" #'phpactor-copy-class
"mc" #'phpactor-move-class
"oi" #'phpactor-offset-info
"t" #'phpactor-transform
"ic" #'phpactor-import-class))
(use-package! php-refactor-mode
:hook php-mode
:config
@ -111,13 +93,12 @@
(use-package! php-extras
:after php-mode
:preface
(setq php-extras-eldoc-functions-file
(concat doom-profile-cache-dir "php-extras-eldoc-functions"))
;; We'll set up company support ourselves
(advice-add #'php-extras-company-setup :override #'ignore)
:init
(add-to-list '+php--company-backends #'php-extras-company)
:config
(setq php-extras-eldoc-functions-file
(concat doom-data-dir "php-extras-eldoc-functions"))
;; Silence warning if `php-extras-eldoc-functions-file' hasn't finished
;; generating yet.
(defun php-extras-load-eldoc ()

View file

@ -15,10 +15,5 @@
:recipe (:host github :repo "hhvm/hack-mode")
:pin "ccf20511f0f2ed45d00d423c703bb91ab6a8b80c"))
(unless (modulep! +lsp)
(package! phpactor :pin "6b5269ff82785a9bd1e648b2f91e5128353d5a67")
(when (modulep! :completion company)
(package! company-phpactor :pin "6b5269ff82785a9bd1e648b2f91e5128353d5a67")))
;; For building php-extras
(package! async :pin "cff2bd0be3c78a2eb76717eed60302972fe9b8c5")

View file

@ -3,15 +3,24 @@
(use-package! plantuml-mode
:commands plantuml-download-jar
:init
(setq plantuml-jar-path (concat doom-data-dir "plantuml.jar")
org-plantuml-jar-path plantuml-jar-path)
(setq plantuml-jar-path (concat doom-data-dir "plantuml.jar"))
:config
(set-popup-rule! "^\\*PLANTUML" :size 0.4 :select nil :ttl 0)
(setq plantuml-default-exec-mode
(cond ((file-exists-p plantuml-jar-path) 'jar)
((executable-find "plantuml") 'executable)
(plantuml-default-exec-mode))))
((executable-find plantuml-executable-path) 'executable)
(plantuml-default-exec-mode)))
;; HACK: If plantuml-jar-path is missing at startup, then plantuml-mode will
;; operate in another `plantuml-default-exec-mode'. After using
;; plantuml-download-jar, we change it to `jar' just for this session.
(defadvice! +plantuml--use-downloaded-jar-a (fn &rest args)
"Configure plantuml-mode to use the downloaded jar for this session."
:around #'plantuml-download-jar
(let ((downloaded? (not (file-exists-p plantuml-jar-path))))
(prog1 (apply fn args)
(when (and downloaded? (file-exists-p plantuml-jar-path))
(setq org-plantuml-jar-path plantuml-jar-path
plantuml-default-exec-mode 'jar))))))
(use-package! flycheck-plantuml
@ -25,7 +34,13 @@
(after! ob-plantuml
;; HACK Force ob-plantuml to use `plantuml-mode''s building mechanism, which
;; The nested `after!' is needed to ensure `org-plantuml-jar-path's new
;; default without overwriting any user config.
(after! plantuml-mode
(when (equal org-plantuml-jar-path "")
(setq org-plantuml-jar-path plantuml-jar-path)))
;; HACK: Force ob-plantuml to use `plantuml-mode''s building mechanism, which
;; is more sophisticated.
(advice-add #'org-babel-execute:plantuml
:override #'+plantuml-org-babel-execute:plantuml-a)

View file

@ -84,6 +84,9 @@ Can be a list of backends; accepts any value `company-backends' accepts.")
:implementations '(lsp-find-implementation :async t)
:type-definition #'lsp-find-type-definition)
;; HACK: See emacs-lsp/lsp-mode#3577
(unless (modulep! :lang terraform)
(setq lsp-client-packages (delete 'lsp-terraform lsp-client-packages)))
(defadvice! +lsp--respect-user-defined-checkers-a (fn &rest args)
"Ensure user-defined `flycheck-checker' isn't overwritten by `lsp'."

View file

@ -1,12 +1,12 @@
;; -*- no-byte-compile: t; -*-
;;; tools/magit/packages.el
;; NOTE: Always bump this to HEAD~1, not HEAD, because the latest commit on
;; magit's melpa branch is auto-generated and moved to HEAD every time there's
;; a commit to its main branch.
;; NOTE: Always bump magit and forge to HEAD~1, not HEAD, because the latest
;; commit on their melpa branches are auto-generated and moved to HEAD every
;; time there's a commit to its main branch.
(package! magit :pin "2da34f1317c619ec2dfb9e0d969449261ca7f31f")
(when (modulep! +forge)
(package! forge :pin "1e7ee99c7f76034e40210a6fd6007015b1998f6d")
(package! forge :pin "30f181f785522f2debf60945d6b589a65bc415f6")
(package! code-review
:recipe (:host github
:repo "doomelpa/code-review"

View file

@ -138,7 +138,10 @@ and cannot run in."
(setq +ligatures--init-font-hook nil)))
(when in-mode-extras-p
(prependq! prettify-symbols-alist
(alist-get major-mode +ligatures-extra-alist)))
(or (alist-get major-mode +ligatures-extra-alist)
(cl-loop for (mode . symbols) in +ligatures-extra-alist
if (derived-mode-p mode)
return symbols))))
(when (and (or in-mode-p in-mode-extras-p)
prettify-symbols-alist)
(when prettify-symbols-mode

View file

@ -192,5 +192,21 @@ Respects `diff-hl-disable-on-remote'."
;; triggered from Elisp's buffer API (from what I can tell).
(defadvice! +vc-gutter--kill-diff-hl-thread-a (&optional buf)
:before #'kill-buffer
(with-current-buffer (or buf (current-buffer))
(when-let ((buf (ignore-errors (window-normalize-buffer buf))))
(with-current-buffer buf
(+vc-gutter--kill-thread t))))
;; HACK: diff-hl won't be visible in TTY frames, but there's no simple way to
;; use the fringe in GUI Emacs and use the margin in the terminal *AND*
;; support daemon users, so we need more than a static `display-graphic-p'
;; check at startup.
(when (modulep! :os tty)
(put 'diff-hl-mode 'last (display-graphic-p))
(add-hook! 'doom-switch-window-hook
(defun +vc-gutter-use-margins-in-tty-h ()
(let ((graphic? (display-graphic-p)))
(unless (and global-diff-hl-mode (eq (get 'diff-hl-mode 'last) graphic?))
(global-diff-hl-mode -1)
(diff-hl-margin-mode (if graphic? -1 +1))
(global-diff-hl-mode +1)
(put 'diff-hl-mode 'last graphic?)))))))

View file

@ -118,7 +118,7 @@ Returns t on success, nil otherwise."
(unless (+workspace-exists-p name)
(error "'%s' is an invalid workspace" name))
(let ((fname (expand-file-name +workspaces-data-file persp-save-dir)))
(persp-save-to-file-by-names fname *persp-hash* (list name))
(persp-save-to-file-by-names fname *persp-hash* (list name) t)
(and (member name (persp-list-persp-names-in-file fname))
t)))