Merge branch 'develop' into add-persistent-soft-package

This commit is contained in:
Henrik Lissner 2020-02-09 17:20:26 -05:00 committed by GitHub
commit dc24c1cddc
65 changed files with 490 additions and 373 deletions

View file

@ -44,8 +44,7 @@ FRAME parameter defaults to current frame."
(let* ((font (frame-parameter nil 'font)) (let* ((font (frame-parameter nil 'font))
(font (doom--font-name font)) (font (doom--font-name font))
(increment (* increment doom-font-increment)) (increment (* increment doom-font-increment))
(zoom-factor (or doom--font-scale 0)) (zoom-factor (or doom--font-scale 0)))
success)
(let ((new-size (+ (string-to-number (aref font xlfd-regexp-pixelsize-subnum)) (let ((new-size (+ (string-to-number (aref font xlfd-regexp-pixelsize-subnum))
increment))) increment)))
(unless (> new-size 0) (unless (> new-size 0)

View file

@ -54,7 +54,7 @@
(car (gethash (symbol-name package) straight--build-cache))) (car (gethash (symbol-name package) straight--build-cache)))
;;;###autoload ;;;###autoload
(defun doom-package-dependencies (package &optional recursive noerror) (defun doom-package-dependencies (package &optional recursive _noerror)
"Return a list of dependencies for a package." "Return a list of dependencies for a package."
(let ((deps (nth 1 (gethash (symbol-name package) straight--build-cache)))) (let ((deps (nth 1 (gethash (symbol-name package) straight--build-cache))))
(if recursive (if recursive
@ -210,11 +210,12 @@ ones."
"Return an alist mapping package names (strings) to pinned commits (strings)." "Return an alist mapping package names (strings) to pinned commits (strings)."
(let (alist) (let (alist)
(dolist (package doom-packages alist) (dolist (package doom-packages alist)
(with-plist! (cdr package) (recipe modules disable ignore pin unpin) (cl-destructuring-bind (name &key disable ignore pin unpin &allow-other-keys)
package
(when (and (not ignore) (when (and (not ignore)
(not disable) (not disable)
(or pin unpin)) (or pin unpin))
(setf (alist-get (doom-package-recipe-repo (car package)) alist (setf (alist-get (doom-package-recipe-repo name) alist
nil 'remove #'equal) nil 'remove #'equal)
(unless unpin pin))))))) (unless unpin pin)))))))
@ -223,7 +224,9 @@ ones."
"Return an alist mapping package names (strings) to pinned commits (strings)." "Return an alist mapping package names (strings) to pinned commits (strings)."
(let (alist) (let (alist)
(dolist (package doom-packages alist) (dolist (package doom-packages alist)
(with-plist! (cdr package) (recipe modules disable ignore pin unpin) (cl-destructuring-bind
(_ &key recipe disable ignore pin unpin &allow-other-keys)
package
(when (and (not ignore) (when (and (not ignore)
(not disable) (not disable)
(or unpin (or unpin
@ -237,8 +240,11 @@ ones."
"Return straight recipes for non-builtin packages with a local-repo." "Return straight recipes for non-builtin packages with a local-repo."
(let (recipes) (let (recipes)
(dolist (recipe (hash-table-values straight--recipe-cache)) (dolist (recipe (hash-table-values straight--recipe-cache))
(with-plist! recipe (local-repo type) (cl-destructuring-bind (&key local-repo type no-build &allow-other-keys)
(when (and local-repo (not (eq type 'built-in))) recipe
(unless (or (null local-repo)
(eq type 'built-in)
no-build)
(push recipe recipes)))) (push recipe recipes))))
(nreverse recipes))) (nreverse recipes)))
@ -291,25 +297,29 @@ Grabs the latest commit id of the package using 'git'."
(user-error "Not on a `package!' call") (user-error "Not on a `package!' call")
(backward-char) (backward-char)
(let* ((recipe (cdr (sexp-at-point))) (let* ((recipe (cdr (sexp-at-point)))
(name (car recipe)) (package (car recipe))
(oldid (doom-package-get package :pin))
(id (id
(cdr (doom-call-process (cdr (doom-call-process
"git" "ls-remote" "git" "ls-remote"
(straight-vc-git--destructure (straight-vc-git--destructure
(doom-plist-merge (doom-plist-merge
(plist-get (cdr recipe) :recipe) (plist-get (cdr recipe) :recipe)
(or (cdr (straight-recipes-retrieve name)) (or (cdr (straight-recipes-retrieve package))
(plist-get (cdr (assq name doom-packages)) :recipe))) (plist-get (cdr (assq package doom-packages)) :recipe)))
(upstream-repo upstream-host) (upstream-repo upstream-host)
(straight-vc-git--encode-url upstream-repo upstream-host)))))) (straight-vc-git--encode-url upstream-repo upstream-host))))))
(unless id (unless id
(user-error "No id for %S package" name)) (user-error "No id for %S package" package))
(let* ((id (if select (let* ((id (if select
(car (split-string (completing-read "Commit: " (split-string id "\n" t)))) (car (split-string (completing-read "Commit: " (split-string id "\n" t))))
(car (split-string id)))) (car (split-string id))))
(id (substring id 0 10))) (id (substring id 0 10)))
(if (re-search-forward ":pin +\"\\([^\"]+\\)\"" (cdr (bounds-of-thing-at-point 'sexp)) t) (if (and oldid (string-match-p (concat "^" oldid) id))
(replace-match id t t nil 1) (user-error "No update necessary")
(thing-at-point--end-of-sexp) (if (re-search-forward ":pin +\"\\([^\"]+\\)\"" (cdr (bounds-of-thing-at-point 'sexp)) t)
(backward-char) (replace-match id t t nil 1)
(insert " :pin " (prin1-to-string id)))))))) (thing-at-point--end-of-sexp)
(backward-char)
(insert " :pin " (prin1-to-string id)))
(message "Updated %S: %s -> %s" package oldid id)))))))

View file

@ -1,6 +1,8 @@
;;; core/autoload/projects.el -*- lexical-binding: t; -*- ;;; core/autoload/projects.el -*- lexical-binding: t; -*-
(defvar projectile-project-root nil) (defvar projectile-project-root nil)
(defvar projectile-enable-caching)
(defvar projectile-require-project-root)
;;;###autoload (autoload 'projectile-relevant-known-projects "projectile") ;;;###autoload (autoload 'projectile-relevant-known-projects "projectile")

View file

@ -96,6 +96,7 @@ following:
;; ;;
;;; Commands ;;; Commands
(defvar projectile-enable-caching)
;;;###autoload ;;;###autoload
(defun doom/open-scratch-buffer (&optional arg project-p) (defun doom/open-scratch-buffer (&optional arg project-p)
"Pop up a persistent scratch buffer. "Pop up a persistent scratch buffer.

View file

@ -117,34 +117,37 @@ in some cases."
;;; Commands ;;; Commands
(defun doom--bol-bot-eot-eol (&optional pos) (defun doom--bol-bot-eot-eol (&optional pos)
(let* ((bol (if visual-line-mode (save-excursion
(save-excursion (when pos
(beginning-of-visual-line) (goto-char pos))
(point)) (let* ((bol (if visual-line-mode
(line-beginning-position))) (save-excursion
(bot (save-excursion (beginning-of-visual-line)
(goto-char bol) (point))
(skip-chars-forward " \t\r") (line-beginning-position)))
(point))) (bot (save-excursion
(eol (if visual-line-mode (goto-char bol)
(save-excursion (end-of-visual-line) (point)) (skip-chars-forward " \t\r")
(line-end-position))) (point)))
(eot (or (save-excursion (eol (if visual-line-mode
(if (not comment-use-syntax) (save-excursion (end-of-visual-line) (point))
(progn (line-end-position)))
(goto-char bol) (eot (or (save-excursion
(when (re-search-forward comment-start-skip eol t) (if (not comment-use-syntax)
(or (match-end 1) (match-beginning 0)))) (progn
(goto-char eol) (goto-char bol)
(while (and (doom-point-in-comment-p) (when (re-search-forward comment-start-skip eol t)
(> (point) bol)) (or (match-end 1) (match-beginning 0))))
(backward-char)) (goto-char eol)
(skip-chars-backward " " bol) (while (and (doom-point-in-comment-p)
(unless (or (eq (char-after) 32) (eolp)) (> (point) bol))
(forward-char)) (backward-char))
(point))) (skip-chars-backward " " bol)
eol))) (unless (or (eq (char-after) 32) (eolp))
(list bol bot eot eol))) (forward-char))
(point)))
eol)))
(list bol bot eot eol))))
(defvar doom--last-backward-pt nil) (defvar doom--last-backward-pt nil)
;;;###autoload ;;;###autoload
@ -154,7 +157,7 @@ beginning of the line. The opposite of
`doom/forward-to-last-non-comment-or-eol'." `doom/forward-to-last-non-comment-or-eol'."
(interactive "d") (interactive "d")
(let ((pt (or point (point)))) (let ((pt (or point (point))))
(cl-destructuring-bind (bol bot _eot eol) (cl-destructuring-bind (bol bot _eot _eol)
(doom--bol-bot-eot-eol pt) (doom--bol-bot-eot-eol pt)
(cond ((> pt bot) (cond ((> pt bot)
(goto-char bot)) (goto-char bot))

View file

@ -134,10 +134,8 @@ one wants that.")
(form)))) (form))))
(defun doom-cli--generate-autoloads-autodefs (file buffer module &optional module-enabled-p) (defun doom-cli--generate-autoloads-autodefs (file buffer module &optional module-enabled-p)
(with-current-buffer (with-temp-buffer
(or (get-file-buffer file) (insert-file-contents file)
(autoload-find-file file))
(goto-char (point-min))
(while (re-search-forward "^;;;###autodef *\\([^\n]+\\)?\n" nil t) (while (re-search-forward "^;;;###autodef *\\([^\n]+\\)?\n" nil t)
(let* ((standard-output buffer) (let* ((standard-output buffer)
(form (read (current-buffer))) (form (read (current-buffer)))

View file

@ -80,14 +80,22 @@ DOOMDIR environment variable. e.g.
(print! "Regenerating autoloads files") (print! "Regenerating autoloads files")
(doom-cli-reload-autoloads) (doom-cli-reload-autoloads)
(if nofonts-p (cond (nofonts-p)
(print! (warn "Not installing fonts, as requested")) (IS-WINDOWS
(when (or doom-auto-accept (print! (warn "Doom cannot install all-the-icons' fonts on Windows!\n"))
(y-or-n-p "Download and install all-the-icon's fonts?")) (print-group!
(require 'all-the-icons) (print!
(let ((window-system (cond (IS-MAC 'ns) (concat "You'll have to do so manually:\n\n"
(IS-LINUX 'x)))) " 1. Launch Doom Emacs\n"
(all-the-icons-install-fonts 'yes)))) " 2. Execute 'M-x all-the-icons-install-fonts' to download the fonts\n"
" 3. Open the download location in windows explorer\n"
" 4. Open each font file to install them"))))
((or doom-auto-accept
(y-or-n-p "Download and install all-the-icon's fonts?"))
(require 'all-the-icons)
(let ((window-system (cond (IS-MAC 'ns)
(IS-LINUX 'x))))
(all-the-icons-install-fonts 'yes))))
(when (file-exists-p "~/.emacs") (when (file-exists-p "~/.emacs")
(print! (warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!"))) (print! (warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!")))

View file

@ -194,7 +194,7 @@ declaration) or dependency thereof that hasn't already been."
(setq output (doom--commit-log-between ref target-ref))) (setq output (doom--commit-log-between ref target-ref)))
(doom--same-commit-p target-ref (straight-vc-get-commit type local-repo))) (doom--same-commit-p target-ref (straight-vc-get-commit type local-repo)))
((print! (start "\033[K(%d/%d) Re-cloning %s...%s") i total local-repo esc) ((print! (start "\033[K(%d/%d) Re-cloning %s...") i total local-repo esc)
(let ((repo (straight--repos-dir local-repo))) (let ((repo (straight--repos-dir local-repo)))
(ignore-errors (ignore-errors
(delete-directory repo 'recursive)) (delete-directory repo 'recursive))
@ -212,8 +212,9 @@ declaration) or dependency thereof that hasn't already been."
(puthash local-repo t repos-to-rebuild) (puthash local-repo t repos-to-rebuild)
(puthash package t packages-to-rebuild) (puthash package t packages-to-rebuild)
(unless (string-empty-p output) (unless (string-empty-p output)
(print-group! (print! (info "%s" output)))) (print! (start "\033[K(%d/%d) Updating %s...") i total local-repo)
(print! (success "(%d/%d) %s updated (%s -> %s)") (print-group! (print! (indent 2 output))))
(print! (success "\033[K(%d/%d) %s updated (%s -> %s)")
i total local-repo i total local-repo
(doom--abbrev-commit ref) (doom--abbrev-commit ref)
(doom--abbrev-commit target-ref))) (doom--abbrev-commit target-ref)))

View file

@ -43,10 +43,11 @@ possible."
(and buffer-file-name (and buffer-file-name
(not doom-large-file-p) (not doom-large-file-p)
(file-exists-p buffer-file-name) (file-exists-p buffer-file-name)
(> (nth 7 (file-attributes buffer-file-name)) (ignore-errors
(* 1024 1024 (> (nth 7 (file-attributes buffer-file-name))
(assoc-default buffer-file-name doom-large-file-size-alist (* 1024 1024
#'string-match-p))))) (assoc-default buffer-file-name doom-large-file-size-alist
#'string-match-p))))))
(prog1 (apply orig-fn args) (prog1 (apply orig-fn args)
(if (memq major-mode doom-large-file-excluded-modes) (if (memq major-mode doom-large-file-excluded-modes)
(setq doom-large-file-p nil) (setq doom-large-file-p nil)

View file

@ -282,7 +282,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(setq window-resize-pixelwise t (setq window-resize-pixelwise t
frame-resize-pixelwise t) frame-resize-pixelwise t)
(unless EMACS27+ (when (bound-and-true-p tool-bar-mode)
;; We do this in early-init.el too, but in case the user is on Emacs 26 we do ;; We do this in early-init.el too, but in case the user is on Emacs 26 we do
;; it here too: disable tool and scrollbars, as Doom encourages ;; it here too: disable tool and scrollbars, as Doom encourages
;; keyboard-centric workflows, so these are just clutter (the scrollbar also ;; keyboard-centric workflows, so these are just clutter (the scrollbar also

View file

@ -134,6 +134,9 @@ users).")
;; ;;
;;; Emacs core configuration ;;; Emacs core configuration
;; lo', longer logs ahoy, so we may reliably locate lapses in doom's logic
(setq message-log-max 8192)
;; Reduce debug output, well, unless we've asked for it. ;; Reduce debug output, well, unless we've asked for it.
(setq debug-on-error doom-debug-mode (setq debug-on-error doom-debug-mode
jka-compr-verbose doom-debug-mode) jka-compr-verbose doom-debug-mode)

View file

@ -15,11 +15,11 @@
;; core-editor.el ;; core-editor.el
(package! better-jumper :pin "6d240032ca") (package! better-jumper :pin "6d240032ca")
(package! dtrt-indent :pin "48221c928b") (package! dtrt-indent :pin "48221c928b")
(package! helpful :pin "e511e8dbd3") (package! helpful :pin "c54e9ddbd6")
(when IS-MAC (when IS-MAC
(package! ns-auto-titlebar :pin "1efc30d385")) (package! ns-auto-titlebar :pin "1efc30d385"))
(package! pcre2el :pin "0b5b2a2c17") (package! pcre2el :pin "0b5b2a2c17")
(package! smartparens :pin "9449ae0859") (package! smartparens :pin "be8d5c9a63")
(package! so-long (package! so-long
:built-in 'prefer ; included in Emacs 27+ :built-in 'prefer ; included in Emacs 27+
;; REVIEW so-long is slated to be published to ELPA eventually, but until then ;; REVIEW so-long is slated to be published to ELPA eventually, but until then
@ -37,11 +37,11 @@
(package! xclip :pin "88003b782e")) (package! xclip :pin "88003b782e"))
;; core-projects.el ;; core-projects.el
(package! projectile :pin "27a0da9cdc") (package! projectile :pin "84be1dada3")
;; core-keybinds.el ;; core-keybinds.el
(package! general :pin "f6e928622d") (package! general :pin "f6e928622d")
(package! which-key :pin "db3d003e90") (package! which-key :pin "cf44641485")
;; autoload/cache.el ;; autoload/cache.el
(package! persistent-soft :pin "a1e0ddf") (package! persistent-soft :pin "a1e0ddf")

View file

@ -388,7 +388,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
*** package! *** package!
#+BEGIN_SRC elisp :eval no #+BEGIN_SRC elisp :eval no
;; To install a package that can be found on ELPA or any of the sources ;; To install a package that can be found on ELPA or any of the sources
;; specified in `doom-core-package-sources': ;; specified in `straight-recipe-repositories':
(package! evil) (package! evil)
(package! js2-mode) (package! js2-mode)
(package! rainbow-delimiters) (package! rainbow-delimiters)

View file

@ -8,6 +8,7 @@ removing them from your ~doom!~ block (found in =$DOOMDIR/init.el=).
* Table of Contents :TOC: * Table of Contents :TOC:
- [[#app][:app]] - [[#app][:app]]
- [[#checkers][:checkers]]
- [[#completion][:completion]] - [[#completion][:completion]]
- [[#config][:config]] - [[#config][:config]]
- [[#editor][:editor]] - [[#editor][:editor]]
@ -24,20 +25,15 @@ Application modules are complex and opinionated modules that transform Emacs
toward a specific purpose. They may have additional dependencies and should be toward a specific purpose. They may have additional dependencies and should be
loaded last, before =:config= modules. loaded last, before =:config= modules.
| Module | Flags | Description |
|----------+---------------------+--------------------------------------------------------------------------|
| calendar | - | TODO |
| irc | - | Turns Emacs into an IRC client, powered by circe |
| rss | =+org= | An RSS reader client for Emacs, powered by elfeed |
| twitter | - | A twitter client for Emacs, powered by twittering |
| write | =+wordnut +langnut= | Transforms Emacs into an IDE For fiction, literary or scientific writers |
+ [[file:../modules/app/calendar/README.org][calendar]] - TODO + [[file:../modules/app/calendar/README.org][calendar]] - TODO
+ [[file:../modules/app/irc/README.org][irc]] - how neckbeards socialize + [[file:../modules/app/irc/README.org][irc]] - how neckbeards socialize
+ rss =+org= - an RSS client in Emacs + rss =+org= - an RSS client in Emacs
+ [[file:../modules/app/twitter/README.org][twitter]] - A twitter client for Emacs + [[file:../modules/app/twitter/README.org][twitter]] - A twitter client for Emacs
+ [[file:../modules/app/write/README.org][write]] =+wordnut +langtool= - Transforms emacs into an IDE for writers, and for
writing fiction, notes, papers and so on. * :checkers
+ syntax =+childframe= - Live error/warning highlights
+ spell =+everywhere= - Spell checking
+ grammar - TODO
* :completion * :completion
Modules that provide new interfaces or frameworks for completion, including code Modules that provide new interfaces or frameworks for completion, including code
@ -106,7 +102,7 @@ Modules that bring support for a language or group of languages to Emacs.
+ elm - TODO + elm - TODO
+ emacs-lisp - TODO + emacs-lisp - TODO
+ erlang - TODO + erlang - TODO
+ [[file:../modules/lang/ess/README.org][ess]] - TODO + [[file:../modules/lang/ess/README.org][ess]] =+lsp= - TODO
+ [[file:../modules/lang/faust/README.org][faust]] - TODO + [[file:../modules/lang/faust/README.org][faust]] - TODO
+ [[file:../modules/lang/fsharp/README.org][fsharp]] - TODO + [[file:../modules/lang/fsharp/README.org][fsharp]] - TODO
+ [[file:../modules/lang/go/README.org][go]] =+lsp= - TODO + [[file:../modules/lang/go/README.org][go]] =+lsp= - TODO
@ -162,8 +158,6 @@ Small modules that give Emacs access to external tools & services.
+ [[file:../modules/tools/editorconfig/README.org][editorconfig]] - TODO + [[file:../modules/tools/editorconfig/README.org][editorconfig]] - TODO
+ [[file:../modules/tools/ein/README.org][ein]] - TODO + [[file:../modules/tools/ein/README.org][ein]] - TODO
+ [[file:../modules/tools/eval/README.org][eval]] =+overlay= - REPL & code evaluation support for a variety of languages + [[file:../modules/tools/eval/README.org][eval]] =+overlay= - REPL & code evaluation support for a variety of languages
+ flycheck - Live error/warning highlights
+ flyspell =+everywhere= - Spell checking
+ gist - TODO + gist - TODO
+ [[file:../modules/tools/lookup/README.org][lookup]] =+dictionary +docsets= - Universal jump-to & documentation lookup + [[file:../modules/tools/lookup/README.org][lookup]] =+dictionary +docsets= - Universal jump-to & documentation lookup
backend backend

View file

@ -3,9 +3,9 @@
(defvar +calendar--wconf nil) (defvar +calendar--wconf nil)
(defun +calendar--init () (defun +calendar--init ()
(if-let* ((win (cl-loop for win in (doom-visible-windows) (if-let (win (cl-find-if (lambda (b) (string-match-p "^\\*cfw:" (buffer-name b)))
if (string-match-p "^\\*cfw:" (buffer-name (window-buffer win))) (doom-visible-windows)
return win))) :key #'window-buffer))
(select-window win) (select-window win)
(call-interactively +calendar-open-function))) (call-interactively +calendar-open-function)))

View file

@ -94,3 +94,7 @@ e.g. proselint and langtool."
((require 'flyspell-correct-popup nil t) ((require 'flyspell-correct-popup nil t)
(setq flyspell-popup-correct-delay 0.8) (setq flyspell-popup-correct-delay 0.8)
(define-key popup-menu-keymap [escape] #'keyboard-quit)))) (define-key popup-menu-keymap [escape] #'keyboard-quit))))
(use-package! flyspell-lazy
:after flyspell)

View file

@ -7,3 +7,5 @@
((featurep! :completion helm) ((featurep! :completion helm)
(package! flyspell-correct-helm :pin "b0353a41a7")) (package! flyspell-correct-helm :pin "b0353a41a7"))
((package! flyspell-correct-popup :pin "b0353a41a7"))) ((package! flyspell-correct-popup :pin "b0353a41a7")))
(package! flyspell-lazy :pin "3ebf68cc9e")

View file

@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; completion/company/packages.el ;;; completion/company/packages.el
(package! company :pin "d5053561cb") (package! company :pin "9de9905ed2")
(package! company-dict :pin "cd7b8394f6") (package! company-dict :pin "cd7b8394f6")
(package! company-prescient :pin "7fd8c3b802") (package! company-prescient :pin "7fd8c3b802")
(when (featurep! +childframe) (when (featurep! +childframe)

View file

@ -9,7 +9,7 @@
(package! amx :pin "3af93ca066") (package! amx :pin "3af93ca066")
(package! counsel-projectile :pin "cadc6de707") (package! counsel-projectile :pin "cadc6de707")
(package! ivy-rich :pin "7bfc7262fd") (package! ivy-rich :pin "7bfc7262fd")
(package! wgrep :pin "379afd89eb") (package! wgrep :pin "e67e737184")
(if (featurep! +prescient) (if (featurep! +prescient)
(package! ivy-prescient :pin "7fd8c3b802") (package! ivy-prescient :pin "7fd8c3b802")

View file

@ -77,10 +77,9 @@
:n "q" #'kill-current-buffer) :n "q" #'kill-current-buffer)
:m "gs" #'+evil/easymotion ; lazy-load `evil-easymotion' :m "gs" #'+evil/easymotion ; lazy-load `evil-easymotion'
(:after org (:after evil-org
:map org-mode-map :map evil-org-mode-map
:prefix "<easymotion>" :m "gsh" #'+org/goto-visible)
"h" #'+org/goto-visible)
(:when (featurep! :editor multiple-cursors) (:when (featurep! :editor multiple-cursors)
:prefix "gz" :prefix "gz"
@ -615,7 +614,7 @@
:desc "Indent style" "I" #'doom/toggle-indent-style :desc "Indent style" "I" #'doom/toggle-indent-style
:desc "Line numbers" "l" #'doom/toggle-line-numbers :desc "Line numbers" "l" #'doom/toggle-line-numbers
(:when (featurep! :lang org +present) (:when (featurep! :lang org +present)
:desc "org-tree-slide mode" "p" #'+org-present/start) :desc "org-tree-slide mode" "p" #'org-tree-slide-mode)
:desc "Read-only mode" "r" #'read-only-mode :desc "Read-only mode" "r" #'read-only-mode
(:when (featurep! :checkers spell) (:when (featurep! :checkers spell)
:desc "Flyspell" "s" #'flyspell-mode) :desc "Flyspell" "s" #'flyspell-mode)

View file

@ -11,3 +11,33 @@
(cl-destructuring-bind (beg . end) (cl-destructuring-bind (beg . end)
(bounds-of-thing-at-point 'defun) (bounds-of-thing-at-point 'defun)
(evil-range beg end type))) (evil-range beg end type)))
;;;###autoload (autoload '+evil:inner-url-txtobj "editor/evil/autoload/textobjects" nil nil)
(evil-define-text-object +evil:inner-url-txtobj (count &optional _beg _end type)
"Text object to select the inner url at point.
This excludes the protocol and querystring."
(cl-destructuring-bind (beg . end)
(bounds-of-thing-at-point 'url)
(evil-range
(save-excursion
(goto-char beg)
(re-search-forward "://" end t))
(save-excursion
(goto-char end)
(- (if-let (pos (re-search-backward "[?#]" beg t))
pos
end)
(if (evil-visual-state-p)
1
0)))
type)))
;;;###autoload (autoload '+evil:outer-url-txtobj "editor/evil/autoload/textobjects" nil nil)
(evil-define-text-object +evil:outer-url-txtobj (count &optional _beg _end type)
"Text object to select the whole url at point."
(cl-destructuring-bind (beg . end)
(bounds-of-thing-at-point 'url)
(evil-range
beg (- end (if (evil-visual-state-p) 1 0))
type)))

View file

@ -27,7 +27,6 @@ directives. By default, this only recognizes C directives.")
(defvar evil-want-C-w-delete t) (defvar evil-want-C-w-delete t)
(defvar evil-want-Y-yank-to-eol t) (defvar evil-want-Y-yank-to-eol t)
(defvar evil-want-abbrev-expand-on-insert-exit nil) (defvar evil-want-abbrev-expand-on-insert-exit nil)
(defvar evil-respect-visual-line-mode t)
(use-package! evil (use-package! evil
:hook (doom-init-modules . evil-mode) :hook (doom-init-modules . evil-mode)
@ -127,7 +126,7 @@ directives. By default, this only recognizes C directives.")
(count-lines (point-min) (point-max)) (count-lines (point-min) (point-max))
(buffer-size))))) (buffer-size)))))
;; 'gq' moves the cursor to the beginning of selection. Disable this, since ;; '=' moves the cursor to the beginning of selection. Disable this, since
;; it's more disruptive than helpful. ;; it's more disruptive than helpful.
(defadvice! +evil--dont-move-cursor-a (orig-fn &rest args) (defadvice! +evil--dont-move-cursor-a (orig-fn &rest args)
:around #'evil-indent :around #'evil-indent
@ -157,6 +156,14 @@ directives. By default, this only recognizes C directives.")
(advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a) (advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a)
(advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a) (advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a)
;; REVIEW Fix #2493: dir-locals cannot target fundamental-mode when evil-mode
;; is active. See https://github.com/hlissner/doom-emacs/issues/2493.
;; Revert this if this is ever fixed upstream.
(defadvice! fix-local-vars (&rest _)
:before #'turn-on-evil-mode
(when (eq major-mode 'fundamental-mode)
(hack-local-variables)))
;; Recenter screen after most searches ;; Recenter screen after most searches
(dolist (fn '(evil-visualstar/begin-search-forward (dolist (fn '(evil-visualstar/begin-search-forward
evil-visualstar/begin-search-backward evil-visualstar/begin-search-backward
@ -411,7 +418,7 @@ To change these keys see `+evil-repeat-keys'."
(defadvice! +evil-collection-disable-blacklist-a (orig-fn) (defadvice! +evil-collection-disable-blacklist-a (orig-fn)
:around #'evil-collection-vterm-toggle-send-escape ; allow binding to ESC :around #'evil-collection-vterm-toggle-send-escape ; allow binding to ESC
(let (evil-collection-key-blacklist) (let (evil-collection-key-blacklist)
(apply orig-fn)))) (funcall-interactively orig-fn))))
;; Keybinds that have no Emacs+evil analogues (i.e. don't exist): ;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
;; zq - mark word at point as good word ;; zq - mark word at point as good word
@ -549,6 +556,7 @@ To change these keys see `+evil-repeat-keys'."
:textobj "i" #'evil-indent-plus-i-indent #'evil-indent-plus-a-indent :textobj "i" #'evil-indent-plus-i-indent #'evil-indent-plus-a-indent
:textobj "j" #'evil-indent-plus-i-indent-up-down #'evil-indent-plus-a-indent-up-down :textobj "j" #'evil-indent-plus-i-indent-up-down #'evil-indent-plus-a-indent-up-down
:textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up :textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up
:textobj "u" #'+evil:inner-url-txtobj #'+evil:outer-url-txtobj
:textobj "x" #'evil-inner-xml-attr #'evil-outer-xml-attr :textobj "x" #'evil-inner-xml-attr #'evil-outer-xml-attr
;; evil-easymotion (see `+evil/easymotion') ;; evil-easymotion (see `+evil/easymotion')
@ -557,11 +565,6 @@ To change these keys see `+evil-repeat-keys'."
"a" (evilem-create #'evil-forward-arg) "a" (evilem-create #'evil-forward-arg)
"A" (evilem-create #'evil-backward-arg) "A" (evilem-create #'evil-backward-arg)
"s" #'evil-avy-goto-char-2 "s" #'evil-avy-goto-char-2
"w" (evilem-create #'evil-snipe-repeat
:pre-hook (save-excursion (call-interactively #'evil-snipe-f))
:bind ((evil-snipe-scope 'visible)
(evil-snipe-enable-highlight)
(evil-snipe-enable-incremental-highlight)))
"SPC" (λ!! #'evil-avy-goto-char-timer t) "SPC" (λ!! #'evil-avy-goto-char-timer t)
"/" #'evil-avy-goto-char-timer)) "/" #'evil-avy-goto-char-timer))

View file

@ -27,7 +27,10 @@
(save-excursion (save-excursion
(ignore-errors (ignore-errors
(or (hs-looking-at-block-start-p) (or (hs-looking-at-block-start-p)
(hs-find-block-beginning))))) (hs-find-block-beginning)
(unless (eolp)
(end-of-line)
(+fold--hideshow-fold-p))))))
(defun +fold--invisible-points (count) (defun +fold--invisible-points (count)
(let (points) (let (points)

View file

@ -1,4 +1,4 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; editor/format/packages.el ;;; editor/format/packages.el
(package! format-all :pin "d126830a73") (package! format-all :pin "f57a2a8abb")

View file

@ -7,4 +7,4 @@
:recipe (:host github :recipe (:host github
:repo "hlissner/doom-snippets" :repo "hlissner/doom-snippets"
:files ("*.el" "*")) :files ("*.el" "*"))
:pin "7ba920d1de") :pin "2781b782a3")

View file

@ -43,7 +43,7 @@ This module requires:
** MacOS ** MacOS
#+BEGIN_SRC sh #+BEGIN_SRC sh
brew install mu --with-emacs brew install mu
# And one of the following # And one of the following
brew install isync # mbsync brew install isync # mbsync
brew install offlineimap brew install offlineimap

View file

@ -110,7 +110,10 @@ This is ignored by ccls.")
(label . 0)))) (label . 0))))
(when (listp c-default-style) (when (listp c-default-style)
(setf (alist-get 'other c-default-style) "doom"))) (setf (alist-get 'other c-default-style) "doom"))
(after! ffap
(add-to-list 'ffap-alist '(c-mode . ffap-c-mode))))
(use-package! modern-cpp-font-lock (use-package! modern-cpp-font-lock

View file

@ -32,6 +32,7 @@
'(("^\\*sly-mrepl" :vslot 2 :size 0.3 :quit nil :ttl nil) '(("^\\*sly-mrepl" :vslot 2 :size 0.3 :quit nil :ttl nil)
("^\\*sly-compilation" :vslot 3 :ttl nil) ("^\\*sly-compilation" :vslot 3 :ttl nil)
("^\\*sly-traces" :vslot 4 :ttl nil) ("^\\*sly-traces" :vslot 4 :ttl nil)
("^\\*sly-description" :vslot 5 :size 0.3 :ttl 0)
;; Do not display debugger or inspector buffers in a popup window. These ;; Do not display debugger or inspector buffers in a popup window. These
;; buffers are meant to be displayed with sufficient vertical space. ;; buffers are meant to be displayed with sufficient vertical space.
("^\\*sly-\\(?:db\\|inspector\\)" :ignore t))) ("^\\*sly-\\(?:db\\|inspector\\)" :ignore t)))
@ -70,7 +71,8 @@
:map lisp-mode-map :map lisp-mode-map
:desc "Sly" "'" #'sly :desc "Sly" "'" #'sly
:desc "Sly (ask)" ";" (λ!! #'sly '-) :desc "Sly (ask)" ";" (λ!! #'sly '-)
:desc "Expand macro" "m" #'macrostep-expand :desc "Expand macro" "m" #'sly-macroexpand-1-inplace
:desc "Expand macro in popup" "M" #'sly-macroexpand-1
(:prefix ("c" . "compile") (:prefix ("c" . "compile")
:desc "Compile file" "c" #'sly-compile-file :desc "Compile file" "c" #'sly-compile-file
:desc "Compile/load file" "C" #'sly-compile-and-load-file :desc "Compile/load file" "C" #'sly-compile-and-load-file

View file

@ -3,6 +3,9 @@
(after! elm-mode (after! elm-mode
(add-hook 'elm-mode-hook #'rainbow-delimiters-mode) (add-hook 'elm-mode-hook #'rainbow-delimiters-mode)
(when (featurep! +lsp)
(add-hook 'elm-mode-local-vars-hook #'lsp!))
(set-company-backend! 'elm-mode 'company-elm) (set-company-backend! 'elm-mode 'company-elm)
(set-repl-handler! 'elm-mode #'run-elm-interactive) (set-repl-handler! 'elm-mode #'run-elm-interactive)
(set-pretty-symbols! 'elm-mode (set-pretty-symbols! 'elm-mode

View file

@ -88,7 +88,7 @@ library/userland functions"
((and (symbolp (setq module (sexp-at-point))) ((and (symbolp (setq module (sexp-at-point)))
(string-prefix-p "+" (symbol-name module))) (string-prefix-p "+" (symbol-name module)))
(while (symbolp (sexp-at-point)) (while (symbolp (sexp-at-point))
(beginning-of-sexp)) (thing-at-point--beginning-of-sexp))
(setq flag module (setq flag module
module (car (sexp-at-point))) module (car (sexp-at-point)))
(when (re-search-backward "\\_<:\\w+\\_>" nil t) (when (re-search-backward "\\_<:\\w+\\_>" nil t)
@ -99,7 +99,7 @@ library/userland functions"
(list category module flag)))))))) (list category module flag))))))))
;;;###autoload ;;;###autoload
(defun +emacs-lisp-lookup-definition (thing) (defun +emacs-lisp-lookup-definition (_thing)
"Lookup definition of THING." "Lookup definition of THING."
(if-let (module (+emacs-lisp--module-at-point)) (if-let (module (+emacs-lisp--module-at-point))
(doom/help-modules (car module) (cadr module) 'visit-dir) (doom/help-modules (car module) (cadr module) 'visit-dir)

View file

@ -4,8 +4,15 @@ This module adds support for various statistics languages, including R, S-Plus,
SAS, Julia and Stata. SAS, Julia and Stata.
* Table of Contents :TOC: * Table of Contents :TOC:
- [[Appendix][Appendix]] - [[#prequisites][Prequisites]]
- [[Keybindings][Keybindings]] - [[#appendix][Appendix]]
- [[#keybindings][Keybindings]]
* Prequisites
This module has several optional dependencies:
+ [[https://github.com/jimhester/lintr][lintr]]: Enables R linting.
+ [[https://github.com/REditorSupport/languageserver][languageserver]]: Enables LSP support in an R buffer (with =+lsp= flag).
* Appendix * Appendix
** Keybindings ** Keybindings

View file

@ -19,6 +19,10 @@
ess-style 'DEFAULT ess-style 'DEFAULT
ess-history-directory (expand-file-name "ess-history/" doom-cache-dir)) ess-history-directory (expand-file-name "ess-history/" doom-cache-dir))
(set-docsets! 'ess-r-mode "R")
(when (featurep! +lsp)
(add-hook 'ess-r-mode-local-vars-hook #'lsp!))
(set-repl-handler! 'ess-r-mode #'+ess/open-r-repl) (set-repl-handler! 'ess-r-mode #'+ess/open-r-repl)
(set-repl-handler! 'ess-julia-mode #'+ess/open-julia-repl) (set-repl-handler! 'ess-julia-mode #'+ess/open-julia-repl)
(set-lookup-handlers! '(ess-r-mode ess-julia-mode) (set-lookup-handlers! '(ess-r-mode ess-julia-mode)
@ -34,25 +38,26 @@
comment-line-break-function nil) comment-line-break-function nil)
(map! (:after ess-help (map! (:after ess-help
:map ess-help-mode-map (:map ess-help-mode-map
:n "q" #'kill-current-buffer :n "q" #'kill-current-buffer
:n "Q" #'ess-kill-buffer-and-go :n "Q" #'ess-kill-buffer-and-go
:n "K" #'ess-display-help-on-object :n "K" #'ess-display-help-on-object
:n "go" #'ess-display-help-in-browser :n "go" #'ess-display-help-in-browser
:n "gO" #'ess-display-help-apropos :n "gO" #'ess-display-help-apropos
:n "gv" #'ess-display-vignettes :n "gv" #'ess-display-vignettes
:m "]]" #'ess-skip-to-next-section :m "]]" #'ess-skip-to-next-section
:m "[[" #'ess-skip-to-previous-section :m "[[" #'ess-skip-to-previous-section)
:map ess-doc-map (:map ess-doc-map
"h" #'ess-display-help-on-object "h" #'ess-display-help-on-object
"p" #'ess-R-dv-pprint "p" #'ess-R-dv-pprint
"t" #'ess-R-dv-ctable "t" #'ess-R-dv-ctable
[C-return] #'ess-eval-line [up] #'comint-next-input
[up] #'comint-next-input [down] #'comint-previous-input
[down] #'comint-previous-input) [C-return] #'ess-eval-line))
:localleader
:map ess-mode-map :map ess-mode-map
:n [C-return] #'ess-eval-line
:localleader
"," #'ess-eval-region-or-function-or-paragraph-and-step "," #'ess-eval-region-or-function-or-paragraph-and-step
"'" #'R "'" #'R
[tab] #'ess-switch-to-inferior-or-script-buffer [tab] #'ess-switch-to-inferior-or-script-buffer

View file

@ -1,13 +1,13 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; lang/haskell/packages.el ;;; lang/haskell/packages.el
(package! haskell-mode :pin "3cf99d7f0e") (package! haskell-mode :pin "4a87d72589")
(when (featurep! +dante) (when (featurep! +dante)
(package! dante :pin "3e532e8d7e") (package! dante :pin "4955bc7363")
(package! attrap :pin "4cf3e4a162")) (package! attrap :pin "4cf3e4a162"))
(when (featurep! +lsp) (when (featurep! +lsp)
(package! lsp-haskell :pin "6d481f97e6")) (package! lsp-haskell :pin "6d481f97e6"))
;; DEPRECATED ;; DEPRECATED
(when (featurep! +intero) (when (featurep! +intero)
(package! intero :pin "30d8e7330c")) (package! intero :pin "fdb0550a2d"))

View file

@ -4,8 +4,7 @@
(add-hook 'idris-mode-hook #'turn-on-idris-simple-indent) (add-hook 'idris-mode-hook #'turn-on-idris-simple-indent)
(set-repl-handler! 'idris-mode 'idris-pop-to-repl) (set-repl-handler! 'idris-mode 'idris-pop-to-repl)
(set-lookup-handlers! 'idris-mode (set-lookup-handlers! 'idris-mode
:documentation #'idris-docs-at-point :documentation #'idris-docs-at-point)
:file #'idris-load-file)
(map! :localleader (map! :localleader
:map idris-mode-map :map idris-mode-map
"r" #'idris-load-file "r" #'idris-load-file

View file

@ -284,7 +284,13 @@ to tide."
;;; Projects ;;; Projects
(def-project-mode! +javascript-npm-mode (def-project-mode! +javascript-npm-mode
:modes '(html-mode css-mode web-mode markdown-mode js-mode typescript-mode) :modes '(html-mode
css-mode
web-mode
markdown-mode
js-mode
typescript-mode
solidity-mode)
:when (locate-dominating-file default-directory "package.json") :when (locate-dominating-file default-directory "package.json")
:add-hooks '(+javascript-add-node-modules-path-h npm-mode)) :add-hooks '(+javascript-add-node-modules-path-h npm-mode))

View file

@ -48,8 +48,11 @@ If no viewers are found, `latex-preview-pane' is used.")
(setq-default TeX-master t) (setq-default TeX-master t)
;; set-up chktex ;; set-up chktex
(setcar (cdr (assoc "Check" TeX-command-list)) "chktex -v6 -H %s") (setcar (cdr (assoc "Check" TeX-command-list)) "chktex -v6 -H %s")
;; tell emacs how to parse tex files (setq-hook! 'TeX-mode-hook
(setq-hook! 'TeX-mode-hook ispell-parser 'tex) ;; tell emacs how to parse tex files
ispell-parser 'tex
;; Don't auto-fill in math blocks
fill-nobreak-predicate (cons #'texmathp fill-nobreak-predicate))
;; Enable word wrapping ;; Enable word wrapping
(add-hook 'TeX-mode-hook #'visual-line-mode) (add-hook 'TeX-mode-hook #'visual-line-mode)
;; Fold TeX macros ;; Fold TeX macros

View file

@ -15,7 +15,7 @@
(when (featurep! :completion company) (when (featurep! :completion company)
(package! company-auctex :pin "48c42c58ce") (package! company-auctex :pin "48c42c58ce")
(package! company-reftex :pin "33935e9654") (package! company-reftex :pin "33935e9654")
(package! company-math :pin "600e494496")) (package! company-math :pin "a796053590"))
(when (featurep! :completion ivy) (when (featurep! :completion ivy)
(package! ivy-bibtex :pin "d4471232be")) (package! ivy-bibtex :pin "d4471232be"))
(when (featurep! :completion helm) (when (featurep! :completion helm)

View file

@ -1,23 +1,30 @@
;;; lang/ledger/config.el -*- lexical-binding: t; -*- ;;; lang/ledger/config.el -*- lexical-binding: t; -*-
;;;###package ledger-mode (use-package! ledger-mode
(setq ledger-clear-whole-transactions 1) :defer t
:init
(setq ledger-clear-whole-transactions 1
ledger-mode-should-check-version nil)
(defadvice! +ledger--check-version-a (orig-fn) :config
"Fail gracefully if ledger binary isn't available." (setq ledger-binary-path
:around #'ledger-check-version (if (executable-find "hledger")
(if (executable-find ledger-binary-path) "hledger"
(funcall orig-fn) "ledger"))
(message "Couldn't find '%s' executable" ledger-binary-path)))
;; Restore leader key in ledger reports (defadvice! +ledger--check-version-a (orig-fn)
(map! :after ledger-mode "Fail gracefully if ledger binary isn't available."
:map ledger-report-mode-map :around #'ledger-check-version
"C-c C-c" #'ledger-report-edit-report (if (executable-find ledger-binary-path)
"C-c C-r" #'ledger-report-redo (funcall orig-fn)
"C-c C-s" #'ledger-report-save (message "Couldn't find '%s' executable" ledger-binary-path)))
:map ledger-reconcile-mode-map
[tab] #'ledger-reconcile-toggle) (map! :map ledger-report-mode-map
"C-c C-c" #'ledger-report-edit-report
"C-c C-r" #'ledger-report-redo
"C-c C-s" #'ledger-report-save
:map ledger-reconcile-mode-map
[tab] #'ledger-reconcile-toggle))
(use-package! flycheck-ledger (use-package! flycheck-ledger

View file

@ -46,7 +46,13 @@ capture, the end position, and the output buffer.")
(set-flyspell-predicate! '(markdown-mode gfm-mode) (set-flyspell-predicate! '(markdown-mode gfm-mode)
#'+markdown-flyspell-word-p) #'+markdown-flyspell-word-p)
(set-lookup-handlers! '(markdown-mode gfm-mode) (set-lookup-handlers! '(markdown-mode gfm-mode)
:file #'markdown-follow-thing-at-point) ;; `markdown-follow-thing-at-point' may open an external program or a
;; buffer. No good way to tell, so pretend it's async.
:file '(markdown-follow-thing-at-point :async t))
(setq-hook! 'markdown-mode-hook
fill-nobreak-predicate (cons #'markdown-code-block-at-point-p
fill-nobreak-predicate))
;; HACK Prevent mis-fontification of YAML metadata blocks in `markdown-mode' ;; HACK Prevent mis-fontification of YAML metadata blocks in `markdown-mode'
;; which occurs when the first line contains a colon in it. See ;; which occurs when the first line contains a colon in it. See

View file

@ -6,7 +6,7 @@
(package! edit-indirect :pin "935ded353b") (package! edit-indirect :pin "935ded353b")
(when (featurep! +grip) (when (featurep! +grip)
(package! grip-mode :pin "cbf20fd131")) (package! grip-mode :pin "1a61bb71a7"))
(when (featurep! :editor evil +everywhere) (when (featurep! :editor evil +everywhere)
(package! evil-markdown (package! evil-markdown

View file

@ -39,3 +39,24 @@
((user-error "No search engine is enabled. Enable helm or ivy!"))) ((user-error "No search engine is enabled. Enable helm or ivy!")))
;; Tell lookup module to let us handle things from here ;; Tell lookup module to let us handle things from here
'deferred) 'deferred)
;;;###autoload
(defun +nix-shell-init-mode ()
"Resolve a (cached-)?nix-shell shebang to the correct major mode."
(save-excursion
(goto-char (point-min))
(save-match-data
(when (re-search-forward "#! *\\(?:cached-\\)?nix-shell +-i +\\([^ \n]+\\)" 256 t)
(let* ((interp (match-string 1))
(mode
(assoc-default
interp
(mapcar (lambda (e)
(cons (format "\\`%s\\'" (car e))
(cdr e)))
interpreter-mode-alist)
#'string-match-p)))
(when mode
(prog1 (set-auto-mode-0 mode)
(when (eq major-mode 'sh-mode)
(sh-set-shell interp)))))))))

View file

@ -1,6 +1,8 @@
;;; lang/nix/config.el -*- lexical-binding: t; -*- ;;; lang/nix/config.el -*- lexical-binding: t; -*-
(use-package! nix-mode (use-package! nix-mode
:interpreter ("cached-nix-shell" . +nix-shell-init-mode)
:interpreter ("nix-shell" . +nix-shell-init-mode)
:mode "\\.nix\\'" :mode "\\.nix\\'"
:config :config
(set-company-backend! 'nix-mode 'company-nixos-options) (set-company-backend! 'nix-mode 'company-nixos-options)

View file

@ -53,7 +53,7 @@
(after! tuareg (after! tuareg
(set-company-backend! 'tuareg-mode 'merlin-company-backend) (set-company-backend! 'tuareg-mode 'merlin-company-backend)
(set-lookup-handlers! 'tuareg-mode (set-lookup-handlers! 'tuareg-mode :async t
:definition #'merlin-locate :definition #'merlin-locate
:references #'merlin-occurrences :references #'merlin-occurrences
:documentation #'merlin-document)) :documentation #'merlin-document))

View file

@ -9,10 +9,13 @@
if (buffer-local-value 'org-tree-slide-mode buf) if (buffer-local-value 'org-tree-slide-mode buf)
return t) return t)
(org-tree-slide-mode -1) (org-tree-slide-mode -1)
(remove-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode))) (remove-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode
'local)))
(defun +org-present--make-invisible (beg end) (defun +org-present--make-invisible (beg end)
(let ((overlay (make-overlay beg end))) (unless (assq '+org-present buffer-invisibility-spec)
(add-to-invisibility-spec '(+org-present)))
(let ((overlay (make-overlay beg (1+ end))))
(push overlay +org-present--overlays) (push overlay +org-present--overlays)
(overlay-put overlay 'invisible '+org-present))) (overlay-put overlay 'invisible '+org-present)))
@ -21,19 +24,21 @@
;;; Hooks ;;; Hooks
;;;###autoload ;;;###autoload
(defun +org-present-add-overlays-h () (defun +org-present-hide-blocks-h ()
"TODO" "Hide org #+ constructs."
(add-to-invisibility-spec '(+org-present))
(save-excursion (save-excursion
;; hide org-mode options starting with #+
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward "^[[:space:]]*\\(#\\+\\)\\(\\(?:BEGIN\\|END\\|ATTR\\)[^[:space:]]+\\).*" nil t) (while (re-search-forward "^[[:space:]]*\\(#\\+\\)\\(\\(?:BEGIN\\|END\\|ATTR\\)[^[:space:]]+\\).*" nil t)
(+org-present--make-invisible (+org-present--make-invisible
(match-beginning 1) (match-beginning 1)
(match-end 0))) (match-end 0)))))
;; hide stars in headings
;;;###autoload
(defun +org-present-hide-leading-stars-h ()
"Hide leading stars in headings."
(save-excursion
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward "^\\(\\*+\\s-\\)" nil t) (while (re-search-forward "^\\(\\*+\\)" nil t)
(+org-present--make-invisible (match-beginning 1) (match-end 1))))) (+org-present--make-invisible (match-beginning 1) (match-end 1)))))
;;;###autoload ;;;###autoload
@ -55,43 +60,35 @@
(defvar cwm-left-fringe-ratio) (defvar cwm-left-fringe-ratio)
(defvar cwm-centered-window-width) (defvar cwm-centered-window-width)
;;;###autoload ;;;###autoload
(defun +org-present-init-org-tree-window-h () (defun +org-present-prettify-slide-h ()
"TODO" "TODO"
"Set up the org window for presentation." "Set up the org window for presentation."
(doom/window-maximize-buffer) (doom/window-maximize-buffer)
(let ((arg (if org-tree-slide-mode +1 -1))) (let ((arg (if org-tree-slide-mode +1 -1)))
(when (fboundp 'centered-window-mode) (when (fboundp 'centered-window-mode)
(let ((cwm-use-vertical-padding t) (setq-local cwm-use-vertical-padding t)
(cwm-frame-internal-border 110) (setq-local cwm-frame-internal-border 100)
(cwm-left-fringe-ratio -10) (setq-local cwm-left-fringe-ratio -10)
(cwm-centered-window-width 240)) (setq-local cwm-centered-window-width 300)
(centered-window-mode arg))) (centered-window-mode arg))
(window-divider-mode (* arg -1))
(hide-mode-line-mode arg) (hide-mode-line-mode arg)
(+org-pretty-mode arg) (+org-pretty-mode arg)
(cond (org-tree-slide-mode (cond (org-tree-slide-mode
(org-indent-mode -1) (set-window-fringes nil 0 0)
(when (bound-and-true-p solaire-mode)
(solaire-mode -1)
(fringe-mode 0))
(when (bound-and-true-p flyspell-mode)
(flyspell-mode -1))
(add-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode
nil 'local)
(text-scale-set +org-present-text-scale) (text-scale-set +org-present-text-scale)
(ignore-errors (org-latex-preview '(4))) (ignore-errors (org-latex-preview '(4))))
(set-face-attribute 'org-level-2 nil :height 1.4))
(t (t
(org-indent-mode +1)
(text-scale-set 0) (text-scale-set 0)
(set-window-fringes nil fringe-mode fringe-mode)
(org-clear-latex-preview) (org-clear-latex-preview)
(set-face-attribute 'org-level-2 nil :height 1.0)
(+org-present-remove-overlays-h) (+org-present-remove-overlays-h)
(org-remove-inline-images))))) (org-remove-inline-images)
(org-mode)))
(redraw-display)))
;;
;;; Commands
(defvar +org-present--overlays nil)
;;;###autoload
(defun +org-present/start ()
"TODO"
(interactive)
(unless (derived-mode-p 'org-mode)
(error "Not in an org buffer"))
(call-interactively #'org-tree-slide-mode)
(add-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode))

View file

@ -988,4 +988,10 @@ compelling reason, so..."
org-id-locations-file (concat org-directory ".orgids") org-id-locations-file (concat org-directory ".orgids")
org-id-locations-file-relative t) org-id-locations-file-relative t)
;; HACK `org-id' doesn't check if `org-id-locations-file' exists or is
;; writeable before trying to read/write to it.
(defadvice! +org--fail-gracefully-a (&rest _)
:before-while '(org-id-locations-save org-id-locations-load)
(file-exists-p org-id-locations-file))
(add-hook 'org-open-at-point-functions #'doom-set-jump-h)) (add-hook 'org-open-at-point-functions #'doom-set-jump-h))

View file

@ -1,7 +1,7 @@
;;; lang/org/contrib/present.el -*- lexical-binding: t; -*- ;;; lang/org/contrib/present.el -*- lexical-binding: t; -*-
;;;###if (featurep! +present) ;;;###if (featurep! +present)
(defvar +org-present-text-scale 7 (defvar +org-present-text-scale 6
"The `text-scale-amount' for `org-tree-slide-mode'.") "The `text-scale-amount' for `org-tree-slide-mode'.")
(after! ox (after! ox
@ -24,31 +24,37 @@
(setq org-tree-slide-skip-outline-level 2 (setq org-tree-slide-skip-outline-level 2
org-tree-slide-activate-message " " org-tree-slide-activate-message " "
org-tree-slide-deactivate-message " " org-tree-slide-deactivate-message " "
org-tree-slide-modeline-display nil) org-tree-slide-modeline-display nil
org-tree-slide-heading-emphasis t)
(map! :map org-tree-slide-mode-map (add-hook 'org-tree-slide-mode-after-narrow-hook #'org-display-inline-images)
:n [right] #'org-tree-slide-move-next-tree (add-hook! 'org-tree-slide-mode-hook
:n [left] #'org-tree-slide-move-previous-tree) #'+org-present-hide-blocks-h
#'+org-present-prettify-slide-h)
(add-hook! 'org-tree-slide-mode-after-narrow-hook (when (featurep! :editor evil)
#'+org-present-detect-slide-h (map! :map org-tree-slide-mode-map
#'+org-present-add-overlays-h :n [C-right] #'org-tree-slide-move-next-tree
#'org-display-inline-images) :n [C-left] #'org-tree-slide-move-previous-tree)
(add-hook 'org-tree-slide-mode-hook #'evil-normalize-keymaps))
(add-hook 'org-tree-slide-mode-hook #'+org-present-init-org-tree-window-h)
(defadvice! +org-present--narrow-to-subtree-a (orig-fn &rest args) (defadvice! +org-present--narrow-to-subtree-a (orig-fn &rest args)
"Narrow to the target subtree when you start the presentation." "Narrow to the target subtree when you start the presentation."
:around #'org-tree-slide--display-tree-with-narrow :around #'org-tree-slide--display-tree-with-narrow
(cl-letf (((symbol-function #'org-narrow-to-subtree) (cl-letf (((symbol-function #'org-narrow-to-subtree)
(lambda () (save-excursion (lambda ()
(save-match-data (save-excursion
(org-with-limited-levels (save-match-data
(narrow-to-region (org-with-limited-levels
(progn (org-back-to-heading t) (narrow-to-region
(forward-line 1) (progn
(point)) (when (org-before-first-heading-p)
(progn (org-end-of-subtree t t) (org-next-visible-heading 1))
(when (and (org-at-heading-p) (not (eobp))) (backward-char 1)) (ignore-errors (org-up-heading-all 99))
(point))))))))) (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)))) (apply orig-fn args))))

View file

@ -27,7 +27,7 @@
:recipe (:host github :recipe (:host github
:repo "emacs-straight/org-mode" :repo "emacs-straight/org-mode"
:files ("*.el" "lisp/*.el" "contrib/lisp/*.el")) :files ("*.el" "lisp/*.el" "contrib/lisp/*.el"))
:pin "cd1014a75a") :pin "ec6d01fd49")
;; ...And prevent other packages from pulling org; org-plus-contrib satisfies ;; ...And prevent other packages from pulling org; org-plus-contrib satisfies
;; the dependency already: https://github.com/raxod502/straight.el/issues/352 ;; the dependency already: https://github.com/raxod502/straight.el/issues/352
(package! org :recipe (:local-repo nil)) (package! org :recipe (:local-repo nil))
@ -56,7 +56,7 @@
(when (featurep! +brain) (when (featurep! +brain)
(package! org-brain :pin "8cb2efc860")) (package! org-brain :pin "8cb2efc860"))
(when (featurep! +dragndrop) (when (featurep! +dragndrop)
(package! org-download :pin "aad18aecef")) (package! org-download :pin "70401884e9"))
(when (featurep! +gnuplot) (when (featurep! +gnuplot)
(package! gnuplot :pin "a406143d52") (package! gnuplot :pin "a406143d52")
(package! gnuplot-mode :pin "601f639298")) (package! gnuplot-mode :pin "601f639298"))
@ -71,9 +71,9 @@
:recipe (:host github :repo "anler/centered-window-mode") :recipe (:host github :repo "anler/centered-window-mode")
:pin "24f7c5be9d") :pin "24f7c5be9d")
(package! org-tree-slide :pin "7bf09a02bd") (package! org-tree-slide :pin "7bf09a02bd")
(package! org-re-reveal :pin "29bc467201")) (package! org-re-reveal :pin "14df7542f2"))
(when (featurep! +journal) (when (featurep! +journal)
(package! org-journal :pin "cf0f15386f")) (package! org-journal :pin "128f0533a7"))
;;; Babel ;;; Babel
(package! ob-async :pin "80a30b96a0") (package! ob-async :pin "80a30b96a0")
@ -100,6 +100,6 @@
(when (featurep! +hugo) (when (featurep! +hugo)
(package! ox-hugo (package! ox-hugo
:recipe (:host github :repo "kaushalmodi/ox-hugo" :nonrecursive t) :recipe (:host github :repo "kaushalmodi/ox-hugo" :nonrecursive t)
:pin "0530645d73")) :pin "a80b250987"))
(when (featurep! :lang rst) (when (featurep! :lang rst)
(package! ox-rst :pin "9158bfd180")) (package! ox-rst :pin "9158bfd180"))

View file

@ -28,8 +28,10 @@
(add-hook 'rustic-mode-hook #'rainbow-delimiters-mode) (add-hook 'rustic-mode-hook #'rainbow-delimiters-mode)
(when (featurep! +lsp) (if (featurep! +lsp)
(add-hook 'rustic-mode-local-vars-hook #'lsp!)) (add-hook 'rustic-mode-local-vars-hook #'lsp!)
(after! rustic-flycheck
(add-to-list 'flycheck-checkers 'rustic-clippy)))
(map! :map rustic-mode-map (map! :map rustic-mode-map
:localleader :localleader

View file

@ -1,6 +1,6 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; lang/rust/packages.el ;;; lang/rust/packages.el
(package! rustic :pin "a6b8cd8db8") (package! rustic :pin "da3820de18")
(unless (featurep! +lsp) (unless (featurep! +lsp)
(package! racer :pin "a0bdf778f0")) (package! racer :pin "a0bdf778f0"))

View file

@ -11,6 +11,7 @@
:when (featurep! :checkers syntax) :when (featurep! :checkers syntax)
:after solidity-mode :after solidity-mode
:config :config
(set-docsets! 'solidity-mode "Solidity")
(setq flycheck-solidity-solc-addstd-contracts t) (setq flycheck-solidity-solc-addstd-contracts t)
(when (funcall flycheck-executable-find solidity-solc-path) (when (funcall flycheck-executable-find solidity-solc-path)
(add-to-list 'flycheck-checkers 'solidity-checker nil #'eq)) (add-to-list 'flycheck-checkers 'solidity-checker nil #'eq))

View file

@ -6,33 +6,35 @@
(defvar company-pcomplete-available 'unknown) (defvar company-pcomplete-available 'unknown)
(defun company-pcomplete--prefix () (defun company-pcomplete--prefix ()
(let* ((pcomplete-stub) (with-no-warnings
pcomplete-seen (let* ((pcomplete-stub)
pcomplete-norm-func pcomplete-seen
pcomplete-args pcomplete-norm-func
pcomplete-last pcomplete-index pcomplete-args
(pcomplete-autolist pcomplete-autolist) pcomplete-last pcomplete-index
(pcomplete-suffix-list pcomplete-suffix-list)) (pcomplete-autolist pcomplete-autolist)
(pcomplete-completions) (pcomplete-suffix-list pcomplete-suffix-list))
(buffer-substring (pcomplete-begin) (point)))) (pcomplete-completions)
(buffer-substring (pcomplete-begin) (point)))))
(defun company-pcomplete--candidates () (defun company-pcomplete--candidates ()
(let* ((pcomplete-stub) (with-no-warnings
(pcomplete-show-list t) (let* ((pcomplete-stub)
pcomplete-seen pcomplete-norm-func (pcomplete-show-list t)
pcomplete-args pcomplete-last pcomplete-index pcomplete-seen pcomplete-norm-func
(pcomplete-autolist pcomplete-autolist) pcomplete-args pcomplete-last pcomplete-index
(pcomplete-suffix-list pcomplete-suffix-list) (pcomplete-autolist pcomplete-autolist)
(candidates (pcomplete-completions)) (pcomplete-suffix-list pcomplete-suffix-list)
(prefix (buffer-substring (pcomplete-begin) (point))) (candidates (pcomplete-completions))
;; Collect all possible completions for the current stub (prefix (buffer-substring (pcomplete-begin) (point)))
(cnds (all-completions pcomplete-stub candidates)) ;; Collect all possible completions for the current stub
(bnds (completion-boundaries pcomplete-stub candidates nil "")) (cnds (all-completions pcomplete-stub candidates))
(skip (- (length pcomplete-stub) (car bnds)))) (bnds (completion-boundaries pcomplete-stub candidates nil ""))
;; Replace the stub at the beginning of each candidate by the prefix (skip (- (length pcomplete-stub) (car bnds))))
(mapcar (lambda (cand) ;; Replace the stub at the beginning of each candidate by the prefix
(concat prefix (substring cand skip))) (mapcar (lambda (cand)
cnds))) (concat prefix (substring cand skip)))
cnds))))
;;;###autoload ;;;###autoload
(defun company-pcomplete-available () (defun company-pcomplete-available ()

View file

@ -13,10 +13,8 @@
;; Prevent premature horizontal scrolling ;; Prevent premature horizontal scrolling
hscroll-margin 0) hscroll-margin 0)
(setq vterm-kill-buffer-on-exit t)
(add-hook 'vterm-mode-hook #'doom-mark-buffer-as-real-h) (add-hook 'vterm-mode-hook #'doom-mark-buffer-as-real-h)
;; Automatically kill buffer when vterm exits.
(add-hook! 'vterm-exit-functions
(defun +vterm-kill-buffer-on-quit-fn (buffer event)
(if buffer (kill-buffer buffer))))
;; Modeline serves no purpose in vterm ;; Modeline serves no purpose in vterm
(add-hook 'vterm-mode-hook #'hide-mode-line-mode)) (add-hook 'vterm-mode-hook #'hide-mode-line-mode))

View file

@ -3,4 +3,4 @@
(package! vterm (package! vterm
:built-in 'prefer :built-in 'prefer
:pin "a970b4f472") :pin "4fbf8f89ff")

View file

@ -1,69 +1,34 @@
;;; tools/direnv/config.el -*- lexical-binding: t; -*- ;;; tools/direnv/config.el -*- lexical-binding: t; -*-
(defvar +direnv--keywords (defvar +direnv-keywords
'("direnv_layout_dir" "PATH_add" "path_add" "log_status" "log_error" "has" '("direnv_layout_dir" "PATH_add" "path_add" "log_status" "log_error" "has"
"join_args" "expand_path" "dotenv" "user_rel_path" "find_up" "source_env" "join_args" "expand_path" "dotenv" "user_rel_path" "find_up" "source_env"
"watch_file" "source_up" "direnv_load" "MANPATH_add" "load_prefix" "layout" "watch_file" "source_up" "direnv_load" "MANPATH_add" "load_prefix" "layout"
"use" "rvm" "use_nix" "use_guix") "use" "rvm" "use_nix" "use_guix")
"TODO") "TODO")
;;
;;; Packages
(use-package! direnv (use-package! direnv
:after-call after-find-file dired-initial-position-hook :hook (before-hack-local-variables . direnv--maybe-update-environment)
:hook (flycheck-before-syntax-check . direnv--maybe-update-environment)
:hook (direnv-envrc-mode . +direnv-envrc-fontify-keywords-h)
:config :config
(add-hook! 'direnv-mode-hook (add-to-list 'direnv-non-file-modes 'vterm-mode)
(defun +direnv-init-h ()
"Instead of checking for direnv on `post-command-hook', check only once,
when the file is first opened/major mode is activated. This is significantly
less expensive, but is less sensitive to changes to .envrc done outside of
Emacs."
(direnv--disable)
(funcall (if direnv-mode 'add-hook 'remove-hook)
'after-change-major-mode-hook
#'direnv--maybe-update-environment)))
(defadvice! +direnv--make-process-environment-buffer-local-a (items) (defun +direnv-envrc-fontify-keywords-h ()
:filter-return #'direnv--export "Fontify special .envrc keywords; it's a good indication of whether or not
(when items we've typed them correctly."
(mapc 'kill-local-variable '(process-environment exec-path)) (font-lock-add-keywords
(mapc 'make-local-variable '(process-environment exec-path))) nil `((,(regexp-opt +direnv-keywords 'symbols)
items) (0 font-lock-keyword-face)))))
;; Fontify special .envrc keywords; it's a good indication of whether or not (defadvice! +direnv--fail-gracefully-a (&rest _)
;; we've typed them correctly. "Don't try to use direnv if the executable isn't present."
(add-hook! 'direnv-envrc-mode-hook :before-while #'direnv-update-directory-environment
(defun +direnv-envrc-fontify-keywords-h () (or (executable-find "direnv")
(font-lock-add-keywords (ignore (doom-log "Couldn't find direnv executable"))))
nil `((,(regexp-opt +direnv--keywords 'symbols)
(0 font-lock-keyword-face)))))
(defun +direnv-update-on-save-h ()
(add-hook 'after-save-hook #'direnv--maybe-update-environment
nil 'local)))
(defadvice! +direnv-update-a (&rest _)
"Update direnv. Useful to advise functions that may run
environment-sensitive logic like `flycheck-default-executable-find'. This fixes
flycheck issues with direnv and on nix."
:before #'flycheck-default-executable-find
(direnv--maybe-update-environment))
(defadvice! +direnv--fail-gracefully-a (orig-fn)
"Don't try to update direnv if the executable isn't present."
:around #'direnv--maybe-update-environment
(if (executable-find "direnv")
(when (file-readable-p (or buffer-file-name default-directory))
(funcall orig-fn))
(doom-log "Couldn't find direnv executable")))
(defadvice! +direnv-update-async-shell-command-a (command &optional output-buffer _error-buffer)
:before #'shell-command
(when (string-match "[ \t]*&[ \t]*\\'" command)
(let ((environment process-environment)
(path exec-path)
(shell shell-file-name))
(with-current-buffer
(get-buffer-create (or output-buffer "*Async Shell Command*"))
(setq-local process-environment environment)
(setq-local exec-path path)
(setq-local shell-file-name shell)))))
(direnv-mode +1)) (direnv-mode +1))

View file

@ -281,34 +281,16 @@ Otherwise, falls back on `find-file-at-point'."
(if ffap-url-regexp "Find file or URL: " "Find file: ") (if ffap-url-regexp "Find file or URL: " "Find file: ")
(doom-thing-at-point-or-region)))))) (doom-thing-at-point-or-region))))))
(require 'ffap) (require 'ffap)
(cond ((not path) (cond ((and path
(call-interactively #'find-file-at-point)) buffer-file-name
(file-equal-p path buffer-file-name)
(user-error "Already here")))
((ffap-url-p path) ((+lookup--jump-to :file path))
(find-file-at-point path))
((not (+lookup--jump-to :file path)) ((stringp path) (find-file-at-point path))
(let ((fullpath (doom-path path)))
(when (and buffer-file-name (file-equal-p fullpath buffer-file-name)) ((call-interactively #'find-file-at-point))))
(user-error "Already here"))
(let* ((insert-default-directory t)
(project-root (doom-project-root))
(ffap-file-finder
(cond ((not (doom-glob fullpath))
#'find-file)
((ignore-errors (file-in-directory-p fullpath project-root))
(lambda (dir)
(let* ((default-directory dir)
projectile-project-name
projectile-project-root
(projectile-project-root-cache (make-hash-table :test 'equal))
(file (projectile-completing-read "Find file: "
(projectile-current-project-files)
:initial-input path)))
(find-file (expand-file-name file (doom-project-root)))
(run-hooks 'projectile-find-file-hook))))
(#'doom-project-browse))))
(find-file-at-point path))))))
;; ;;
@ -335,7 +317,7 @@ Otherwise, falls back on `find-file-at-point'."
((user-error "No dictionary backend is available")))) ((user-error "No dictionary backend is available"))))
;;;###autoload ;;;###autoload
(defun +lookup/synonyms (identifier &optional arg) (defun +lookup/synonyms (identifier &optional _arg)
"Look up and insert a synonym for the word at point (or selection)." "Look up and insert a synonym for the word at point (or selection)."
(interactive (interactive
(list (doom-thing-at-point-or-region 'word) ; TODO actually use this (list (doom-thing-at-point-or-region 'word) ; TODO actually use this

View file

@ -8,7 +8,7 @@
(package! helm)) (package! helm))
;; ;;
(package! dumb-jump :pin "738d40ceb7") (package! dumb-jump :pin "daddd9ba6a")
(when (featurep! :completion ivy) (when (featurep! :completion ivy)
(package! ivy-xref :pin "3d4c35fe2b")) (package! ivy-xref :pin "3d4c35fe2b"))
(when (featurep! :completion helm) (when (featurep! :completion helm)
@ -26,7 +26,7 @@
(package! osx-dictionary :pin "1b79ff64c7") (package! osx-dictionary :pin "1b79ff64c7")
(package! define-word :pin "d8c76d503b") (package! define-word :pin "d8c76d503b")
(package! powerthesaurus :pin "81a262ec0c") (package! powerthesaurus :pin "81a262ec0c")
(package! request :pin "4be823a89b") (package! request)
(when (featurep! +offline) (when (featurep! +offline)
(package! wordnut :pin "feac531404") (package! wordnut :pin "feac531404")
(package! synosaurus :pin "14d34fc92a")))) (package! synosaurus :pin "14d34fc92a"))))

View file

@ -118,7 +118,12 @@ This also logs the resolved project root, if found, so we know where we are."
(lsp--flymake-setup)) (lsp--flymake-setup))
((require 'flycheck nil t) ((require 'flycheck nil t)
(require 'lsp-ui-flycheck) (require 'lsp-ui-flycheck)
(lsp-ui-flycheck-enable t))))) (let ((old-checker flycheck-checker))
(lsp-ui-flycheck-enable t)
(when old-checker
(setq-local flycheck-checker old-checker)
(kill-local-variable 'flycheck-check-syntax-automatically)))))))
:config :config
(setq lsp-prefer-flymake nil (setq lsp-prefer-flymake nil
lsp-ui-doc-max-height 8 lsp-ui-doc-max-height 8

View file

@ -1,24 +1,39 @@
;;; ui/doom/config.el -*- lexical-binding: t; -*- ;;; ui/doom/config.el -*- lexical-binding: t; -*-
(defvar +doom-solaire-themes (defvar +doom-solaire-themes
'((doom-challenger-deep . t) '((doom-acario-dark . t)
(doom-acario-light . t)
(doom-challenger-deep . t)
(doom-city-lights . t) (doom-city-lights . t)
(doom-dark+ . t)
(doom-dracula . t) (doom-dracula . t)
(doom-molokai) (doom-fairy-floss . t)
(doom-gruvbox . t) (doom-gruvbox . t)
(doom-horizon . t)
(doom-laserwave . t)
(doom-losvkem . t)
(doom-manegarm . t)
(doom-material . t)
(doom-molokai . t)
(doom-moonlight . t)
(doom-nord . t) (doom-nord . t)
(doom-nord-light . t) (doom-nord-light . t)
(doom-nova) (doom-nova . t)
(doom-oceanic-next . t)
(doom-one . t) (doom-one . t)
(doom-one-light . t) (doom-one-light . t)
(doom-outrun-electric . t)
(doom-opera . t) (doom-opera . t)
(doom-palenight . t)
(doom-peacock . t)
(doom-snazzy . t) (doom-snazzy . t)
(doom-solarized-dark . t) (doom-solarized-dark . t)
(doom-solarized-light) (doom-solarized-light)
(doom-sourcerer . t)
(doom-spacegrey . t) (doom-spacegrey . t)
(doom-tomorrow-day . t) (doom-tomorrow-day . t)
(doom-tomorrow-night . t) (doom-tomorrow-night . t)
(doom-vibrant)) (doom-vibrant . t))
"An alist of themes that support `solaire-mode'. If CDR is t, then "An alist of themes that support `solaire-mode'. If CDR is t, then
`solaire-mode-swap-bg' will be used automatically, when the theme is loaded.") `solaire-mode-swap-bg' will be used automatically, when the theme is loaded.")

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 "d48df7b02e") (package! doom-themes :pin "7131b60161")
(package! solaire-mode :pin "4ac324ccb0") (package! solaire-mode :pin "4ac324ccb0")

View file

@ -21,14 +21,10 @@ Meant for `doom-change-font-size-hook'."
(setq +modeline--old-bar-height doom-modeline-height)) (setq +modeline--old-bar-height doom-modeline-height))
(let ((default-height +modeline--old-bar-height) (let ((default-height +modeline--old-bar-height)
(scale (or (frame-parameter nil 'font-scale) 0))) (scale (or (frame-parameter nil 'font-scale) 0)))
(if (> scale 0) (setq doom-modeline-height
(let ((font-size (string-to-number (if (> scale 0)
(aref (doom--font-name (frame-parameter nil 'font) (+ default-height (* scale doom-font-increment))
(selected-frame)) default-height))))
xlfd-regexp-pixelsize-subnum)))
(scale (frame-parameter nil 'font-scale)))
(setq doom-modeline-height (+ default-height (* scale doom-font-increment))))
(setq doom-modeline-height default-height))))
;;;###autoload ;;;###autoload
(defun +modeline-update-env-in-all-windows-h (&rest _) (defun +modeline-update-env-in-all-windows-h (&rest _)

View file

@ -58,19 +58,6 @@
(doom-modeline-set-project-modeline) (doom-modeline-set-project-modeline)
(hide-mode-line-mode)))) (hide-mode-line-mode))))
;; Remove unused segments & extra padding
(doom-modeline-def-modeline 'main
'(bar window-number matches buffer-info remote-host buffer-position selection-info)
'(objed-state misc-info persp-name irc mu4e github debug input-method buffer-encoding lsp major-mode process vcs checker))
(doom-modeline-def-modeline 'special
'(bar window-number matches buffer-info-simple buffer-position selection-info)
'(objed-state misc-info persp-name debug input-method irc-buffers buffer-encoding lsp major-mode process checker))
(doom-modeline-def-modeline 'project
'(bar window-number buffer-default-directory)
'(misc-info mu4e github debug battery " " major-mode process))
;; Some functions modify the buffer, causing the modeline to show a false ;; Some functions modify the buffer, causing the modeline to show a false
;; modified state, so force them to behave. ;; modified state, so force them to behave.
(defadvice! +modeline--inhibit-modification-hooks-a (orig-fn &rest args) (defadvice! +modeline--inhibit-modification-hooks-a (orig-fn &rest args)

View file

@ -2,7 +2,7 @@
;;; ui/modeline/packages.el ;;; ui/modeline/packages.el
(unless (featurep! +light) (unless (featurep! +light)
(package! doom-modeline :pin "21ac606325")) (package! doom-modeline :pin "31a5ae99b8"))
(package! anzu :pin "592f8ee6d0") (package! anzu :pin "592f8ee6d0")
(when (featurep! :editor evil) (when (featurep! :editor evil)
(package! evil-anzu :pin "9bca6ca14d")) (package! evil-anzu :pin "9bca6ca14d"))

View file

@ -68,13 +68,14 @@ error if NAME doesn't exist."
"Return a list of workspace structs (satisifes `+workspace-p')." "Return a list of workspace structs (satisifes `+workspace-p')."
;; We don't use `hash-table-values' because it doesn't ensure order in older ;; We don't use `hash-table-values' because it doesn't ensure order in older
;; versions of Emacs ;; versions of Emacs
(cdr (cl-loop for persp being the hash-values of *persp-hash* (cl-loop for name in persp-names-cache
collect persp))) if (gethash name *persp-hash*)
collect it))
;;;###autoload ;;;###autoload
(defun +workspace-list-names () (defun +workspace-list-names ()
"Return the list of names of open workspaces." "Return the list of names of open workspaces."
(mapcar #'safe-persp-name (+workspace-list))) persp-names-cache)
;;;###autoload ;;;###autoload
(defun +workspace-buffer-list (&optional persp) (defun +workspace-buffer-list (&optional persp)
@ -403,6 +404,31 @@ the next."
((+workspace-error "Can't delete last workspace" t))))))) ((+workspace-error "Can't delete last workspace" t)))))))
;;;###autoload
(defun +workspace/swap-left (&optional count)
"Swap the current workspace with the COUNTth workspace on its left."
(interactive "p")
(let* ((current-name (+workspace-current-name))
(count (or count 1))
(index (- (cl-position current-name persp-names-cache :test #'equal)
count))
(names (remove current-name persp-names-cache)))
(unless names
(user-error "Only one workspace"))
(let ((index (min (max 0 index) (length names))))
(setq persp-names-cache
(append (cl-subseq names 0 index)
(list current-name)
(cl-subseq names index))))
(when (called-interactively-p 'any)
(+workspace/display))))
;;;###autoload
(defun +workspace/swap-right (&optional count)
"Swap the current workspace with the COUNTth workspace on its right."
(interactive "p")
(funcall-interactively #'+workspace/swap-left (- count)))
;; ;;
;;; Tabs display in minibuffer ;;; Tabs display in minibuffer

View file

@ -76,10 +76,13 @@ stored in `persp-save-dir'.")
"Ensure a main workspace exists." "Ensure a main workspace exists."
(when persp-mode (when persp-mode
(let (persp-before-switch-functions) (let (persp-before-switch-functions)
;; The default perspective persp-mode creates (`persp-nil-name') is ;; The default perspective persp-mode creates is special and doesn't
;; special and doesn't represent a real persp object, so buffers can't ;; represent a real persp object, so buffers can't really be assigned
;; really be assigned to it, among other quirks. We create a *real* main ;; to it, among other quirks. We hide the nil persp...
;; workspace to fill this role. (when (equal (car persp-names-cache) persp-nil-name)
(pop persp-names-cache))
;; ...and create a *real* main workspace to fill this role, and hide
;; the nil perspective.
(unless (or (persp-get-by-name +workspaces-main) (unless (or (persp-get-by-name +workspaces-main)
;; Start from 2 b/c persp-mode counts the nil workspace ;; Start from 2 b/c persp-mode counts the nil workspace
(> (hash-table-count *persp-hash*) 2)) (> (hash-table-count *persp-hash*) 2))

View file

@ -20,7 +20,8 @@
(defun +zen-enable-text-scaling-mode-h () (defun +zen-enable-text-scaling-mode-h ()
"Enable `mixed-pitch-mode' when in `+zen-mixed-pitch-modes'." "Enable `mixed-pitch-mode' when in `+zen-mixed-pitch-modes'."
(when (/= +zen-text-scale 0) (when (/= +zen-text-scale 0)
(text-scale-set (if writeroom-mode +zen-text-scale 0))))) (text-scale-set (if writeroom-mode +zen-text-scale 0))
(visual-fill-column-adjust))))
;; Adjust margins when text size is changed ;; Adjust margins when text size is changed
(advice-add #'text-scale-adjust :after #'visual-fill-column-adjust)) (advice-add #'text-scale-adjust :after #'visual-fill-column-adjust))