dev: merge branch 'master' into emenel

This commit is contained in:
Matt Nish-Lapidus 2024-04-09 10:37:06 -04:00
commit 0df1e0ca5d
10 changed files with 128 additions and 108 deletions

View file

@ -497,65 +497,69 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(cons 'custom-theme-directory (cons 'custom-theme-directory
(delq 'custom-theme-directory custom-theme-load-path))) (delq 'custom-theme-directory custom-theme-load-path)))
(defun doom-init-fonts-h (&optional _reload) (defun doom-init-fonts-h (&optional reload)
"Loads `doom-font', `doom-serif-font', and `doom-variable-pitch-font'." "Loads `doom-font', `doom-serif-font', and `doom-variable-pitch-font'."
(let ((this-frame (selected-frame))) (let ((initialized-frames (unless reload (get 'doom-font 'initialized-frames))))
(dolist (map `((default . ,doom-font) (dolist (frame (if reload (frame-list) (list (selected-frame))))
(fixed-pitch . ,doom-font) (unless (member frame initialized-frames)
(fixed-pitch-serif . ,doom-serif-font) (dolist (map `((default . ,doom-font)
(variable-pitch . ,doom-variable-pitch-font))) (fixed-pitch . ,doom-font)
(condition-case e (fixed-pitch-serif . ,doom-serif-font)
(when-let* ((face (car map)) (variable-pitch . ,doom-variable-pitch-font)))
(font (cdr map))) (condition-case e
(dolist (frame (frame-list)) (when-let* ((face (car map))
(when (display-multi-font-p frame) (font (cdr map)))
(set-face-attribute face frame (when (display-multi-font-p frame)
:width 'normal :weight 'normal (set-face-attribute face frame
:slant 'normal :font font))) :width 'normal :weight 'normal
(custom-push-theme :slant 'normal :font font))
'theme-face face 'user 'set (custom-push-theme
(let* ((base-specs (cadr (assq 'user (get face 'theme-face)))) 'theme-face face 'user 'set
(base-specs (or base-specs '((t nil)))) (let* ((base-specs (cadr (assq 'user (get face 'theme-face))))
(attrs '(:family :foundry :slant :weight :height :width)) (base-specs (or base-specs '((t nil))))
(new-specs nil)) (attrs '(:family :foundry :slant :weight :height :width))
(dolist (spec base-specs) (new-specs nil))
;; Each SPEC has the form (DISPLAY ATTRIBUTE-PLIST) (dolist (spec base-specs)
(let ((display (car spec)) (let ((display (car spec))
(plist (copy-tree (nth 1 spec)))) (plist (copy-tree (nth 1 spec))))
;; Alter only DISPLAY conditions matching this frame. (when (or (memq display '(t default))
(when (or (memq display '(t default)) (face-spec-set-match-display display frame))
(face-spec-set-match-display display this-frame)) (dolist (attr attrs)
(dolist (attr attrs) (setq plist (plist-put plist attr (face-attribute face attr)))))
(setq plist (plist-put plist attr (face-attribute face attr))))) (push (list display plist) new-specs)))
(push (list display plist) new-specs))) (nreverse new-specs)))
(nreverse new-specs))) (put face 'face-modified nil))
(put face 'face-modified nil)) ('error
('error (ignore-errors (doom--reset-inhibited-vars-h))
(ignore-errors (doom--reset-inhibited-vars-h)) (if (string-prefix-p "Font not available" (error-message-string e))
(if (string-prefix-p "Font not available" (error-message-string e)) (signal 'doom-font-error (list (font-get (cdr map) :family)))
(signal 'doom-font-error (list (font-get (cdr map) :family))) (signal (car e) (cdr e))))))
(signal (car e) (cdr e))))))) (put 'doom-font 'initialized-frames
(when (fboundp 'set-fontset-font) (cons frame (cl-delete-if-not #'frame-live-p initialized-frames))))))
(let* ((fn (doom-rpartial #'member (font-family-list))) ;; Only do this once per session (or on `doom/reload-fonts'); superfluous
(symbol-font (or doom-symbol-font ;; `set-fontset-font' calls may segfault in some contexts.
(cl-find-if fn doom-symbol-fallback-font-families))) (when (or reload (not (get 'doom-font 'initialized)))
(emoji-font (or doom-emoji-font (when (fboundp 'set-fontset-font) ; unavailable in emacs-nox
(cl-find-if fn doom-emoji-fallback-font-families)))) (let* ((fn (doom-rpartial #'member (font-family-list)))
(when symbol-font (symbol-font (or doom-symbol-font
(dolist (script '(symbol mathematical)) (cl-find-if fn doom-symbol-fallback-font-families)))
(set-fontset-font t script symbol-font))) (emoji-font (or doom-emoji-font
(when emoji-font (cl-find-if fn doom-emoji-fallback-font-families))))
;; DEPRECATED: make unconditional when we drop 27 support (when symbol-font
(when (version<= "28.1" emacs-version) (dolist (script '(symbol mathematical))
(set-fontset-font t 'emoji emoji-font)) (set-fontset-font t script symbol-font)))
;; some characters in the Emacs symbol script are often covered by emoji (when emoji-font
;; fonts ;; DEPRECATED: make unconditional when we drop 27 support
(set-fontset-font t 'symbol emoji-font nil 'append))) (when (version<= "28.1" emacs-version)
;; Nerd Fonts use these Private Use Areas (set-fontset-font t 'emoji emoji-font))
(dolist (range '((#xe000 . #xf8ff) (#xf0000 . #xfffff))) ;; some characters in the Emacs symbol script are often covered by
(set-fontset-font t range "Symbols Nerd Font Mono"))) ;; emoji fonts
;; Users should inject their own font logic in `after-setting-font-hook' (set-fontset-font t 'symbol emoji-font nil 'append)))
(run-hooks 'after-setting-font-hook)) ;; Nerd Fonts use these Private Use Areas
(dolist (range '((#xe000 . #xf8ff) (#xf0000 . #xfffff)))
(set-fontset-font t range "Symbols Nerd Font Mono")))
(run-hooks 'after-setting-font-hook))
(put 'doom-font 'initialized t))
(defun doom-init-theme-h (&rest _) (defun doom-init-theme-h (&rest _)
"Load the theme specified by `doom-theme' in FRAME." "Load the theme specified by `doom-theme' in FRAME."

View file

@ -14,10 +14,6 @@
;; buffers anyway. ;; buffers anyway.
(setq-hook! 'emacs-everywhere-init-hooks doom-inhibit-local-var-hooks t) (setq-hook! 'emacs-everywhere-init-hooks doom-inhibit-local-var-hooks t)
;; REVIEW: Fixes tecosaur/emacs-everywhere#75. Remove when dealt with
;; upstream.
(define-key emacs-everywhere-mode-map "\C-c\C-c" #'emacs-everywhere-finish)
(after! doom-modeline (after! doom-modeline
(doom-modeline-def-segment emacs-everywhere (doom-modeline-def-segment emacs-everywhere
(concat (concat

View file

@ -1,4 +1,4 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; app/everywhere/packages.el ;;; app/everywhere/packages.el
(package! emacs-everywhere :pin "fbeff19825336777dccaefedf3f376dd622cd294") (package! emacs-everywhere :pin "bc91164151ab012ff884af92321557f9b37eeed1")

View file

@ -51,16 +51,19 @@
:hook (flycheck-mode . +syntax-init-popups-h) :hook (flycheck-mode . +syntax-init-popups-h)
:config :config
(setq flycheck-popup-tip-error-prefix "X ") (setq flycheck-popup-tip-error-prefix "X ")
(after! evil
;; Don't display popups while in insert or replace mode, as it can affect ;; HACK: Only display the flycheck popup if we're in normal mode (for evil
;; the cursor's position or cause disruptive input delays. ;; users) or if no selection or completion is active. This popup can
(add-hook! '(evil-insert-state-entry-hook evil-replace-state-entry-hook) ;; interfere with the active evil mode, clear active regions, and other
#'flycheck-popup-tip-delete-popup) ;; funny business (see #7242).
(defadvice! +syntax--disable-flycheck-popup-tip-maybe-a (&rest _) (defadvice! +syntax--disable-flycheck-popup-tip-maybe-a (&rest _)
:before-while #'flycheck-popup-tip-show-popup :before-while #'flycheck-popup-tip-show-popup
(if evil-local-mode (if (and (bound-and-true-p evil-local-mode)
(eq evil-state 'normal) (not (evil-emacs-state-p)))
(not (bound-and-true-p company-backend)))))) (evil-normal-state-p)
(and (not (region-active-p))
(not (bound-and-true-p company-backend))
(not (ignore-errors (>= corfu--index 0)))))))
(use-package! flycheck-posframe (use-package! flycheck-posframe

View file

@ -138,10 +138,12 @@ TAB/S-TAB.")
(after! dabbrev (after! dabbrev
(setq dabbrev-friend-buffer-function #'+dabbrev-friend-buffer-p (setq dabbrev-friend-buffer-function #'+dabbrev-friend-buffer-p
dabbrev-ignored-buffer-regexps dabbrev-ignored-buffer-regexps
'("^ " '("\\` "
"\\(TAGS\\|tags\\|ETAGS\\|etags\\|GTAGS\\|GRTAGS\\|GPATH\\)\\(<[0-9]+>\\)?") "\\(TAGS\\|tags\\|ETAGS\\|etags\\|GTAGS\\|GRTAGS\\|GPATH\\)\\(<[0-9]+>\\)?")
dabbrev-upcase-means-case-search t) dabbrev-upcase-means-case-search t)
(add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode))) (add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode)
(add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode)
(add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode)))
;; Make these capfs composable. ;; Make these capfs composable.
(advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible) (advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible)

View file

@ -44,7 +44,9 @@ Can be negative.")
;; symbol at point. ;; symbol at point.
helm-imenu-execute-action-at-once-if-one nil helm-imenu-execute-action-at-once-if-one nil
;; Disable special behavior for left/right, M-left/right keys. ;; Disable special behavior for left/right, M-left/right keys.
helm-ff-lynx-style-map nil) helm-ff-lynx-style-map nil
;; Don't commandeer the entire frame for helm commands.
helm-always-two-windows nil)
(map! [remap apropos] #'helm-apropos (map! [remap apropos] #'helm-apropos
[remap find-library] #'helm-locate-library [remap find-library] #'helm-locate-library
@ -189,7 +191,13 @@ Can be negative.")
(use-package! helm-descbinds (use-package! helm-descbinds
:hook (helm-mode . helm-descbinds-mode)) :hook (helm-mode . helm-descbinds-mode)
:config
;; HACK: Upstream claims that the two packages are incompatible, but changing
;; `prefix-help-command' seems to smooth the incompatibility over. More
;; testing is needed...
(setq helm-descbinds-disable-which-key nil
prefix-help-command #'helm-descbinds))
(use-package! helm-icons (use-package! helm-icons

View file

@ -1,10 +1,10 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; editor/snippets/packages.el ;;; editor/snippets/packages.el
(package! yasnippet :pin "33587a8551b8f6991b607d3532062a384c010ce1") (package! yasnippet :pin "eb5ba2664c3a68ae4a53bb38b85418dd131b208f")
(package! auto-yasnippet :pin "6a9e406d0d7f9dfd6dff7647f358cb05a0b1637e") (package! auto-yasnippet :pin "6a9e406d0d7f9dfd6dff7647f358cb05a0b1637e")
(package! doom-snippets (package! doom-snippets
:recipe (:host github :recipe (:host github
:repo "doomemacs/snippets" :repo "doomemacs/snippets"
:files (:defaults "*")) :files (:defaults "*"))
:pin "07b3bdaf60b74080f899b12c3d46594c7fa75e04") :pin "c1384cc7975ee7ca7d551eb56c104d768440c3cb")

View file

@ -23,8 +23,7 @@
(cond ((and (string-prefix-p "jupyter-" lang) (cond ((and (string-prefix-p "jupyter-" lang)
(require 'jupyter nil t)) (require 'jupyter nil t))
(jupyter-eval-region beg end)) (jupyter-eval-region beg end))
((let ((major-mode (org-src-get-lang-mode lang))) ((+eval-region-as-major-mode beg end (org-src-get-lang-mode lang))))))))
(+eval/region beg end))))))))
;;;###autoload ;;;###autoload

View file

@ -72,6 +72,38 @@
output source-buffer) output source-buffer)
output) output)
;;;###autoload
(defun +eval-region-as-major-mode (beg end &optional runner-major-mode)
"Evaluate a region between BEG and END and display the output.
Evaluate as in RUNNER-MAJOR-MODE. If RUNNER-MAJOR-MODE is nil, use major-mode
of the buffer instead."
(let ((load-file-name buffer-file-name)
(load-true-file-name
(or buffer-file-truename
(if buffer-file-name
(file-truename buffer-file-name))))
(runner-major-mode (or runner-major-mode major-mode)))
(cond ((if (fboundp '+eval--ensure-in-repl-buffer)
(ignore-errors
(get-buffer-window (or (+eval--ensure-in-repl-buffer)
t))))
(funcall (or (plist-get (cdr (alist-get runner-major-mode +eval-repls)) :send-region)
#'+eval/send-region-to-repl)
beg end))
((let (lang)
(if-let ((runner
(or (alist-get runner-major-mode +eval-runners)
(and (require 'quickrun nil t)
(equal (setq
lang (quickrun--command-key
(buffer-file-name (buffer-base-buffer))))
"emacs")
(alist-get 'emacs-lisp-mode +eval-runners)))))
(funcall runner beg end)
(let ((quickrun-option-cmdkey lang))
(quickrun-region beg end))))))))
;; ;;
;;; Commands ;;; Commands
@ -103,31 +135,7 @@
(defun +eval/region (beg end) (defun +eval/region (beg end)
"Evaluate a region between BEG and END and display the output." "Evaluate a region between BEG and END and display the output."
(interactive "r") (interactive "r")
(let ((load-file-name buffer-file-name) (+eval-region-as-major-mode beg end))
(load-true-file-name
(or buffer-file-truename
(if buffer-file-name
(file-truename buffer-file-name)))))
(cond ((and (fboundp '+eval--ensure-in-repl-buffer)
(ignore-errors
(get-buffer-window (or (+eval--ensure-in-repl-buffer)
t))))
(funcall (or (plist-get (cdr (alist-get major-mode +eval-repls)) :send-region)
#'+eval/send-region-to-repl)
beg end))
((let ((runner
(or (alist-get major-mode +eval-runners)
(and (require 'quickrun nil t)
(equal (setq
lang (quickrun--command-key
(buffer-file-name (buffer-base-buffer))))
"emacs")
(alist-get 'emacs-lisp-mode +eval-runners))))
lang)
(if runner
(funcall runner beg end)
(let ((quickrun-option-cmdkey lang))
(quickrun-region beg end))))))))
;;;###autoload ;;;###autoload
(defun +eval/line-or-region () (defun +eval/line-or-region ()

View file

@ -1,5 +1,5 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; ui/doom/packages.el ;;; ui/doom/packages.el
(package! doom-themes :pin "37d2182f5078d29fb22bbace346e523bb84b2c4e") (package! doom-themes :pin "3b2422b208d28e8734b300cd3cc6a7f4af5eba55")
(package! solaire-mode :pin "8af65fbdc50b25ed3214da949b8a484527c7cc14") (package! solaire-mode :pin "8ccdceeb9298b3c4e35f630914f467bf164f39ad")