dev: merge branch 'master' of github.com:doomemacs
This commit is contained in:
commit
688d69df58
19 changed files with 162 additions and 119 deletions
|
@ -11,6 +11,7 @@
|
|||
company-tooltip-limit 14
|
||||
company-tooltip-align-annotations t
|
||||
company-require-match 'never
|
||||
company-idle-delay 0.26
|
||||
company-global-modes
|
||||
'(not erc-mode
|
||||
circe-mode
|
||||
|
|
|
@ -237,3 +237,27 @@ See minad/consult#770."
|
|||
(defun +vertico-basic-remote-all-completions (string table pred point)
|
||||
(and (vertico--remote-p string)
|
||||
(completion-basic-all-completions string table pred point)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +vertico-orderless-dispatch (pattern _index _total)
|
||||
"Like `orderless-affix-dispatch', but allows affixes to be escaped."
|
||||
(let ((len (length pattern))
|
||||
(alist orderless-affix-dispatch-alist))
|
||||
(when (> len 0)
|
||||
(cond
|
||||
;; Ignore single dispatcher character
|
||||
((and (= len 1) (alist-get (aref pattern 0) alist)) #'ignore)
|
||||
;; Prefix
|
||||
((when-let ((style (alist-get (aref pattern 0) alist))
|
||||
((not (char-equal (aref pattern (max (1- len) 1)) ?\\))))
|
||||
(cons style (substring pattern 1))))
|
||||
;; Suffix
|
||||
((when-let ((style (alist-get (aref pattern (1- len)) alist))
|
||||
((not (char-equal (aref pattern (max 0 (- len 2))) ?\\))))
|
||||
(cons style (substring pattern 0 -1))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +vertico-orderless-disambiguation-dispatch (pattern _index _total)
|
||||
"Ensure $ works with Consult commands, which add disambiguation suffixes."
|
||||
(when (char-equal (aref pattern (1- (length pattern))) ?$)
|
||||
`(orderless-regexp . ,(concat (substring pattern 0 -1) "[\x200000-\x300000]*$"))))
|
||||
|
|
|
@ -81,15 +81,10 @@ orderless."
|
|||
(?` . orderless-initialism)
|
||||
(?= . orderless-literal)
|
||||
(?^ . orderless-literal-prefix)
|
||||
(?~ . orderless-flex)))
|
||||
|
||||
(defun +vertico-orderless-dispatch (pattern _index _total)
|
||||
(cond
|
||||
;; Ensure $ works with Consult commands, which add disambiguation suffixes
|
||||
((string-suffix-p "$" pattern)
|
||||
`(orderless-regexp . ,(concat (substring pattern 0 -1) "[\x200000-\x300000]*$")))))
|
||||
|
||||
(add-to-list 'orderless-style-dispatchers '+vertico-orderless-dispatch)
|
||||
(?~ . orderless-flex))
|
||||
orderless-style-dispatchers
|
||||
'(+vertico-orderless-dispatch
|
||||
+vertico-orderless-disambiguation-dispatch))
|
||||
|
||||
(add-to-list
|
||||
'completion-styles-alist
|
||||
|
@ -134,6 +129,15 @@ orderless."
|
|||
:before (list #'consult-recent-file #'consult-buffer)
|
||||
(recentf-mode +1))
|
||||
|
||||
(defadvice! +vertico--use-evil-registers-a (fn &rest args)
|
||||
"Use `evil-register-list' if `evil-mode' is active."
|
||||
:around #'consult-register--alist
|
||||
(let ((register-alist
|
||||
(if (bound-and-true-p evil-local-mode)
|
||||
(evil-register-list)
|
||||
register-alist)))
|
||||
(apply fn args)))
|
||||
|
||||
(setq consult-project-function #'doom-project-root
|
||||
consult-narrow-key "<"
|
||||
consult-line-numbers-widen t
|
||||
|
|
|
@ -49,7 +49,8 @@
|
|||
'(((memq (bound-and-true-p yas--active-field-overlay)
|
||||
(overlays-in (1- (point)) (1+ (point))))
|
||||
#'yas-next-field-or-maybe-expand)
|
||||
((yas-maybe-expand-abbrev-key-filter 'yas-expand)
|
||||
((and (bound-and-true-p yas-minor-mode)
|
||||
(yas-maybe-expand-abbrev-key-filter 'yas-expand))
|
||||
#'yas-expand)))
|
||||
,@(when (modulep! :completion company +tng)
|
||||
'(((bound-and-true-p company-mode)
|
||||
|
|
|
@ -9,8 +9,16 @@
|
|||
;;; Helpers
|
||||
|
||||
(defun +fold--ensure-hideshow-mode ()
|
||||
(unless (bound-and-true-p hs-minor-mode)
|
||||
(hs-minor-mode +1)))
|
||||
"Enable `hs-minor-mode' if not already enabled.
|
||||
|
||||
Return non-nil if successful in doing so."
|
||||
(if (not (bound-and-true-p hs-minor-mode))
|
||||
;; `hs-grok-mode-type' applies this test; if it fails, it produces an
|
||||
;; error indicating that `hs-minor-mode' is not supported here.
|
||||
(when (and (bound-and-true-p comment-start)
|
||||
(bound-and-true-p comment-end))
|
||||
(hs-minor-mode +1))
|
||||
t))
|
||||
|
||||
(defun +fold--vimish-fold-p ()
|
||||
(and (featurep 'vimish-fold)
|
||||
|
@ -23,14 +31,14 @@
|
|||
(outline-on-heading-p)))
|
||||
|
||||
(defun +fold--hideshow-fold-p ()
|
||||
(+fold--ensure-hideshow-mode)
|
||||
(save-excursion
|
||||
(ignore-errors
|
||||
(or (hs-looking-at-block-start-p)
|
||||
(hs-find-block-beginning)
|
||||
(unless (eolp)
|
||||
(end-of-line)
|
||||
(+fold--hideshow-fold-p))))))
|
||||
(when (+fold--ensure-hideshow-mode)
|
||||
(save-excursion
|
||||
(ignore-errors
|
||||
(or (hs-looking-at-block-start-p)
|
||||
(hs-find-block-beginning)
|
||||
(unless (eolp)
|
||||
(end-of-line)
|
||||
(+fold--hideshow-fold-p)))))))
|
||||
|
||||
;; NOTE: does this need more?
|
||||
(defun +fold--ts-fold-p ()
|
||||
|
@ -186,13 +194,13 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
|||
((and (featurep 'vimish-fold) (+fold--vimish-fold-p))
|
||||
(vimish-fold-unfold-all))
|
||||
((save-excursion
|
||||
(+fold--ensure-hideshow-mode)
|
||||
(when (+fold--ensure-hideshow-mode)
|
||||
(hs-life-goes-on
|
||||
(if (integerp level)
|
||||
(hs-hide-level-recursive level (point-min) (point-max))
|
||||
(hs-show-all))))
|
||||
(if (integerp level)
|
||||
(progn
|
||||
(outline-hide-sublevels (max 1 level))
|
||||
(hs-life-goes-on
|
||||
(hs-hide-level-recursive level (point-min) (point-max))))
|
||||
(hs-show-all)
|
||||
(outline-hide-sublevels (max 1 level))
|
||||
(when (fboundp 'outline-show-all)
|
||||
(outline-show-all)))))))
|
||||
|
||||
|
@ -207,15 +215,15 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
|||
(progn
|
||||
(when (featurep 'vimish-fold)
|
||||
(vimish-fold-refold-all))
|
||||
(+fold--ensure-hideshow-mode)
|
||||
(hs-life-goes-on
|
||||
(if (integerp level)
|
||||
(progn
|
||||
(outline--show-headings-up-to-level level)
|
||||
(hs-hide-level-recursive level (point-min) (point-max)))
|
||||
(hs-hide-all)
|
||||
(when (fboundp 'outline-hide-sublevels)
|
||||
(outline-show-only-headings))))))))
|
||||
(when (+fold--ensure-hideshow-mode)
|
||||
(hs-life-goes-on
|
||||
(if (integerp level)
|
||||
(hs-hide-level-recursive level (point-min) (point-max))
|
||||
(hs-hide-all))))
|
||||
(if (integerp level)
|
||||
(outline--show-headings-up-to-level level)
|
||||
(when (fboundp 'outline-hide-sublevels)
|
||||
(outline-show-only-headings)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +fold/next (count)
|
||||
|
|
|
@ -56,8 +56,7 @@ this."
|
|||
(defadvice! +fold--hideshow-ensure-mode-a (&rest _)
|
||||
"Ensure `hs-minor-mode' is enabled when we need it, no sooner or later."
|
||||
:before '(hs-toggle-hiding hs-hide-block hs-hide-level hs-show-all hs-hide-all)
|
||||
(unless (bound-and-true-p hs-minor-mode)
|
||||
(hs-minor-mode +1)))
|
||||
(+fold--ensure-hideshow-mode))
|
||||
|
||||
;; extra folding support for more languages
|
||||
(unless (assq 't hs-special-modes-alist)
|
||||
|
|
|
@ -281,8 +281,6 @@ attach a file, or select a folder to open dired in and select file attachments
|
|||
When otherwise called, open a dired buffer and enable `dired-mu4e-attach-ctrl-c-ctrl-c'."
|
||||
;; TODO add ability to attach files (+dirs) as a single (named) archive
|
||||
(interactive "p")
|
||||
(when (fboundp '+mu4e-compose-org-msg-handle-toggle)
|
||||
(+mu4e-compose-org-msg-handle-toggle (/= 1 files-to-attach)))
|
||||
(pcase major-mode
|
||||
((or 'mu4e-compose-mode 'org-msg-edit-mode)
|
||||
(let ((mail-buffer (current-buffer))
|
||||
|
|
|
@ -441,21 +441,18 @@ This should already be the case yet it does not always seem to be."
|
|||
(let ((files (org-msg-get-prop "attachment")))
|
||||
(org-msg-set-prop "attachment" (nconc files (list file)))))
|
||||
|
||||
(defvar +mu4e-compose-org-msg-toggle-next t ; t to initialise org-msg
|
||||
"Whether to toggle `org-msg-toggle' on ")
|
||||
(defun +mu4e-compose-org-msg-handle-toggle (toggle-p)
|
||||
(when (xor toggle-p +mu4e-compose-org-msg-toggle-next)
|
||||
(org-msg-mode (if org-msg-mode -1 1))
|
||||
(setq +mu4e-compose-org-msg-toggle-next
|
||||
(not +mu4e-compose-org-msg-toggle-next))))
|
||||
|
||||
;; HACK: ...
|
||||
;; HACK: Toggle `org-msg' where sensible.
|
||||
(defvar +mu4e--compose-org-msg-toggle-next t)
|
||||
(defadvice! +mu4e-maybe-toggle-org-msg-a (&rest _)
|
||||
:before #'+mu4e/attach-files
|
||||
:before #'mu4e-compose-new
|
||||
:before #'mu4e-compose-reply
|
||||
:before #'mu4e-compose-forward
|
||||
:before #'mu4e-compose-resend
|
||||
(+mu4e-compose-org-msg-handle-toggle (/= 1 (or current-prefix-arg 0))))
|
||||
(when (xor (/= 1 (if (integerp current-prefix-arg) current-prefix-arg 0))
|
||||
+mu4e-compose-org-msg-toggle-next)
|
||||
(org-msg-mode (if org-msg-mode -1 1))
|
||||
(cl-callf not +mu4e-compose-org-msg-toggle-next)))
|
||||
|
||||
;; HACK: ...
|
||||
(defadvice! +mu4e-draft-open-signature-a (fn &rest args)
|
||||
|
|
|
@ -117,8 +117,9 @@ if it's callable, `apropos' otherwise."
|
|||
(org-show-hidden-entry))))
|
||||
'deferred))
|
||||
(thing
|
||||
(funcall (or (command-remapping #'describe-symbol)
|
||||
#'describe-symbol)
|
||||
(funcall (if (fboundp #'helpful-symbol)
|
||||
#'helpful-symbol
|
||||
#'describe-symbol)
|
||||
(intern thing)))
|
||||
((call-interactively
|
||||
(if (fboundp #'helpful-at-point)
|
||||
|
|
|
@ -273,7 +273,7 @@ See `+emacs-lisp-non-package-mode' for details.")
|
|||
(global-set-key [remap describe-command] #'helpful-command)
|
||||
(global-set-key [remap describe-variable] #'helpful-variable)
|
||||
(global-set-key [remap describe-key] #'helpful-key)
|
||||
(global-set-key [remap describe-symbol] #'helpful-symbol)
|
||||
;; (global-set-key [remap describe-symbol] #'helpful-symbol)
|
||||
|
||||
(defun doom-use-helpful-a (fn &rest args)
|
||||
"Force FN to use helpful instead of the old describe-* commands."
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
(when (and (modulep! :checker syntax)
|
||||
(not (modulep! :checker syntax +flymake)))
|
||||
(after! flycheck
|
||||
(flycheck-define-checker graphviz-dot
|
||||
"A checker using graphviz dot."
|
||||
:command ("dot")
|
||||
:standard-input t
|
||||
:error-patterns ((error line-start "Error: <stdin>: " (message "syntax error in line " line (* nonl)))
|
||||
;; I have no idea if this can actually be printed
|
||||
(error line-start "Error: <stdin>: " (message)))
|
||||
:modes graphviz-dot-mode)
|
||||
(eval '(flycheck-define-checker graphviz-dot
|
||||
"A checker using graphviz dot."
|
||||
:command ("dot")
|
||||
:standard-input t
|
||||
:error-patterns ((error line-start "Error: <stdin>: " (message "syntax error in line " line (* nonl)))
|
||||
;; I have no idea if this can actually be printed
|
||||
(error line-start "Error: <stdin>: " (message)))
|
||||
:modes graphviz-dot-mode))
|
||||
(add-to-list 'flycheck-checkers 'graphviz-dot)))
|
||||
|
||||
(map! :map graphviz-dot-mode-map
|
||||
|
|
|
@ -42,9 +42,6 @@
|
|||
|
||||
(setq rustic-indent-method-chain t)
|
||||
|
||||
;; Conflicts with (and is redundant with) :ui ligatures
|
||||
(setq rust-prettify-symbols-alist nil)
|
||||
|
||||
;; Leave automatic reformatting to the :editor format module.
|
||||
(setq rustic-babel-format-src-block nil
|
||||
rustic-format-trigger nil)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
;;; tools/editorconfig/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; TODO: Adapt to built-in `editorconfig' in Emacs 30+
|
||||
;; Handles whitespace (tabs/spaces) settings externally. This way projects can
|
||||
;; specify their own formatting rules.
|
||||
(use-package! editorconfig
|
||||
|
|
|
@ -18,15 +18,17 @@ pretty symbols and ligatures previously defined for MODES.
|
|||
|
||||
For example, the rule for emacs-lisp-mode is very simple:
|
||||
|
||||
(set-ligatures! \\='emacs-lisp-mode
|
||||
:lambda \"lambda\")
|
||||
(after! elisp-mode
|
||||
(set-ligatures! \\='emacs-lisp-mode
|
||||
:lambda \"lambda\"))
|
||||
|
||||
This will replace any instances of \"lambda\" in emacs-lisp-mode with the symbol
|
||||
associated with :lambda in `+ligatures-extra-symbols'.
|
||||
|
||||
Pretty symbols can be unset for emacs-lisp-mode with:
|
||||
Pretty symbols can be unset by passing `nil':
|
||||
|
||||
(set-ligatures! \\='emacs-lisp-mode nil)
|
||||
(after! rustic
|
||||
(set-ligatures! \\='rustic-mode nil))
|
||||
|
||||
Note that this will keep all ligatures in `+ligatures-prog-mode-list' active, as
|
||||
`emacs-lisp-mode' is derived from `prog-mode'."
|
||||
|
|
|
@ -59,7 +59,9 @@ font.")
|
|||
"?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
|
||||
"\\\\" "://")
|
||||
(t))
|
||||
"A alist of ligatures to enable in specific modes.")
|
||||
"A alist of ligatures to enable in specific modes.
|
||||
|
||||
To configure this variable, use `set-ligatures!'.")
|
||||
|
||||
(defvar +ligatures-in-modes nil
|
||||
"List of major modes where ligatures should be enabled.")
|
||||
|
@ -74,7 +76,9 @@ font.")
|
|||
(make-obsolete-variable '+ligatures-all-modes-list "Use `+ligatures-alist' instead" "24.09.0")
|
||||
|
||||
(defvar +ligatures-extra-alist '((t))
|
||||
"A map of major modes to symbol lists (for `prettify-symbols-alist').")
|
||||
"A map of major modes to symbol lists (for `prettify-symbols-alist').
|
||||
|
||||
To configure this variable, use `set-ligatures!'.")
|
||||
|
||||
(defvar +ligatures-extras-in-modes t
|
||||
"List of major modes where extra ligatures should be enabled.
|
||||
|
@ -99,19 +103,24 @@ efficient to remove the `+extra' flag from the :ui ligatures module instead).")
|
|||
(defun +ligatures-init-extra-symbols-h ()
|
||||
"Set up `prettify-symbols-mode' for the current buffer.
|
||||
|
||||
Extra ligatures are mode-specific substituions, defined in
|
||||
`+ligatures-extra-symbols', assigned with `set-ligatures!', and made possible
|
||||
with `prettify-symbols-mode'. This variable controls where these are enabled.
|
||||
See `+ligatures-extras-in-modes' to control what major modes this function can
|
||||
and cannot run in."
|
||||
(when (and after-init-time (+ligatures--enable-p +ligatures-extras-in-modes))
|
||||
(prependq! prettify-symbols-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 prettify-symbols-alist
|
||||
(when prettify-symbols-mode
|
||||
Overwrites `prettify-symbols-alist' and activates `prettify-symbols-mode' if
|
||||
(and only if) there is an associated entry for the current major mode (or a
|
||||
parent mode) in `+ligatures-extra-alist' AND the current mode (or a parent mode)
|
||||
isn't disabled in `+ligatures-extras-in-modes'."
|
||||
(when after-init-time
|
||||
(when-let*
|
||||
(((+ligatures--enable-p +ligatures-extras-in-modes))
|
||||
(symbols
|
||||
(if-let ((symbols (assq major-mode +ligatures-extra-alist)))
|
||||
(cdr symbols)
|
||||
(cl-loop for (mode . symbols) in +ligatures-extra-alist
|
||||
if (derived-mode-p mode)
|
||||
return symbols))))
|
||||
(setq prettify-symbols-alist
|
||||
(append symbols
|
||||
;; Don't overwrite global defaults
|
||||
(default-value 'prettify-symbols-alist)))
|
||||
(when (bound-and-true-p prettify-symbols-mode)
|
||||
(prettify-symbols-mode -1))
|
||||
(prettify-symbols-mode +1))))
|
||||
|
||||
|
@ -124,11 +133,6 @@ and cannot run in."
|
|||
(setq prettify-symbols-unprettify-at-point 'right-edge)
|
||||
|
||||
(when (modulep! +extra)
|
||||
;; Lisp modes offer their own defaults for `prettify-symbols-mode' (just a
|
||||
;; lambda symbol substitution), but this might be unexpected if the user
|
||||
;; enables +extra but has unset `+ligatures-extra-symbols'.
|
||||
(setq lisp-prettify-symbols-alist nil)
|
||||
|
||||
(add-hook 'after-change-major-mode-hook #'+ligatures-init-extra-symbols-h))
|
||||
|
||||
(cond
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue