dev: merge branch 'master' of github.com:doomemacs
This commit is contained in:
commit
25a4356ba1
15 changed files with 172 additions and 165 deletions
|
@ -62,7 +62,9 @@
|
|||
|
||||
(_ (doom-log "Spell checker not found. Either install `aspell', `hunspell' or `enchant'")))
|
||||
|
||||
(ispell-check-version))
|
||||
(if (executable-find ispell-program-name)
|
||||
(ispell-check-version)
|
||||
(warn "Can't find %s in your $PATH" ispell-program-name)))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -61,8 +61,7 @@
|
|||
:before #'company-begin-backend
|
||||
(company-abort)))
|
||||
|
||||
(add-hook 'after-change-major-mode-hook #'+company-init-backends-h 'append)
|
||||
|
||||
(add-hook 'company-mode-hook #'+company-init-backends-h 'append)
|
||||
|
||||
;; NOTE Fix #1335: ensure `company-emulation-alist' is the first item of
|
||||
;; `emulation-mode-map-alists', thus higher priority than keymaps of
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
(dired-git-info-mode 1)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +dired/dirvish-side-or-follow (&optional arg)
|
||||
(defun +dired/dirvish-side-and-follow (&optional arg)
|
||||
"Open `dirvish-side' then find the currently focused file.
|
||||
|
||||
If dirvish is already open, remotely jump to the file in Dirvish.
|
||||
|
|
|
@ -24,6 +24,11 @@
|
|||
(add-to-list 'doom-debug-variables 'mu4e-debug)
|
||||
;; mu4e now uses `display-buffer-alist' so we need to add some rules of our own
|
||||
(set-popup-rule! "^\\*mu4e-\\(main\\|headers\\)\\*" :ignore t)
|
||||
(set-popup-rule! "^\\*mu4e-log\\*" :select nil)
|
||||
|
||||
;; Treat mu4e main menu buffer as real, so it can be switched to or fallen
|
||||
;; back to when killing other buffers.
|
||||
(add-hook 'mu4e-main-mode-hook #'doom-mark-buffer-as-real-h)
|
||||
|
||||
;; Ensures backward/forward compatibility for mu4e, which is prone to breaking
|
||||
;; updates, and also cannot be pinned, because it's bundled with mu (which you
|
||||
|
|
|
@ -10,7 +10,9 @@ This module adds rudimentary [[https://www.idris-lang.org/][Idris]] support to D
|
|||
*This module needs a maintainer.* [[doom-contrib-maintainer:][Become a maintainer?]]
|
||||
|
||||
** Module flags
|
||||
/This module has no flags./
|
||||
- +lsp ::
|
||||
Enable LSP support for ~idris-mode~. Requires [[doom-module::tools lsp]] and
|
||||
[[https://github.com/idris-community/idris2-lsp][idris2-lsp]].
|
||||
|
||||
** Packages
|
||||
- [[doom-package:idris-mode]]
|
||||
|
@ -25,23 +27,38 @@ This module adds rudimentary [[https://www.idris-lang.org/][Idris]] support to D
|
|||
* TODO Installation
|
||||
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
|
||||
|
||||
For [[doom-module:+lsp]], [[https://github.com/idris-community/idris2-lsp][idris2-lsp]] is required.
|
||||
|
||||
#+begin_quote
|
||||
/No installation steps have been documented./ [[doom-contrib-module:][Document them?]]
|
||||
/No installation steps have been documented./ [[doom-contrib-module:][Document them?]]
|
||||
#+end_quote
|
||||
|
||||
* TODO Usage
|
||||
#+begin_quote
|
||||
/This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
|
||||
/This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
|
||||
#+end_quote
|
||||
|
||||
In addition to ~idris-mode~ goodness, adds frequently used functions under the
|
||||
[[kbd:][<localleader>]] key.
|
||||
In addition to ~idris-mode~ goodness, this module adds frequently used functions
|
||||
under the [[kbd:][<localleader>]] key.
|
||||
|
||||
* TODO Configuration
|
||||
#+begin_quote
|
||||
This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
|
||||
/This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
|
||||
#+end_quote
|
||||
|
||||
** Support for Idris 2
|
||||
While [[doom-package:idris-mode]] was designed for v1 of the IDE-Protocol of Idris,
|
||||
it tries to maintain compatibility with v2. However, not all the features have
|
||||
been realized, so expect a little jank.
|
||||
|
||||
To get this working, simply set [[var:idris-interpreter-path]] to the path of the
|
||||
=idris2= executable. E.g.
|
||||
#+begin_src emacs-lisp
|
||||
;;; add to $DOODMIR/config.el
|
||||
(after! idris-mode
|
||||
(setq idris-interpreter-path "idris2"))
|
||||
#+end_src
|
||||
|
||||
* Troubleshooting
|
||||
/There are no known problems with this module./ [[doom-report:][Report one?]]
|
||||
|
||||
|
@ -50,5 +67,5 @@ In addition to ~idris-mode~ goodness, adds frequently used functions under the
|
|||
|
||||
* TODO Appendix
|
||||
#+begin_quote
|
||||
This module has no appendix yet. [[doom-contrib-module:][Write one?]]
|
||||
This module has no appendix yet. [[doom-contrib-module:][Write one?]]
|
||||
#+end_quote
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
;;; lang/idris/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! idris-mode
|
||||
(add-to-list 'completion-ignored-extensions ".ibc")
|
||||
(add-hook 'idris-mode-hook #'turn-on-idris-simple-indent)
|
||||
(when (modulep! +lsp)
|
||||
(add-hook 'idris-mode-hook #'lsp! 'append))
|
||||
(set-repl-handler! 'idris-mode 'idris-pop-to-repl)
|
||||
(set-popup-rule! "^\\*idris-\\(notes\\|holes\\|info\\)" :select nil :ttl nil)
|
||||
(set-repl-handler! 'idris-mode #'idris-pop-to-repl)
|
||||
(set-lookup-handlers! 'idris-mode
|
||||
:documentation #'idris-docs-at-point)
|
||||
(map! :localleader
|
||||
|
@ -18,3 +20,9 @@
|
|||
"m" #'idris-add-missing
|
||||
"p" #'idris-proof-search
|
||||
"h" #'idris-docs-at-point))
|
||||
|
||||
|
||||
(use-package! flycheck-idris
|
||||
:when (modulep! :checkers syntax)
|
||||
:when (not (modulep! :checkers syntax +flymake))
|
||||
:after idris-mode)
|
||||
|
|
|
@ -85,7 +85,7 @@ Can be a list of backends; accepts any value `company-backends' accepts.")
|
|||
:type-definition #'lsp-find-type-definition)
|
||||
|
||||
;; HACK: See emacs-lsp/lsp-mode#3577
|
||||
(unless (modulep! :lang terraform)
|
||||
(unless (modulep! :tools terraform)
|
||||
(setq lsp-client-packages (delete 'lsp-terraform lsp-client-packages)))
|
||||
|
||||
(defadvice! +lsp--respect-user-defined-checkers-a (fn &rest args)
|
||||
|
|
|
@ -63,6 +63,23 @@ be enabled. If any function returns non-nil, the mode will not be activated."
|
|||
(defun +indent-guides-in-childframe-p ()
|
||||
(frame-parameter nil 'parent-frame)))
|
||||
|
||||
;; HACK: The way `indent-bars-display-on-blank-lines' functions, it places
|
||||
;; text properties with a display property containing a newline, which
|
||||
;; confuses `move-to-column'. This breaks `next-line' and `evil-next-line'
|
||||
;; without this advice (See jdtsmith/indent-bars#22). Advising
|
||||
;; `line-move-to-column' isn't enough for `move-to-column' calls in various
|
||||
;; Evil operators (`evil-delete', `evil-change', etc).
|
||||
(defadvice! +indent-guides--prevent-passing-newline-a (fn col &rest args)
|
||||
:around #'move-to-column
|
||||
(if-let* ((indent-bars-mode)
|
||||
(indent-bars-display-on-blank-lines)
|
||||
(nlp (line-end-position))
|
||||
(dprop (get-text-property nlp 'display))
|
||||
((seq-contains-p dprop ?\n))
|
||||
((> col (- nlp (point)))))
|
||||
(goto-char nlp)
|
||||
(apply fn col args)))
|
||||
|
||||
;; HACK: `indent-bars-mode' interactions with some packages poorly, often
|
||||
;; flooding whole sections of the buffer with indent guides. This section is
|
||||
;; dedicated to fixing interop with those packages.
|
||||
|
|
|
@ -61,6 +61,10 @@ font.")
|
|||
(t))
|
||||
"A alist of ligatures to enable in specific modes.")
|
||||
|
||||
(defvar +ligatures-in-modes nil
|
||||
"List of major modes where ligatures should be enabled.")
|
||||
(make-obsolete-variable '+ligatures-in-modes "Use `ligature-ignored-major-modes' instead" "24.10.0")
|
||||
|
||||
(defvar +ligatures-prog-mode-list nil
|
||||
"A list of ligatures to enable in all `prog-mode' buffers.")
|
||||
(make-obsolete-variable '+ligatures-prog-mode-list "Use `+ligatures-alist' instead" "24.09.0")
|
||||
|
@ -72,15 +76,6 @@ font.")
|
|||
(defvar +ligatures-extra-alist '((t))
|
||||
"A map of major modes to symbol lists (for `prettify-symbols-alist').")
|
||||
|
||||
(defvar +ligatures-in-modes
|
||||
'(not special-mode comint-mode eshell-mode term-mode vterm-mode Info-mode
|
||||
elfeed-search-mode elfeed-show-mode)
|
||||
"List of major modes where ligatures should be enabled.
|
||||
|
||||
If t, enable it everywhere (except `fundamental-mode').
|
||||
If the first element is 'not, enable it in any mode besides what is listed.
|
||||
If nil, don't enable ligatures anywhere.")
|
||||
|
||||
(defvar +ligatures-extras-in-modes t
|
||||
"List of major modes where extra ligatures should be enabled.
|
||||
|
||||
|
@ -89,24 +84,10 @@ Extra ligatures are mode-specific substituions, defined in
|
|||
controls where these are enabled.
|
||||
|
||||
If t, enable it everywhere (except `fundamental-mode').
|
||||
If the first element is 'not, enable it in any mode besides what is listed.
|
||||
If the first element is not, enable it in any mode besides what is listed.
|
||||
If nil, don't enable these extra ligatures anywhere (though it's more
|
||||
efficient to remove the `+extra' flag from the :ui ligatures module instead).")
|
||||
|
||||
(defvar +ligatures--init-font-hook nil)
|
||||
|
||||
(defun +ligatures--correct-symbol-bounds (ligature-alist)
|
||||
"Prepend non-breaking spaces to a ligature.
|
||||
|
||||
This way `compose-region' (called by `prettify-symbols-mode') will use the
|
||||
correct width of the symbols instead of the width measured by `char-width'."
|
||||
(let ((len (length (car ligature-alist)))
|
||||
(acc (list (cdr ligature-alist))))
|
||||
(while (> len 1)
|
||||
(setq acc (cons #X00a0 (cons '(Br . Bl) acc))
|
||||
len (1- len)))
|
||||
(cons (car ligature-alist) acc)))
|
||||
|
||||
(defun +ligatures--enable-p (modes)
|
||||
"Return t if ligatures should be enabled in this buffer depending on MODES."
|
||||
(unless (eq major-mode 'fundamental-mode)
|
||||
|
@ -115,38 +96,24 @@ correct width of the symbols instead of the width measured by `char-width'."
|
|||
(not (apply #'derived-mode-p (cdr modes)))
|
||||
(apply #'derived-mode-p modes)))))
|
||||
|
||||
(defun +ligatures-init-buffer-h ()
|
||||
"Set up ligatures for the current buffer.
|
||||
(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 after-init-time
|
||||
(let ((in-mode-p
|
||||
(+ligatures--enable-p +ligatures-in-modes))
|
||||
(in-mode-extras-p
|
||||
(and (modulep! +extra)
|
||||
(+ligatures--enable-p +ligatures-extras-in-modes))))
|
||||
(when in-mode-p
|
||||
;; If ligature-mode has been installed, there's no
|
||||
;; need to do anything, we activate global-ligature-mode
|
||||
;; later and handle all settings from `set-ligatures!' later.
|
||||
(unless (fboundp #'ligature-mode-turn-on)
|
||||
(run-hooks '+ligatures--init-font-hook)
|
||||
(setq +ligatures--init-font-hook nil)))
|
||||
(when in-mode-extras-p
|
||||
(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 (and (or in-mode-p in-mode-extras-p)
|
||||
prettify-symbols-alist)
|
||||
(when prettify-symbols-mode
|
||||
(prettify-symbols-mode -1))
|
||||
(prettify-symbols-mode +1)))))
|
||||
(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
|
||||
(prettify-symbols-mode -1))
|
||||
(prettify-symbols-mode +1))))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -156,9 +123,8 @@ and cannot run in."
|
|||
;; When you get to the right edge, it goes back to how it normally prints
|
||||
(setq prettify-symbols-unprettify-at-point 'right-edge)
|
||||
|
||||
(add-hook! 'doom-init-ui-hook :append
|
||||
(defun +ligatures-init-h ()
|
||||
(add-hook 'after-change-major-mode-hook #'+ligatures-init-buffer-h)))
|
||||
(when (modulep! +extra)
|
||||
(add-hook 'after-change-major-mode-hook #'+ligatures-init-extra-symbols-h))
|
||||
|
||||
(cond
|
||||
;; The emacs-mac build of Emacs appears to have built-in support for ligatures,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue