Merge branch 'develop' into add-keymap-description-for-ruby
This commit is contained in:
commit
896cefb579
87 changed files with 2183 additions and 1611 deletions
|
@ -1,7 +1,7 @@
|
|||
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||
;;; lang/csharp/doctor.el
|
||||
|
||||
(require 'omnisharp)
|
||||
(let ((omnisharp-bin (or omnisharp-server-executable-path (omnisharp--server-installation-path t))))
|
||||
(unless (file-exists-p omnisharp-bin)
|
||||
(warn! "Omnisharp server isn't installed, completion won't work")))
|
||||
(when (and (require 'omnisharp nil t) (not (featurep! +lsp)))
|
||||
(let ((omnisharp-bin (or omnisharp-server-executable-path (omnisharp--server-installation-path t))))
|
||||
(unless (file-exists-p omnisharp-bin)
|
||||
(warn! "Omnisharp server isn't installed, completion won't work"))))
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
* Description
|
||||
This module provides support for [[https://elixir-lang.org/][Elixir programming language]] via [[https://github.com/tonini/alchemist.el][alchemist.el]]
|
||||
or [[https://github.com/JakeBecker/elixir-ls/][elixir-ls]].
|
||||
or [[https://github.com/elixir-lsp/elixir-ls/][elixir-ls]].
|
||||
|
||||
** Module flags
|
||||
+ ~+lsp~ Enable LSP support. Requires [[https://github.com/JakeBecker/elixir-ls/][elixir-ls]].
|
||||
+ ~+lsp~ Enable LSP support. Requires [[https://github.com/elixir-lsp/elixir-ls/][elixir-ls]].
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/elixir-editors/emacs-elixir][elixir-mode]]
|
||||
|
|
|
@ -67,6 +67,9 @@ library/userland functions"
|
|||
(byte-compile #'+emacs-lisp-highlight-vars-and-faces)))
|
||||
|
||||
|
||||
;;
|
||||
;;; Handlers
|
||||
|
||||
(defun +emacs-lisp--module-at-point ()
|
||||
(let ((origin (point)))
|
||||
(save-excursion
|
||||
|
@ -126,11 +129,52 @@ if it's callable, `apropos' otherwise."
|
|||
(thing (helpful-symbol (intern thing)))
|
||||
((call-interactively #'helpful-at-point))))
|
||||
|
||||
;; FIXME
|
||||
;; (defun +emacs-lisp-lookup-file (thing)
|
||||
;; (when-let (module (+emacs-lisp--module-at-point thing))
|
||||
;; (doom/help-modules (car module) (cadr module) 'visit-dir)
|
||||
;; t))
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp-indent-function (indent-point state)
|
||||
"A replacement for `lisp-indent-function'.
|
||||
|
||||
Indents plists more sensibly. Adapted from
|
||||
https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
|
||||
(let ((normal-indent (current-column))
|
||||
(orig-point (point))
|
||||
;; TODO Refactor `target' usage (ew!)
|
||||
target)
|
||||
(goto-char (1+ (elt state 1)))
|
||||
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
|
||||
(cond ((and (elt state 2)
|
||||
(or (not (looking-at-p "\\sw\\|\\s_"))
|
||||
(eq (char-after) ?:)))
|
||||
(unless (> (save-excursion (forward-line 1) (point))
|
||||
calculate-lisp-indent-last-sexp)
|
||||
(goto-char calculate-lisp-indent-last-sexp)
|
||||
(beginning-of-line)
|
||||
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t))
|
||||
(backward-prefix-chars)
|
||||
(current-column))
|
||||
((and (save-excursion
|
||||
(goto-char indent-point)
|
||||
(skip-syntax-forward " ")
|
||||
(not (eq (char-after) ?:)))
|
||||
(save-excursion
|
||||
(goto-char orig-point)
|
||||
(and (eq (char-after) ?:)
|
||||
(eq (char-before) ?\()
|
||||
(setq target (current-column)))))
|
||||
(save-excursion
|
||||
(move-to-column target t)
|
||||
target))
|
||||
((let* ((function (buffer-substring (point) (progn (forward-sexp 1) (point))))
|
||||
(method (or (function-get (intern-soft function) 'lisp-indent-function)
|
||||
(get (intern-soft function) 'lisp-indent-hook))))
|
||||
(cond ((or (eq method 'defun)
|
||||
(and (null method)
|
||||
(> (length function) 3)
|
||||
(string-match-p "\\`def" function)))
|
||||
(lisp-indent-defform state indent-point))
|
||||
((integerp method)
|
||||
(lisp-indent-specform method state indent-point normal-indent))
|
||||
(method
|
||||
(funcall method indent-point state))))))))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -170,6 +214,18 @@ if it's callable, `apropos' otherwise."
|
|||
load-path)))
|
||||
(buttercup-run-discover)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/edebug-instrument-defun-on ()
|
||||
"Toggle on instrumentalisation for the function under `defun'."
|
||||
(interactive)
|
||||
(eval-defun 'edebugit))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/edebug-instrument-defun-off ()
|
||||
"Toggle off instrumentalisation for the function under `defun'."
|
||||
(interactive)
|
||||
(eval-defun nil))
|
||||
|
||||
|
||||
;;
|
||||
;;; Hooks
|
||||
|
@ -234,62 +290,3 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
|
|||
(when (and start finish)
|
||||
(put-text-property start finish 'display "...")))))
|
||||
nil)
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp-indent-function (indent-point state)
|
||||
"A replacement for `lisp-indent-function'.
|
||||
|
||||
Indents plists more sensibly. Adapted from
|
||||
https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
|
||||
(let ((normal-indent (current-column))
|
||||
(orig-point (point))
|
||||
;; TODO Refactor `target' usage (ew!)
|
||||
target)
|
||||
(goto-char (1+ (elt state 1)))
|
||||
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
|
||||
(cond ((and (elt state 2)
|
||||
(or (not (looking-at-p "\\sw\\|\\s_"))
|
||||
(eq (char-after) ?:)))
|
||||
(unless (> (save-excursion (forward-line 1) (point))
|
||||
calculate-lisp-indent-last-sexp)
|
||||
(goto-char calculate-lisp-indent-last-sexp)
|
||||
(beginning-of-line)
|
||||
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t))
|
||||
(backward-prefix-chars)
|
||||
(current-column))
|
||||
((and (save-excursion
|
||||
(goto-char indent-point)
|
||||
(skip-syntax-forward " ")
|
||||
(not (eq (char-after) ?:)))
|
||||
(save-excursion
|
||||
(goto-char orig-point)
|
||||
(and (eq (char-after) ?:)
|
||||
(eq (char-before) ?\()
|
||||
(setq target (current-column)))))
|
||||
(save-excursion
|
||||
(move-to-column target t)
|
||||
target))
|
||||
((let* ((function (buffer-substring (point) (progn (forward-sexp 1) (point))))
|
||||
(method (or (function-get (intern-soft function) 'lisp-indent-function)
|
||||
(get (intern-soft function) 'lisp-indent-hook))))
|
||||
(cond ((or (eq method 'defun)
|
||||
(and (null method)
|
||||
(> (length function) 3)
|
||||
(string-match-p "\\`def" function)))
|
||||
(lisp-indent-defform state indent-point))
|
||||
((integerp method)
|
||||
(lisp-indent-specform method state indent-point normal-indent))
|
||||
(method
|
||||
(funcall method indent-point state))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/edebug-instrument-defun-on ()
|
||||
"Toggle on instrumentalisation for the function under `defun'."
|
||||
(interactive)
|
||||
(eval-defun 'edebugit))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/edebug-instrument-defun-off ()
|
||||
"Toggle off instrumentalisation for the function under `defun'."
|
||||
(interactive)
|
||||
(eval-defun nil))
|
||||
|
|
|
@ -3,15 +3,16 @@
|
|||
|
||||
(package! elisp-mode :built-in t)
|
||||
|
||||
(package! highlight-quoted :pin "2410347815")
|
||||
;; Fontification plugins
|
||||
(package! highlight-quoted :pin "24103478158cd19fbcfb4339a3f1fa1f054f1469")
|
||||
|
||||
;; Tools
|
||||
(package! macrostep :pin "424e3734a1")
|
||||
(package! overseer :pin "02d49f582e")
|
||||
(package! elisp-def :pin "368b04da68")
|
||||
(package! elisp-demos :pin "57dd4ae3e4")
|
||||
(package! macrostep :pin "424e3734a1ee526a1bd7b5c3cd1d3ef19d184267")
|
||||
(package! overseer :pin "02d49f582e80e36b4334c9187801c5ecfb027789")
|
||||
(package! elisp-def :pin "368b04da68783601b52e3169312183381871cf9e")
|
||||
(package! elisp-demos :pin "4cd55a30d5dbd8d36a0e6f87261c4fef17fc6db0")
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-cask :pin "3457ae553c"))
|
||||
(package! flycheck-cask :pin "3457ae553c4feaf8168008f063d78fdde8fb5f94"))
|
||||
|
||||
;; Libraries
|
||||
(package! buttercup :pin "a91f282025")
|
||||
(package! buttercup :pin "532d082a363add4f6d9838ca3f924a773ce12136")
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/go/packages.el
|
||||
|
||||
(package! go-eldoc :pin "cbbd2ea1e9")
|
||||
(package! go-guru :pin "10d6ab43d9")
|
||||
(package! go-mode :pin "10d6ab43d9")
|
||||
(package! gorepl-mode :pin "6a73bf352e")
|
||||
(package! go-tag :pin "59b243f2fa")
|
||||
(package! go-gen-test :pin "44c202ac97")
|
||||
(package! go-eldoc :pin "cbbd2ea1e94a36004432a9ac61414cb5a95a39bd")
|
||||
(package! go-guru :pin "734d5232455ffde088021ea5908849ac570e890f")
|
||||
(package! go-mode :pin "734d5232455ffde088021ea5908849ac570e890f")
|
||||
(package! gorepl-mode :pin "6a73bf352e8d893f89cad36c958c4db2b5e35e07")
|
||||
(package! go-tag :pin "59b243f2fa079d9de9d56f6e2d94397e9560310a")
|
||||
(package! go-gen-test :pin "44c202ac97e728e93a35cee028a0ea8dd6e4292c")
|
||||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-go :pin "4acdcbdea7"))
|
||||
(package! company-go :pin "4acdcbdea79de6b3dee1c637eca5cbea0fdbe37c"))
|
||||
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-golangci-lint :pin "8e446c6831"))
|
||||
(package! flycheck-golangci-lint :pin "8e446c68311048f0b87febf8ef0379e29d358851"))
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
(map! :map haskell-mode-map
|
||||
:n "o" #'+haskell/evil-open-below
|
||||
:n "O" #'+haskell/evil-open-above)
|
||||
:n "O" #'+haskell/evil-open-above
|
||||
(:when (featurep! :tools lookup)
|
||||
[remap haskell-mode-jump-to-def-or-tag] #'+lookup/definition))
|
||||
|
||||
(map! :localleader
|
||||
:map haskell-mode-map
|
||||
|
|
|
@ -92,10 +92,6 @@ capture, the end position, and the output buffer.")
|
|||
(use-package! evil-markdown
|
||||
:when (featurep! :editor evil +everywhere)
|
||||
:hook (markdown-mode . evil-markdown-mode)
|
||||
:init
|
||||
;; REVIEW Until Somelauw/evil-markdown#1 is resolved:
|
||||
(defun evil-disable-insert-state-bindings ()
|
||||
evil-disable-insert-state-bindings)
|
||||
:config
|
||||
(add-hook 'evil-markdown-mode-hook #'evil-normalize-keymaps)
|
||||
(map! :map evil-markdown-mode-map
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/markdown/packages.el
|
||||
|
||||
(package! markdown-mode :pin "c927a114b1b23cf7538181d62fd14679cce7fa25")
|
||||
(package! markdown-toc :pin "eda9650a1bf0015e52e9678bd92b0a8beb1d7d71")
|
||||
(package! markdown-mode :pin "f47a2e9796dfdde6fae7920af23647fe027dc34e")
|
||||
(package! markdown-toc :pin "a9f13eecd0c7d8be960055dbc2d6f5d3fe6f40ca")
|
||||
(package! edit-indirect :pin "935ded353b9ed3da67bc61abf245c21b58d88864")
|
||||
|
||||
(when (featurep! +grip)
|
||||
|
@ -11,4 +11,4 @@
|
|||
(when (featurep! :editor evil +everywhere)
|
||||
(package! evil-markdown
|
||||
:recipe (:host github :repo "Somelauw/evil-markdown")
|
||||
:pin "46cd81b37991c4325fc24015a610f832b0ff995d"))
|
||||
:pin "685d7fbb81bc02fa32779d2a127b99a0c8c7436b"))
|
||||
|
|
|
@ -46,11 +46,15 @@ exist, and `org-link' otherwise."
|
|||
"Intepret LINK as an image file path and return its data."
|
||||
(setq
|
||||
link (expand-file-name
|
||||
link
|
||||
(pcase protocol
|
||||
("download" (or org-download-image-dir org-attach-id-dir default-directory))
|
||||
("attachment" org-attach-id-dir)
|
||||
(_ default-directory))))
|
||||
link (pcase protocol
|
||||
("download"
|
||||
(or (if (require 'org-download nil t) org-download-image-dir)
|
||||
(if (require 'org-attach) org-attach-id-dir)
|
||||
default-directory))
|
||||
("attachment"
|
||||
(require 'org-attach)
|
||||
org-attach-id-dir)
|
||||
(_ default-directory))))
|
||||
(when (and (file-exists-p link)
|
||||
(image-type-from-file-name link))
|
||||
(with-temp-buffer
|
||||
|
|
|
@ -141,7 +141,7 @@ current file). Only scans first 2048 bytes of the document."
|
|||
;;; Commands
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/dwim-at-point ()
|
||||
(defun +org/dwim-at-point (&optional arg)
|
||||
"Do-what-I-mean at point.
|
||||
|
||||
If on a:
|
||||
|
@ -158,7 +158,7 @@ If on a:
|
|||
- latex fragment: toggle it.
|
||||
- link: follow it
|
||||
- otherwise, refresh all inline images in current tree."
|
||||
(interactive)
|
||||
(interactive "P")
|
||||
(let* ((context (org-element-context))
|
||||
(type (org-element-type context)))
|
||||
;; skip over unimportant contexts
|
||||
|
@ -206,7 +206,7 @@ If on a:
|
|||
|
||||
(`table-cell
|
||||
(org-table-blank-field)
|
||||
(org-table-recalculate)
|
||||
(org-table-recalculate arg)
|
||||
(when (and (string-empty-p (string-trim (org-table-get-field)))
|
||||
(bound-and-true-p evil-local-mode))
|
||||
(evil-change-state 'insert)))
|
||||
|
@ -215,13 +215,13 @@ If on a:
|
|||
(org-babel-lob-execute-maybe))
|
||||
|
||||
(`statistics-cookie
|
||||
(save-excursion (org-update-statistics-cookies nil)))
|
||||
(save-excursion (org-update-statistics-cookies arg)))
|
||||
|
||||
((or `src-block `inline-src-block)
|
||||
(org-babel-execute-src-block))
|
||||
(org-babel-execute-src-block arg))
|
||||
|
||||
((or `latex-fragment `latex-environment)
|
||||
(org-latex-preview))
|
||||
(org-latex-preview arg))
|
||||
|
||||
(`link
|
||||
(let* ((lineage (org-element-lineage context '(link) t))
|
||||
|
@ -229,7 +229,7 @@ If on a:
|
|||
(if (or (equal (org-element-property :type lineage) "img")
|
||||
(and path (image-type-from-file-name path)))
|
||||
(+org--refresh-inline-images-in-subtree)
|
||||
(org-open-at-point))))
|
||||
(org-open-at-point arg))))
|
||||
|
||||
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
|
||||
(let ((match (and (org-at-item-checkbox-p) (match-string 1))))
|
||||
|
@ -238,7 +238,7 @@ If on a:
|
|||
(_
|
||||
(if (or (org-in-regexp org-ts-regexp-both nil t)
|
||||
(org-in-regexp org-tsr-regexp-both nil t)
|
||||
(org-in-regexp org-any-link-re nil t))
|
||||
(org-in-regexp org-link-any-re nil t))
|
||||
(call-interactively #'org-open-at-point)
|
||||
(+org--refresh-inline-images-in-subtree))))))
|
||||
|
||||
|
@ -306,6 +306,20 @@ the prefix ARG changes this command's behavior."
|
|||
;;;###autoload
|
||||
(defalias #'+org/close-fold #'outline-hide-subtree)
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/close-all-folds (&optional level)
|
||||
"Close all folds in the buffer (or below LEVEL)."
|
||||
(interactive "p")
|
||||
(outline-hide-sublevels (or level 1)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/open-all-folds (&optional level)
|
||||
"Open all folds in the buffer (or up to LEVEL)."
|
||||
(interactive "P")
|
||||
(if (integerp level)
|
||||
(outline-hide-sublevels level)
|
||||
(outline-show-all)))
|
||||
|
||||
(defun +org--get-foldlevel ()
|
||||
(let ((max 1))
|
||||
(save-restriction
|
||||
|
@ -321,22 +335,20 @@ the prefix ARG changes this command's behavior."
|
|||
max)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/show-next-fold-level ()
|
||||
(defun +org/show-next-fold-level (&optional count)
|
||||
"Decrease the fold-level of the visible area of the buffer. This unfolds
|
||||
another level of headings on each invocation."
|
||||
(interactive)
|
||||
(let* ((current-level (+org--get-foldlevel))
|
||||
(new-level (1+ current-level)))
|
||||
(interactive "p")
|
||||
(let ((new-level (+ (+org--get-foldlevel) (or count 1))))
|
||||
(outline-hide-sublevels new-level)
|
||||
(message "Folded to level %s" new-level)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/hide-next-fold-level ()
|
||||
(defun +org/hide-next-fold-level (&optional count)
|
||||
"Increase the global fold-level of the visible area of the buffer. This folds
|
||||
another level of headings on each invocation."
|
||||
(interactive)
|
||||
(let* ((current-level (+org--get-foldlevel))
|
||||
(new-level (max 1 (1- current-level))))
|
||||
(interactive "p")
|
||||
(let ((new-level (max 1 (- (+org--get-foldlevel) (or count 1)))))
|
||||
(outline-hide-sublevels new-level)
|
||||
(message "Folded to level %s" new-level)))
|
||||
|
||||
|
@ -434,20 +446,14 @@ with `org-cycle')."
|
|||
t))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-unfold-to-2nd-level-or-point-h ()
|
||||
"Alters '#+STARTUP overview' to only expand first-level headings.
|
||||
Expands the first level, but no further. If a different startup option was
|
||||
provided, do that instead."
|
||||
(unless org-agenda-inhibit-startup
|
||||
;; TODO Implement a custom #+STARTUP option?
|
||||
(when (eq org-startup-folded t)
|
||||
(outline-hide-sublevels +org-initial-fold-level))
|
||||
;; If point was left somewhere deeper, unfold to point on startup.
|
||||
(when (outline-invisible-p)
|
||||
(ignore-errors
|
||||
(save-excursion
|
||||
(outline-previous-visible-heading 1)
|
||||
(org-show-subtree))))))
|
||||
(defun +org-make-last-point-visible-h ()
|
||||
"Unfold subtree around point if saveplace places it to a folded region."
|
||||
(and (not org-agenda-inhibit-startup)
|
||||
(outline-invisible-p)
|
||||
(ignore-errors
|
||||
(save-excursion
|
||||
(outline-previous-visible-heading 1)
|
||||
(org-show-subtree)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-remove-occur-highlights-h ()
|
||||
|
|
|
@ -50,9 +50,6 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
|
|||
(defvar +org-capture-projects-file "projects.org"
|
||||
"Default, centralized target for org-capture templates.")
|
||||
|
||||
(defvar +org-initial-fold-level 2
|
||||
"The initial fold level of org files when no #+STARTUP options for it.")
|
||||
|
||||
(defvar +org-habit-graph-padding 2
|
||||
"The padding added to the end of the consistency graph")
|
||||
|
||||
|
@ -163,7 +160,7 @@ This forces it to read the background before rendering."
|
|||
("HOLD" . +org-todo-onhold)
|
||||
("PROJ" . +org-todo-project)))
|
||||
|
||||
(defadvice! +org-display-link-in-eldoc-a (&rest args)
|
||||
(defadvice! +org-display-link-in-eldoc-a (&rest _)
|
||||
"Display full link in minibuffer when cursor/mouse is over it."
|
||||
:before-until #'org-eldoc-documentation-function
|
||||
(when-let (link (org-element-property :raw-link (org-element-context)))
|
||||
|
@ -199,10 +196,10 @@ This forces it to read the background before rendering."
|
|||
;; I prefer C-c C-c over C-c ' (more consistent)
|
||||
(define-key org-src-mode-map (kbd "C-c C-c") #'org-edit-src-exit)
|
||||
|
||||
(defadvice! +org-fix-newline-and-indent-in-src-blocks-a ()
|
||||
(defadvice! +org-fix-newline-and-indent-in-src-blocks-a (&optional indent _arg _interactive)
|
||||
"Mimic `newline-and-indent' in src blocks w/ lang-appropriate indentation."
|
||||
:after #'org-return-indent
|
||||
(when (org-in-src-block-p t)
|
||||
:after #'org-return
|
||||
(when (and indent (org-in-src-block-p t))
|
||||
(org-babel-do-in-edit-buffer
|
||||
(call-interactively #'indent-for-tab-command))))
|
||||
|
||||
|
@ -322,11 +319,17 @@ I like:
|
|||
(after! org-capture
|
||||
(org-capture-put :kill-buffer t))
|
||||
|
||||
;; Fix #462: when refiling from org-capture, Emacs prompts to kill the
|
||||
;; underlying, modified buffer. This fixes that.
|
||||
(add-hook 'org-after-refile-insert-hook #'save-buffer)
|
||||
|
||||
;; HACK Doom doesn't support `customize'. Best not to advertise it as an
|
||||
;; option in `org-capture's menu.
|
||||
(defadvice! +org--remove-customize-option-a (orig-fn table title &optional prompt specials)
|
||||
:around #'org-mks
|
||||
(funcall orig-fn table title prompt (remove '("C" "Customize org-capture-templates") specials)))
|
||||
(funcall orig-fn table title prompt
|
||||
(remove '("C" "Customize org-capture-templates")
|
||||
specials)))
|
||||
|
||||
(defadvice! +org--capture-expand-variable-file-a (file)
|
||||
"If a variable is used for a file path in `org-capture-template', it is used
|
||||
|
@ -337,13 +340,6 @@ relative to `org-directory', unless it is an absolute path."
|
|||
(expand-file-name (symbol-value file) org-directory)
|
||||
file))
|
||||
|
||||
(defadvice! +org--prevent-save-prompts-when-refiling-a (&rest _)
|
||||
"Fix #462: when refiling from org-capture, Emacs prompts to kill the
|
||||
underlying, modified buffer. This fixes that."
|
||||
:after #'org-refile
|
||||
(when (bound-and-true-p org-capture-is-refiling)
|
||||
(org-save-all-org-buffers)))
|
||||
|
||||
(add-hook! 'org-capture-mode-hook
|
||||
(defun +org-show-target-in-capture-header-h ()
|
||||
(setq header-line-format
|
||||
|
@ -436,28 +432,39 @@ underlying, modified buffer. This fixes that."
|
|||
(setq org-pandoc-options
|
||||
'((standalone . t)
|
||||
(mathjax . t)
|
||||
(variable . "revealjs-url=https://revealjs.com")))))
|
||||
(variable . "revealjs-url=https://revealjs.com"))))
|
||||
|
||||
(defadvice! +org--fix-async-export-a (orig-fn &rest args)
|
||||
:around #'org-export-to-file
|
||||
(if (not org-export-in-background)
|
||||
(apply orig-fn args)
|
||||
(setq org-export-async-init-file (make-temp-file "doom-org-async-export"))
|
||||
(with-temp-file org-export-async-init-file
|
||||
(prin1 `(progn (setq org-export-async-debug ,debug-on-error
|
||||
load-path ',load-path)
|
||||
(load ,user-init-file nil t))
|
||||
(current-buffer)))
|
||||
(apply orig-fn args))))
|
||||
|
||||
|
||||
(defun +org-init-habit-h ()
|
||||
"TODO"
|
||||
(add-hook! 'org-agenda-mode-hook
|
||||
(defun +org-habit-resize-graph-h ()
|
||||
"Right align and resize the consistency graphs based on
|
||||
`+org-habit-graph-window-ratio'"
|
||||
(require 'org-habit)
|
||||
(let* ((total-days (float (+ org-habit-preceding-days org-habit-following-days)))
|
||||
(preceding-days-ratio (/ org-habit-preceding-days total-days))
|
||||
(graph-width (floor (* (window-width) +org-habit-graph-window-ratio)))
|
||||
(preceding-days (floor (* graph-width preceding-days-ratio)))
|
||||
(following-days (- graph-width preceding-days))
|
||||
(graph-column (- (window-width) (+ preceding-days following-days)))
|
||||
(graph-column-adjusted (if (> graph-column +org-habit-min-width)
|
||||
(- graph-column +org-habit-graph-padding)
|
||||
nil)))
|
||||
(setq-local org-habit-preceding-days preceding-days)
|
||||
(setq-local org-habit-following-days following-days)
|
||||
(setq-local org-habit-graph-column graph-column-adjusted)))))
|
||||
(when (featurep 'org-habit)
|
||||
(let* ((total-days (float (+ org-habit-preceding-days org-habit-following-days)))
|
||||
(preceding-days-ratio (/ org-habit-preceding-days total-days))
|
||||
(graph-width (floor (* (window-width) +org-habit-graph-window-ratio)))
|
||||
(preceding-days (floor (* graph-width preceding-days-ratio)))
|
||||
(following-days (- graph-width preceding-days))
|
||||
(graph-column (- (window-width) (+ preceding-days following-days)))
|
||||
(graph-column-adjusted (if (> graph-column +org-habit-min-width)
|
||||
(- graph-column +org-habit-graph-padding)
|
||||
nil)))
|
||||
(setq-local org-habit-preceding-days preceding-days)
|
||||
(setq-local org-habit-following-days following-days)
|
||||
(setq-local org-habit-graph-column graph-column-adjusted))))))
|
||||
|
||||
|
||||
(defun +org-init-hacks-h ()
|
||||
|
@ -467,10 +474,11 @@ underlying, modified buffer. This fixes that."
|
|||
;; Open directory links in dired
|
||||
(add-to-list 'org-file-apps '(directory . emacs))
|
||||
|
||||
;; When you create a sparse tree and `org-indent-mode' is enabled, the
|
||||
;; highlighting destroys the invisibility added by `org-indent-mode'.
|
||||
;; Therefore, don't highlight when creating a sparse tree.
|
||||
(setq org-highlight-sparse-tree-matches nil)
|
||||
;; 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))
|
||||
|
||||
(add-hook! 'org-follow-link-hook
|
||||
(defun +org-delayed-recenter-h ()
|
||||
|
@ -707,12 +715,12 @@ between the two."
|
|||
:localleader
|
||||
"d" #'org-agenda-deadline
|
||||
(:prefix ("c" . "clock")
|
||||
"c" #'org-agenda-clock-in
|
||||
"C" #'org-agenda-clock-out
|
||||
"c" #'org-agenda-clock-cancel
|
||||
"g" #'org-agenda-clock-goto
|
||||
"i" #'org-agenda-clock-in
|
||||
"o" #'org-agenda-clock-out
|
||||
"r" #'org-agenda-clockreport-mode
|
||||
"s" #'org-agenda-show-clocking-issues
|
||||
"x" #'org-agenda-clock-cancel)
|
||||
"s" #'org-agenda-show-clocking-issues)
|
||||
"q" #'org-agenda-set-tags
|
||||
"r" #'org-agenda-refile
|
||||
"s" #'org-agenda-schedule
|
||||
|
@ -770,6 +778,11 @@ compelling reason, so..."
|
|||
)
|
||||
|
||||
|
||||
(defun +org-init-smartparens-h ()
|
||||
;; Disable the slow defaults
|
||||
(provide 'smartparens-org))
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
||||
|
@ -891,8 +904,8 @@ compelling reason, so..."
|
|||
:ni "C-S-k" #'org-shiftup
|
||||
:ni "C-S-j" #'org-shiftdown
|
||||
;; more intuitive RET keybinds
|
||||
:i [return] #'org-return-indent
|
||||
:i "RET" #'org-return-indent
|
||||
:i [return] (λ! (org-return t))
|
||||
:i "RET" (λ! (org-return t))
|
||||
:n [return] #'+org/dwim-at-point
|
||||
:n "RET" #'+org/dwim-at-point
|
||||
;; more vim-esque org motion keys (not covered by evil-org-mode)
|
||||
|
@ -911,11 +924,12 @@ compelling reason, so..."
|
|||
:n "zc" #'+org/close-fold
|
||||
:n "zC" #'outline-hide-subtree
|
||||
:n "zm" #'+org/hide-next-fold-level
|
||||
:n "zM" #'+org/close-all-folds
|
||||
:n "zn" #'org-tree-to-indirect-buffer
|
||||
:n "zo" #'+org/open-fold
|
||||
:n "zO" #'outline-show-subtree
|
||||
:n "zr" #'+org/show-next-fold-level
|
||||
:n "zR" #'outline-show-all
|
||||
:n "zR" #'+org/open-all-folds
|
||||
:n "zi" #'org-toggle-inline-images
|
||||
|
||||
:map org-read-date-minibuffer-local-map
|
||||
|
@ -971,15 +985,8 @@ compelling reason, so..."
|
|||
))
|
||||
|
||||
;;; Custom org modules
|
||||
(if (featurep! +brain) (load! "contrib/brain"))
|
||||
(if (featurep! +dragndrop) (load! "contrib/dragndrop"))
|
||||
(if (featurep! +ipython) (load! "contrib/ipython"))
|
||||
(if (featurep! +journal) (load! "contrib/journal"))
|
||||
(if (featurep! +jupyter) (load! "contrib/jupyter"))
|
||||
(if (featurep! +pomodoro) (load! "contrib/pomodoro"))
|
||||
(if (featurep! +present) (load! "contrib/present"))
|
||||
(if (featurep! +roam) (load! "contrib/roam"))
|
||||
(if (featurep! +noter) (load! "contrib/noter"))
|
||||
(dolist (flag doom--current-flags)
|
||||
(load! (concat "contrib/" (substring (symbol-name flag) 1)) nil t))
|
||||
|
||||
;; Add our general hooks after the submodules, so that any hooks the
|
||||
;; submodules add run after them, and can overwrite any defaults if necessary.
|
||||
|
@ -991,7 +998,7 @@ compelling reason, so..."
|
|||
#'doom-disable-show-trailing-whitespace-h
|
||||
#'+org-enable-auto-reformat-tables-h
|
||||
#'+org-enable-auto-update-cookies-h
|
||||
#'+org-unfold-to-2nd-level-or-point-h)
|
||||
#'+org-make-last-point-visible-h)
|
||||
|
||||
(add-hook! 'org-load-hook
|
||||
#'+org-init-org-directory-h
|
||||
|
@ -1009,7 +1016,8 @@ compelling reason, so..."
|
|||
#'+org-init-keybinds-h
|
||||
#'+org-init-popup-rules-h
|
||||
#'+org-init-protocol-h
|
||||
#'+org-init-protocol-lazy-loader-h)
|
||||
#'+org-init-protocol-lazy-loader-h
|
||||
#'+org-init-smartparens-h)
|
||||
|
||||
;; (Re)activate eldoc-mode in org-mode a little later, because it disables
|
||||
;; itself if started too soon (which is the case with `global-eldoc-mode').
|
||||
|
|
|
@ -41,19 +41,19 @@
|
|||
(defadvice! +org-present--narrow-to-subtree-a (orig-fn &rest args)
|
||||
"Narrow to the target subtree when you start the presentation."
|
||||
:around #'org-tree-slide--display-tree-with-narrow
|
||||
(letf! ((defun org-narrow-to-subtree ()
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
(org-with-limited-levels
|
||||
(narrow-to-region
|
||||
(progn
|
||||
(when (org-before-first-heading-p)
|
||||
(org-next-visible-heading 1))
|
||||
(ignore-errors (org-up-heading-all 99))
|
||||
(forward-line 1)
|
||||
(point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(when (and (org-at-heading-p) (not (eobp)))
|
||||
(backward-char 1))
|
||||
(point))))))))
|
||||
(letf! (defun org-narrow-to-subtree ()
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
(org-with-limited-levels
|
||||
(narrow-to-region
|
||||
(progn
|
||||
(when (org-before-first-heading-p)
|
||||
(org-next-visible-heading 1))
|
||||
(ignore-errors (org-up-heading-all 99))
|
||||
(forward-line 1)
|
||||
(point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(when (and (org-at-heading-p) (not (eobp)))
|
||||
(backward-char 1))
|
||||
(point)))))))
|
||||
(apply orig-fn args))))
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
:recipe (:host github
|
||||
:repo "emacs-straight/org-mode"
|
||||
:files ("*.el" "lisp/*.el" "contrib/lisp/*.el"))
|
||||
:pin "b171ff02f6e69bcce0dec56ea23e11c75e558704")
|
||||
:pin "93c50e3a7867a1a85fc78b337172585f7a10dcc6")
|
||||
;; ...And prevent other packages from pulling org; org-plus-contrib satisfies
|
||||
;; the dependency already: https://github.com/raxod502/straight.el/issues/352
|
||||
(package! org :recipe (:local-repo nil))
|
||||
|
@ -51,7 +51,7 @@
|
|||
(when (featurep! :tools magit)
|
||||
(package! orgit :pin "e147f055772cc934fe1f1d8619059badeb647c93"))
|
||||
(when (featurep! +brain)
|
||||
(package! org-brain :pin "ae7fe0f628bd093526786ece6917f7a4310e5e4d"))
|
||||
(package! org-brain :pin "ed99f7e38dd687800fb898f8934a0da0541ebcd9"))
|
||||
(when (featurep! +dragndrop)
|
||||
(package! org-download :pin "d248fcb8f2592a40507682e91eed9a31ead4e4a6"))
|
||||
(when (featurep! +gnuplot)
|
||||
|
@ -62,7 +62,7 @@
|
|||
(when (featurep! +jupyter)
|
||||
(package! jupyter :pin "785edbbff65abb0c929dc2fbd8b8305c77fd529e"))
|
||||
(when (featurep! +journal)
|
||||
(package! org-journal :pin "8bf06b28d6f14f52d4968123e2b4b91930c8f947"))
|
||||
(package! org-journal :pin "2c43b10eed0659f8e47797e5e53d2973f939284d"))
|
||||
(when (featurep! +noter)
|
||||
(package! org-noter :pin "9ead81d42dd4dd5074782d239b2efddf9b8b7b3d"))
|
||||
(when (featurep! +pomodoro)
|
||||
|
@ -72,11 +72,11 @@
|
|||
:recipe (:host github :repo "anler/centered-window-mode")
|
||||
:pin "f50859941ab5c7cbeaee410f2d38716252b552ac")
|
||||
(package! org-tree-slide :pin "7bf09a02bd2d8f1ccfcb5209bfb18fbe02d1f44e")
|
||||
(package! org-re-reveal :pin "61549f4c00284a30e34caa3d76001b233ea5d2ad"))
|
||||
(package! org-re-reveal :pin "a9e9d4ef88417b3af7741a8d8f444ece820e7a3b"))
|
||||
(when (featurep! +roam)
|
||||
(package! org-roam :pin "689f55908048eede3cb65aa30ab990be3ac93263")
|
||||
(package! org-roam :pin "1267a430431f11035798cc4007c5dd3efe543ced")
|
||||
(when (featurep! :completion company)
|
||||
(package! company-org-roam :pin "0913d86f167164e18831206e611f44bb8e7297e3")))
|
||||
(package! company-org-roam :pin "674c2bd493f571c5323d69279557a6c18ccbd14e")))
|
||||
|
||||
;;; Babel
|
||||
(package! ob-async :pin "80a30b96a007d419ece12c976a81804ede340311")
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
;;; lang/purescript/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! purescript-mode
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'purescript-mode-local-vars-hook #'lsp!))
|
||||
|
||||
(add-hook! 'purescript-mode-hook
|
||||
#'purescript-indentation-mode
|
||||
#'rainbow-delimiters-mode)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
(defun +python/open-repl ()
|
||||
"Open the Python REPL."
|
||||
(interactive)
|
||||
(require 'python)
|
||||
(unless python-shell-interpreter
|
||||
(user-error "`python-shell-interpreter' isn't set"))
|
||||
(pop-to-buffer
|
||||
|
@ -23,6 +24,7 @@
|
|||
(defun +python/open-ipython-repl ()
|
||||
"Open an IPython REPL."
|
||||
(interactive)
|
||||
(require 'python)
|
||||
(let ((python-shell-interpreter (or (+python-executable-find "ipython") "ipython"))
|
||||
(python-shell-interpreter-args (string-join +python-ipython-repl-args " ")))
|
||||
(+python/open-repl)))
|
||||
|
@ -31,6 +33,7 @@
|
|||
(defun +python/open-jupyter-repl ()
|
||||
"Open a Jupyter console."
|
||||
(interactive)
|
||||
(require 'python)
|
||||
(add-to-list 'python-shell-completion-native-disabled-interpreters "jupyter")
|
||||
(let ((python-shell-interpreter (or (+python-executable-find "jupyter") "jupyter"))
|
||||
(python-shell-interpreter-args (format "console %s" (string-join +python-jupyter-repl-args " "))))
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"This module requires (:tools lsp)")
|
||||
|
||||
(if (not (executable-find "python"))
|
||||
(error! "Python isn't installed.")
|
||||
(error! "Couldn't find python in your PATH")
|
||||
(unless (featurep! +lsp)
|
||||
(unless (zerop (shell-command "python -c 'import setuptools'"))
|
||||
(warn! "setuptools wasn't detected, which anaconda-mode requires"))))
|
||||
|
|
|
@ -50,6 +50,11 @@
|
|||
(set-lookup-handlers! 'ruby-mode
|
||||
:definition #'robe-jump
|
||||
:documentation #'robe-doc)
|
||||
(when (boundp 'read-process-output-max)
|
||||
;; Robe can over saturate IPC, making interacting with it slow/clobbering
|
||||
;; the GC, so increase the amount of data Emacs reads from it at a time.
|
||||
(setq-hook! '(robe-mode-hook inf-ruby-mode-hook)
|
||||
read-process-output-max (* 1024 1024)))
|
||||
(when (featurep! :editor evil)
|
||||
(add-hook 'robe-mode-hook #'evil-normalize-keymaps))
|
||||
(map! :localleader
|
||||
|
@ -175,7 +180,9 @@
|
|||
:when (featurep! +rails)
|
||||
:hook ((ruby-mode inf-ruby-mode projectile-rails-server-mode) . projectile-rails-mode)
|
||||
:hook (projectile-rails-server-mode . doom-mark-buffer-as-real-h)
|
||||
:hook (projectile-rails-mode . auto-insert-mode)
|
||||
:init
|
||||
(setq auto-insert-query nil)
|
||||
(setq inf-ruby-console-environment "development")
|
||||
(when (featurep! :lang web)
|
||||
(add-hook 'web-mode-hook #'projectile-rails-mode))
|
||||
|
|
|
@ -3,34 +3,34 @@
|
|||
|
||||
;; Major modes
|
||||
(package! ruby-mode :built-in t)
|
||||
(package! yard-mode :pin "ba74a47463")
|
||||
(package! yard-mode :pin "ba74a47463b0320ae152bd42a7dd7aeecd7b5748")
|
||||
|
||||
;; REPL
|
||||
(package! inf-ruby :pin "41e5ed3a88")
|
||||
(package! inf-ruby :pin "41e5ed3a886fca56990486f1987bb3bae0dbd54b")
|
||||
(when (featurep! :completion company)
|
||||
(package! company-inf-ruby :pin "fe3e4863bc"))
|
||||
(package! company-inf-ruby :pin "fe3e4863bc971fbb81edad447efad5795ead1b17"))
|
||||
|
||||
;; Programming environment
|
||||
(package! rubocop :pin "03bf15558a")
|
||||
(package! robe :pin "68503b32bb")
|
||||
(package! rubocop :pin "03bf15558a6eb65e4f74000cab29412efd46660e")
|
||||
(package! robe :pin "68503b32bb3a005787ecb7a7fdeb3bb4a2317e2b")
|
||||
|
||||
;; Project tools
|
||||
(package! bundler :pin "43efb6be4e")
|
||||
(package! rake :pin "9c204334b0")
|
||||
(package! bundler :pin "43efb6be4ed118b06d787ce7fbcffd68a31732a7")
|
||||
(package! rake :pin "9c204334b03b4e899fadae6e59c20cf105404128")
|
||||
|
||||
;; Environment management
|
||||
(when (featurep! +rbenv)
|
||||
(package! rbenv :pin "2ea1a5bdc1"))
|
||||
(package! rbenv :pin "2ea1a5bdc1266caef1dd77700f2c8f42429b03f1"))
|
||||
(when (featurep! +rvm)
|
||||
(package! rvm :pin "134497bc46"))
|
||||
(package! rvm :pin "134497bc460990c71ab8fa75431156e62c17da2d"))
|
||||
(when (featurep! +chruby)
|
||||
(package! chruby :pin "42bc6d521f"))
|
||||
(package! chruby :pin "42bc6d521f832eca8e2ba210f30d03ad5529788f"))
|
||||
|
||||
;; Testing frameworks
|
||||
(package! rspec-mode :pin "9a2a9d2935")
|
||||
(package! minitest :pin "97d7d1760b")
|
||||
(package! rspec-mode :pin "9a2a9d2935ae17b8570485bdea7c347533b464f6")
|
||||
(package! minitest :pin "ddd152c990a528ad09a696bfad23afa4330ea4d7")
|
||||
|
||||
;; Rails
|
||||
(when (featurep! +rails)
|
||||
(package! projectile-rails :pin "0398d940a2")
|
||||
(package! inflections :pin "e4f1372cf2"))
|
||||
(package! projectile-rails :pin "11980b2bcb99208888856a9b8666ff329b6f0142")
|
||||
(package! inflections :pin "e4f1372cf22e811faca52fc86bdd5d817498a4d8"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue