Merge branch 'develop' of https://github.com/hlissner/doom-emacs into develop

This commit is contained in:
Alex Iverson 2019-03-25 14:51:36 -06:00
commit b3594e55f7
25 changed files with 327 additions and 248 deletions

View file

@ -4,17 +4,24 @@
":"; [[ $VERSION == *\ 2[0-2].[0-1].[0-9] ]] && { echo "You're running $VERSION"; echo "That version is too old to run the doctor. Check your PATH"; echo; exit 2; } ":"; [[ $VERSION == *\ 2[0-2].[0-1].[0-9] ]] && { echo "You're running $VERSION"; echo "That version is too old to run the doctor. Check your PATH"; echo; exit 2; }
":"; exec emacs --quick --script "$0"; exit 0 ":"; exec emacs --quick --script "$0"; exit 0
;; Uses a couple simple heuristics to locate issues with your environment that ;; The Doom doctor is essentially one big, self-contained elisp shell script
;; could interfere with running or setting up DOOM Emacs. ;; that uses a series of simple heuristics to diagnose common issues on your
;; system. Issues that could intefere with Doom Emacs.
;;
;; Doom module may optionally have a doctor.el file to run their own heuristics
;; in. Doctor scripts may run in versions of Emacs as old as Emacs 23, so you
;; are limited to very basic standard library calls (e.g. avoid cl, subr-x, and
;; any Doom dependencies).
;; In case it isn't defined (in really old versions of Emacs, like the one that ;; In really old versions of Emacs `user-emacs-directory' isn't defined
;; ships with MacOS).
(defvar user-emacs-directory (expand-file-name "../" (file-name-directory load-file-name))) (defvar user-emacs-directory (expand-file-name "../" (file-name-directory load-file-name)))
(unless (file-directory-p user-emacs-directory) (unless (file-directory-p user-emacs-directory)
(error "Couldn't find a Doom config!")) (error "Couldn't find a Doom config!"))
(unless noninteractive (unless noninteractive
(error "This script must not be run from an interactive session.")) (error "This script must not be run from an interactive session."))
(when (getenv "DEBUG")
(setq debug-on-error t))
(require 'pp) (require 'pp)
@ -117,10 +124,10 @@
;; --- is emacs set up properly? ------------------------------ ;; --- is emacs set up properly? ------------------------------
(when (version< emacs-version "25.1") (when (version< emacs-version "25.3")
(error! "Important: Emacs %s detected [%s]" emacs-version (executable-find "emacs")) (error! "Important: Emacs %s detected [%s]" emacs-version (executable-find "emacs"))
(explain! (explain!
"DOOM only supports >= 25.1. Perhaps your PATH wasn't set up properly." "DOOM only supports >= 25.3. Perhaps your PATH wasn't set up properly."
(when (eq system-type 'darwin) (when (eq system-type 'darwin)
(concat "\nMacOS users should use homebrew (https://brew.sh) to install Emacs\n" (concat "\nMacOS users should use homebrew (https://brew.sh) to install Emacs\n"
" brew install emacs --with-modules --with-imagemagick --with-cocoa")))) " brew install emacs --with-modules --with-imagemagick --with-cocoa"))))
@ -166,7 +173,7 @@
font font-dest) font font-dest)
(explain! "You can install it by running `M-x all-the-icons-install-fonts' within Emacs.\n\n" (explain! "You can install it by running `M-x all-the-icons-install-fonts' within Emacs.\n\n"
"This could also mean you've installed them in non-standard locations, in which " "This could also mean you've installed them in non-standard locations, in which "
"case, ignore this warning.")))))) "case feel free to ignore this warning."))))))
;; gnutls-cli & openssl ;; gnutls-cli & openssl
(section! "Checking gnutls/openssl...") (section! "Checking gnutls/openssl...")
@ -289,6 +296,9 @@
(or (cdr-safe ex) (car ex))) (or (cdr-safe ex) (car ex)))
(setq doom-modules nil))) (setq doom-modules nil)))
(section! "Checking Doom core for irregularities...")
(load (expand-file-name "doctor.el" doom-core-dir) nil 'nomessage)
(when (bound-and-true-p doom-modules) (when (bound-and-true-p doom-modules)
(section! "Checking your enabled modules...") (section! "Checking your enabled modules...")
(let ((indent 4)) (let ((indent 4))
@ -296,22 +306,21 @@
(maphash (maphash
(lambda (key plist) (lambda (key plist)
(let ((prefix (format "%s" (color 1 "(%s %s) " (car key) (cdr key))))) (let ((prefix (format "%s" (color 1 "(%s %s) " (car key) (cdr key)))))
(condition-case ex (condition-case-unless-debug ex
(let ((doctor-file (doom-module-path (car key) (cdr key) "doctor.el")) (let ((doctor-file (doom-module-path (car key) (cdr key) "doctor.el"))
(packages-file (doom-module-path (car key) (cdr key) "packages.el")) (packages-file (doom-module-path (car key) (cdr key) "packages.el")))
doom-packages) (cl-loop with doom--stage = 'packages
(when (or (file-exists-p doctor-file) for name in (let (doom-packages
(file-exists-p packages-file)) doom-disabled-packages)
(let ((doom--stage 'packages)) (load packages-file 'noerror 'nomessage)
(when (load packages-file t t) (mapcar #'car doom-packages))
(cl-loop for (name . plist) in doom-packages unless (or (doom-package-prop name :disable)
unless (or (doom-package-prop name :disable) (doom-package-prop name :ignore t)
(doom-package-prop name :ignore t) (package-built-in-p name)
(package-built-in-p name) (package-installed-p name))
(package-installed-p name)) do (error! "%s is not installed" name))
do (error! "%s is not installed" name))) (let ((doom--stage 'doctor))
(let ((doom--stage 'doctor)) (load doctor-file 'noerror 'nomessage)))
(load doctor-file t t)))))
(file-missing (error! "%s" (error-message-string ex))) (file-missing (error! "%s" (error-message-string ex)))
(error (error! "Syntax error: %s" ex))))) (error (error! "Syntax error: %s" ex)))))
doom-modules))) doom-modules)))

View file

@ -227,9 +227,10 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(doom-visible-buffers))) (doom-visible-buffers)))
;; if we end up back where we start (or previous-buffer ;; if we end up back where we start (or previous-buffer
;; returns nil), we have nowhere left to go ;; returns nil), we have nowhere left to go
(memq (previous-buffer) (list buf 'nil))) (memq (switch-to-prev-buffer nil t) (list buf 'nil)))
(switch-to-buffer (doom-fallback-buffer)))) (switch-to-buffer (doom-fallback-buffer)))
(kill-buffer buf))) (unless (delq (selected-window) (get-buffer-window-list buf nil t))
(kill-buffer buf)))))
((funcall orig-fn))))) ((funcall orig-fn)))))
@ -251,7 +252,8 @@ If DONT-SAVE, don't prompt to save modified buffers (discarding their changes)."
(set-buffer-modified-p nil))) (set-buffer-modified-p nil)))
(kill-buffer buffer) (kill-buffer buffer)
(cl-loop for win in windows (cl-loop for win in windows
if (doom-real-buffer-p (window-buffer win)) if (and (window-live-p win)
(doom-unreal-buffer-p (window-buffer win)))
do (with-selected-window win (previous-buffer))))) do (with-selected-window win (previous-buffer)))))
;;;###autoload ;;;###autoload

View file

@ -45,7 +45,9 @@
(defun doom//upgrade (&optional yes) (defun doom//upgrade (&optional yes)
"TODO" "TODO"
(interactive "P") (interactive "P")
(doom--run "upgrade" yes)) (doom--run "upgrade" yes)
(when (y-or-n-p "You must restart Emacs for the upgrade to take effect. Restart?")
(doom/restart-and-restore)))
;;;###autoload ;;;###autoload
(defun doom//install (&optional yes) (defun doom//install (&optional yes)

View file

@ -62,7 +62,7 @@ ready to be pasted in a bug report on github."
(or (ignore-errors (or (ignore-errors
(require 'use-package) (require 'use-package)
(cl-loop for (name . plist) in (doom-find-packages :private t) (cl-loop for (name . plist) in (doom-find-packages :private t)
if (use-package-plist-delete (copy-sequence plist) :private) if (use-package-plist-delete (copy-sequence plist) :modules)
collect (format "%s" (cons name it)) collect (format "%s" (cons name it))
else else
collect (symbol-name name))) collect (symbol-name name)))

View file

@ -52,7 +52,7 @@
;;;###autoload ;;;###autoload
(defun doom-restore-session-handler (&rest _) (defun doom-restore-session-handler (&rest _)
"TODO" "TODO"
(doom-load-session)) (add-hook 'window-setup-hook #'doom-load-session 'append))
;;;###autoload ;;;###autoload
(add-to-list 'command-switch-alist (cons "--restore" #'doom-restore-session-handler)) (add-to-list 'command-switch-alist (cons "--restore" #'doom-restore-session-handler))

View file

@ -60,6 +60,9 @@ packages and regenerates the autoloads file."
(doom-packages-install doom-auto-accept) (doom-packages-install doom-auto-accept)
(print! "Regenerating autoloads files") (print! "Regenerating autoloads files")
(doom-reload-autoloads nil 'force-p) (doom-reload-autoloads nil 'force-p)
(when (y-or-n-p "Download and install all-the-icon's fonts?")
(require 'all-the-icons)
(all-the-icons-install-fonts 'yes))
(print! (bold (green "\nFinished! Doom is ready to go!\n"))) (print! (bold (green "\nFinished! Doom is ready to go!\n")))
(with-temp-buffer (with-temp-buffer
(doom-template-insert "QUICKSTART_INTRO") (doom-template-insert "QUICKSTART_INTRO")

View file

@ -248,17 +248,17 @@ non-nil, return paths of possible modules, activated or otherwise."
`((fset ',fn `((fset ',fn
(lambda (&rest _) (lambda (&rest _)
(doom-log "Loading deferred package %s from %s" ',name ',fn) (doom-log "Loading deferred package %s from %s" ',name ',fn)
(condition-case e (require ',name) (condition-case e
(require ',name)
((debug error) ((debug error)
(message "Failed to load deferred package %s: %s" ',name e))) (message "Failed to load deferred package %s: %s" ',name e)))
(dolist (hook (cdr (assq ',name doom--deferred-packages-alist))) (when-let* ((deferral-list (assq ',name doom--deferred-packages-alist)))
(if (functionp hook) (dolist (hook (cdr deferral-list))
(advice-remove hook #',fn) (if (functionp hook)
(remove-hook hook #',fn))) (advice-remove hook #',fn)
(setq doom--deferred-packages-alist (remove-hook hook #',fn)))
(delq (assq ',name doom--deferred-packages-alist) (setq doom--deferred-packages-alist
doom--deferred-packages-alist)) (delq deferral-list doom--deferred-packages-alist))))))
(fmakunbound ',fn))))
(let (forms) (let (forms)
(dolist (hook hooks forms) (dolist (hook hooks forms)
(push (if (functionp hook) (push (if (functionp hook)

View file

@ -1,7 +1,8 @@
;;; core-projects.el -*- lexical-binding: t; -*- ;;; core-projects.el -*- lexical-binding: t; -*-
(def-package! projectile (def-package! projectile
:hook (doom-init-ui . projectile-mode) :after-call (after-find-file dired-before-readin-hook minibuffer-setup-hook)
:commands (projectile-project-root projectile-project-name projectile-project-p)
:init :init
(setq projectile-cache-file (concat doom-cache-dir "projectile.cache") (setq projectile-cache-file (concat doom-cache-dir "projectile.cache")
projectile-enable-caching (not noninteractive) projectile-enable-caching (not noninteractive)
@ -14,6 +15,7 @@
:config :config
(add-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook) (add-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook)
(projectile-mode +1)
(global-set-key [remap evil-jump-to-tag] #'projectile-find-tag) (global-set-key [remap evil-jump-to-tag] #'projectile-find-tag)
(global-set-key [remap find-tag] #'projectile-find-tag) (global-set-key [remap find-tag] #'projectile-find-tag)

View file

@ -121,12 +121,6 @@ behavior). Do not set this directly, this is let-bound in `doom|init-theme'.")
(setq doom-theme theme) (setq doom-theme theme)
(run-hooks 'doom-load-theme-hook))) (run-hooks 'doom-load-theme-hook)))
(defun doom|protect-visible-buffer ()
"Don't kill the current buffer if it is visible in another window (bury it
instead). Meant for `kill-buffer-query-functions'."
(not (and (not (member (substring (buffer-name) 0 1) '(" " "*")))
(delq (selected-window) (get-buffer-window-list nil nil t)))))
(defun doom|protect-fallback-buffer () (defun doom|protect-fallback-buffer ()
"Don't kill the scratch buffer. Meant for `kill-buffer-query-functions'." "Don't kill the scratch buffer. Meant for `kill-buffer-query-functions'."
(not (eq (current-buffer) (doom-fallback-buffer)))) (not (eq (current-buffer) (doom-fallback-buffer))))
@ -527,7 +521,6 @@ frames, however. There's always `doom/reload-theme' if you need it!"
(run-hook-wrapped 'doom-init-ui-hook #'doom-try-run-hook) (run-hook-wrapped 'doom-init-ui-hook #'doom-try-run-hook)
(add-to-list 'kill-buffer-query-functions #'doom|protect-fallback-buffer nil 'eq) (add-to-list 'kill-buffer-query-functions #'doom|protect-fallback-buffer nil 'eq)
(add-to-list 'kill-buffer-query-functions #'doom|protect-visible-buffer nil 'eq)
(add-hook 'after-change-major-mode-hook #'doom|highlight-non-default-indentation) (add-hook 'after-change-major-mode-hook #'doom|highlight-non-default-indentation)
;; Reload theme if the display device has changed ;; Reload theme if the display device has changed

29
core/doctor.el Normal file
View file

@ -0,0 +1,29 @@
;;; core/doctor.el -*- lexical-binding: t; -*-
(defun file-size (file &optional dir)
(setq file (expand-file-name file dir))
(when (file-exists-p file)
(/ (nth 7 (file-attributes file))
1024.0)))
;; Check for oversized problem files in cache that may cause unusual/tremendous
;; delays or freezing. This shouldn't happen often.
(dolist (file (list "savehist"
"projectile.cache"))
(let* ((path (expand-file-name file doom-core-dir))
(size (file-size path)))
(when (and (numberp size) (> size 2000))
(warn! "%s is too large (%.02fmb). This may cause freezes or odd startup delays"
(file-relative-name path doom-core-dir)
(/ size 1024))
(explain! "Consider deleting it from your system (manually)"))))
(when! (not (executable-find "fd"))
(warn! "Couldn't find the `fd' binary; project file searches will be slightly slower"))
(let ((default-directory "~"))
(require 'projectile)
(when! (cl-find-if #'projectile-file-exists-p projectile-project-root-files-bottom-up)
(warn! "Your $HOME is recognized as a project root")
(explain! "Doom will disable bottom-up root search, which may reduce the accuracy of project\n"
"detection.")))

View file

@ -4,32 +4,6 @@
(require 'core-ui) (require 'core-ui)
(describe "core/ui" (describe "core/ui"
(describe "doom|protect-visible-buffer"
:var (kill-buffer-query-functions wconf a b)
(before-each
(setq a (switch-to-buffer (get-buffer-create "a"))
b (get-buffer-create "b")
kill-buffer-query-functions '(doom|protect-visible-buffer)
wconf (current-window-configuration))
(delete-other-windows))
(after-each
(let (kill-buffer-query-functions kill-buffer-hook)
(kill-buffer a)
(kill-buffer b))
(set-window-configuration wconf))
(it "shouldn't kill buffers that are visible in more than one window"
(with-temp-buffer-window
(switch-to-buffer a) (split-window)
(switch-to-buffer b) (split-window)
(switch-to-buffer a)
(expect (kill-buffer) :to-be nil)
(select-window (get-buffer-window b))
(expect (kill-buffer)))))
(describe "doom|protect-fallback-buffer" (describe "doom|protect-fallback-buffer"
:var (kill-buffer-query-functions a b) :var (kill-buffer-query-functions a b)
(before-all (before-all

View file

@ -15,7 +15,7 @@
* :feature * :feature
Broad modules that bring essential IDE functionality to Emacs. Broad modules that bring essential IDE functionality to Emacs.
+ [[file:feature/debugger/README.org][debugger]]: A (nigh-)universal debugger in Emacs + debugger: A (nigh-)universal debugger in Emacs
+ [[file:feature/eval/README.org][eval]]: REPL & code evaluation support for a variety of languages + [[file:feature/eval/README.org][eval]]: REPL & code evaluation support for a variety of languages
+ [[file:feature/evil/README.org][evil]] =+everywhere=: Vim in Emacs + [[file:feature/evil/README.org][evil]] =+everywhere=: Vim in Emacs
+ [[file:feature/file-templates/README.org][file-templates]]: Auto-inserted templates in blank new files + [[file:feature/file-templates/README.org][file-templates]]: Auto-inserted templates in blank new files
@ -27,8 +27,8 @@ Broad modules that bring essential IDE functionality to Emacs.
Swappable completion modules for quickly narrowing down lists of candidates. Swappable completion modules for quickly narrowing down lists of candidates.
+ [[file:completion/company/README.org][company]] =+auto +childframe=: The ultimate code completion backend + [[file:completion/company/README.org][company]] =+auto +childframe=: The ultimate code completion backend
+ [[file:completion/helm/README.org][helm]] =+fuzzy +childframe=: *Another* search engine for love and life + helm =+fuzzy +childframe=: *Another* search engine for love and life
+ [[file:completion/ido/README.org][ido]]: The /other/ *other* search engine for love and life + ido: The /other/ *other* search engine for love and life
+ [[file:completion/ivy/README.org][ivy]] =+fuzzy +childframe=: /The/ search engine for love and life + [[file:completion/ivy/README.org][ivy]] =+fuzzy +childframe=: /The/ search engine for love and life
* :ui * :ui
@ -39,18 +39,18 @@ Aesthetic modules that affect the Emacs interface or user experience.
+ [[file:ui/doom-dashboard/README.org][doom-dashboard]]: + [[file:ui/doom-dashboard/README.org][doom-dashboard]]:
+ [[file:ui/doom-quit/README.org][doom-quit]]: + [[file:ui/doom-quit/README.org][doom-quit]]:
+ [[file:ui/evil-goggles/README.org][evil-goggles]]: + [[file:ui/evil-goggles/README.org][evil-goggles]]:
+ [[file:ui/fci/README.org][fci]]: + fci:
+ [[file:ui/hl-todo/README.org][hl-todo]]: + [[file:ui/hl-todo/README.org][hl-todo]]:
+ [[file:ui/modeline/README.org][modeline]]: + [[file:ui/modeline/README.org][modeline]]:
+ [[file:ui/nav-flash/README.org][nav-flash]]: + [[file:ui/nav-flash/README.org][nav-flash]]:
+ [[file:ui/neotree/README.org][neotree]]: + [[file:ui/neotree/README.org][neotree]]:
+ [[file:ui/treemacs/README.org][treemacs]]: + treemacs:
+ [[file:ui/popup/README.org][popup]] =+all +defaults=: Makes temporary/disposable windows less intrusive + [[file:ui/popup/README.org][popup]] =+all +defaults=: Makes temporary/disposable windows less intrusive
+ [[file:ui/pretty-code/README.org][pretty-code]]: + pretty-code:
+ [[file:ui/tabbar/README.org][tabbar]]: + [[file:ui/tabbar/README.org][tabbar]]:
+ [[file:ui/unicode/README.org][unicode]]: + [[file:ui/unicode/README.org][unicode]]:
+ [[file:ui/vc-gutter/README.org][vc-gutter]]: + vc-gutter:
+ [[file:ui/vi-tilde-fringe/README.org][vi-tilde-fringe]]: + vi-tilde-fringe:
+ [[file:ui/window-select/README.org][window-select]]: + [[file:ui/window-select/README.org][window-select]]:
* :editor * :editor
@ -59,112 +59,113 @@ Modules that affect and augment your ability to write and edit text.
+ [[file:editor/fold/README.org][fold]]: universal code folding + [[file:editor/fold/README.org][fold]]: universal code folding
+ [[file:editor/format/README.org][format]] =+onsave=: + [[file:editor/format/README.org][format]] =+onsave=:
+ [[file:editor/lispy/README.org][lispy]]: + [[file:editor/lispy/README.org][lispy]]:
+ [[file:editor/multiple-cursors/README.org][multiple-cursors]]: + multiple-cursors:
+ [[file:editor/parinfer/README.org][parinfer]]: + [[file:editor/parinfer/README.org][parinfer]]:
+ [[file:editor/rotate-text/README.org][rotate-text]]: + rotate-text:
* :emacs * :emacs
Modules that reconfigure packages or features built into Emacs Modules that reconfigure packages or features built into Emacs
+ [[file:emacs/dired/README.org][dired]] =+ranger +icons=: + dired =+ranger +icons=:
+ [[file:emacs/electric/README.org][electric]]: + electric:
+ [[file:emacs/eshell/README.org][eshell]]: + eshell:
+ [[file:emacs/imenu/README.org][imenu]]: + imenu:
+ [[file:emacs/term/README.org][term]]: + term:
+ [[file:emacs/vc/README.org][vc]]: + vc:
* :tools * :tools
Small modules that give Emacs access to external tools & services. Small modules that give Emacs access to external tools & services.
+ [[file:tools/ansible/README.org][ansible]]: + ansible:
+ [[file:tools/docker/README.org][docker]]: + docker:
+ [[file:tools/editorconfig/README.org][editorconfig]]: + [[file:tools/editorconfig/README.org][editorconfig]]:
+ [[file:tools/ein/README.org][ein]]: + [[file:tools/ein/README.org][ein]]:
+ [[file:tools/flyspell/README.org][flyspell]]: Spell checking + flyspell: Spell checking
+ [[file:tools/flycheck/README.org][flycheck]]: Live error/warning highlights + flycheck: Live error/warning highlights
+ [[file:tools/gist/README.org][gist]]: + gist:
+ [[file:tools/lsp/README.org][lsp]]: + [[file:tools/lsp/README.org][lsp]]:
+ [[file:tools/macos/README.org][macos]]: + macos:
+ [[file:tools/make/README.org][make]]: + make:
+ [[file:tools/magit/README.org][magit]]: + magit:
+ [[file:tools/password-store/README.org][password-store]]: + password-store:
+ [[file:tools/pdf/README.org][pdf]]: + pdf:
+ [[file:tools/prodigy/README.md][prodigy]]: + prodigy:
+ [[file:tools/rgb/README.org][rgb]]: + rgb:
+ [[file:tools/terraform/README.org][terraform]]: + terraform:
+ [[file:tools/tmux/README.org][tmux]]: + tmux:
+ [[file:tools/upload/README.org][upload]]: + upload:
+ [[file:tools/wakatime/README.org][wakatime]]: + [[file:tools/wakatime/README.org][wakatime]]:
+ [[file:tools/vterm/README.org][vterm]]: + vterm:
* :lang * :lang
Modules that bring support for a language or group of languages to Emacs. Modules that bring support for a language or group of languages to Emacs.
+ [[file:lang/assembly/README.org][assembly]]: + assembly:
+ [[file:lang/cc/README.org][cc]] =+lsp=: + [[file:lang/cc/README.org][cc]] =+lsp=:
+ [[file:lang/clojure/README.org][clojure]]: + clojure:
+ [[file:lang/common-lisp/README.org][common-lisp]]: + common-lisp:
+ [[file:lang/coq/README.org][coq]]: + [[file:lang/coq/README.org][coq]]:
+ [[file:lang/crystal/README.org][crystal]]: + crystal:
+ [[file:lang/csharp/README.org][csharp]]: + [[file:lang/csharp/README.org][csharp]]:
+ [[file:lang/data/README.org][data]]: + data:
+ [[file:lang/erlang/README.org][erlang]]: + erlang:
+ [[file:lang/elixir/README.org][elixir]]: + elixir:
+ [[file:lang/elm/README.org][elm]]: + elm:
+ [[file:lang/emacs-lisp/README.org][emacs-lisp]]: + emacs-lisp:
+ [[file:lang/ess/README.org][ess]]: + [[file:lang/ess/README.org][ess]]:
+ [[file:lang/go/README.org][go]] =+lsp=: + [[file:lang/go/README.org][go]] =+lsp=:
+ [[file:lang/haskell/README.org][haskell]] =+intero +dante=: + [[file:lang/haskell/README.org][haskell]] =+intero +dante=:
+ [[file:lang/hy/README.org][hy]]: + hy:
+ [[file:lang/idris/README.org][idris]]: + [[file:lang/idris/README.org][idris]]:
+ [[file:lang/java/README.org][java]] =+meghanada=: + java =+meghanada=:
+ [[file:lang/javascript/README.org][javascript]] =+lsp=: + [[file:lang/javascript/README.org][javascript]] =+lsp=:
+ [[file:lang/julia/README.org][julia]]: + julia:
+ [[file:lang/latex/README.org][latex]]: + [[file:lang/latex/README.org][latex]]:
+ [[file:lang/ledger/README.org][ledger]]: + ledger:
+ [[file:lang/lua/README.org][lua]]: + lua:
+ [[file:lang/markdown/README.org][markdown]]: + markdown:
+ [[file:lang/nim/README.org][nim]]: + [[file:lang/nim/README.org][nim]]:
+ [[file:lang/nix/README.org][nix]]: + nix:
+ [[file:lang/ocaml/README.org][ocaml]] =+lsp=: + [[file:lang/ocaml/README.org][ocaml]] =+lsp=:
+ [[file:lang/org/README.org][org]] =+attach +babel +capture +export +present +ipython=: + [[file:lang/org/README.org][org]] =+attach +babel +capture +export +present +ipython=:
+ [[file:lang/perl/README.org][perl]]: + [[file:lang/perl/README.org][perl]]:
+ [[file:lang/php/README.org][php]] =+lsp=: + [[file:lang/php/README.org][php]] =+lsp=:
+ [[file:lang/plantuml/README.org][plantuml]]: + plantuml:
+ [[file:lang/purescript/README.org][purescript]]: + purescript:
+ [[file:lang/python/README.org][python]] =+lsp=: + python =+lsp=:
+ [[file:lang/qt/README.org][qt]]: + qt:
+ [[file:lang/racket/README.org][racket]]: + racket:
+ [[file:lang/rest/README.org][rest]]: + [[file:lang/rest/README.org][rest]]:
+ [[file:lang/ruby/README.org][ruby]] =+lsp=: + ruby =+lsp=:
+ [[file:lang/rust/README.org][rust]] =+lsp=: + [[file:lang/rust/README.org][rust]] =+lsp=:
+ [[file:lang/scala/README.org][scala]]: + scala:
+ [[file:lang/sh/README.org][sh]] =+fish +lsp=: + [[file:lang/sh/README.org][sh]] =+fish +lsp=:
+ [[file:lang/solidity/README.org][solidity]]: + [[file:lang/solidity/README.org][solidity]]:
+ [[file:lang/swift/README.org][swift]]: + swift:
+ [[file:lang/web/README.org][web]] =+lsp=: + web =+lsp=:
+ [[file:lang/vala/README.org][vala]]: + vala:
* :app * :app
Large, opinionated modules that transform and take over Emacs to serve Large, opinionated modules that transform and take over Emacs, i.e.
Doom-specific porcelains.
+ [[file:app/calendar/README.org][calendar]]: + calendar:
+ [[file:app/email/README.org][email]] =+gmail=: + [[file:app/email/README.org][email]] =+gmail=:
+ [[file:app/irc/README.org][irc]]: + [[file:app/irc/README.org][irc]]:
+ [[file:app/regex/README.org][regex]]: + regex:
+ [[file:app/rss/README.org][rss]] =+org=: + rss =+org=:
+ [[file:app/twitter/README.org][twitter]]: + twitter:
+ [[file:app/write/README.org][write]] =+wordnut +langtool=: + [[file:app/write/README.org][write]] =+wordnut +langtool=:
* :collab * :collab
Modules that enable collaborative programming over the internet. Modules that enable collaborative programming over the internet.
+ [[file:collab/floobits/README.org][floobits]]: + floobits:
+ [[file:collab/impatient-mode/README.org][impatient-mode]]: + impatient-mode:
* :config * :config
Modules that configure Emacs one way or another, or focus on making it easier Modules that configure Emacs one way or another, or focus on making it easier
for you to customize it yourself. for you to customize it yourself.
+ [[file:config/literate/README.org][literate]]: + literate:
+ [[file:config/default/README.org][default]] =+bindings +smartparens=: + [[file:config/default/README.org][default]] =+bindings +smartparens=:

View file

@ -35,7 +35,7 @@ temporary/special buffers in `font-lock-comment-face'."
;; Library ;; Library
(defun +ivy--switch-buffer-preview () (defun +ivy--switch-buffer-preview ()
(let (ivy-use-virtual-buffers) (let (ivy-use-virtual-buffers ivy--virtual-buffers)
(counsel--switch-buffer-update-fn))) (counsel--switch-buffer-update-fn)))
(defalias '+ivy--switch-buffer-preview-all #'counsel--switch-buffer-update-fn) (defalias '+ivy--switch-buffer-preview-all #'counsel--switch-buffer-update-fn)

View file

@ -409,8 +409,9 @@
:nv "N" #'evil-mc-make-and-goto-last-cursor :nv "N" #'evil-mc-make-and-goto-last-cursor
:nv "p" #'evil-mc-make-and-goto-prev-cursor :nv "p" #'evil-mc-make-and-goto-prev-cursor
:nv "P" #'evil-mc-make-and-goto-first-cursor :nv "P" #'evil-mc-make-and-goto-first-cursor
:nv "q" #'evil-mc-undo-all-cursors
:nv "t" #'+multiple-cursors/evil-mc-toggle-cursors :nv "t" #'+multiple-cursors/evil-mc-toggle-cursors
:nv "u" #'evil-mc-undo-all-cursors :nv "u" #'evil-mc-undo-last-added-cursor
:nv "z" #'+multiple-cursors/evil-mc-make-cursor-here) :nv "z" #'+multiple-cursors/evil-mc-make-cursor-here)
(:after evil-mc (:after evil-mc
:map evil-mc-key-map :map evil-mc-key-map

View file

@ -17,6 +17,7 @@
(defvar evil-mc-key-map (make-sparse-keymap)) (defvar evil-mc-key-map (make-sparse-keymap))
:config :config
(global-evil-mc-mode +1) (global-evil-mc-mode +1)
(setq evil-mc-enable-bar-cursor (not (or IS-MAC IS-WINDOWS)))
(after! smartparens (after! smartparens
;; Make evil-mc cooperate with smartparens better ;; Make evil-mc cooperate with smartparens better

View file

@ -66,10 +66,6 @@ buffers."
;; ;;
;; Commands ;; Commands
;;; these are defined in feature/evil
;;(evil-ex-define-cmd "al[ign]" #'+evil:align)
;;(evil-ex-define-cmd "g[lobal]" #'+evil:global)
;;; Custom commands ;;; Custom commands
;; Editing ;; Editing
(evil-ex-define-cmd "@" #'+evil:macro-on-all-lines) ; TODO Test me (evil-ex-define-cmd "@" #'+evil:macro-on-all-lines) ; TODO Test me
@ -151,7 +147,7 @@ buffers."
;;; Project tools ;;; Project tools
(evil-ex-define-cmd "compile" #'+evil:compile) (evil-ex-define-cmd "compile" #'+evil:compile)
(evil-ex-define-cmd "mak[e]" #'+evil:make) (evil-ex-define-cmd "mak[e]" #'+evil:make)
(evil-ex-define-cmd "debug" #'+debug/run) ;; (evil-ex-define-cmd "debug" #'+debug/run)
(evil-ex-define-cmd "er[rors]" #'flycheck-list-errors) (evil-ex-define-cmd "er[rors]" #'flycheck-list-errors)
;;; File operations ;;; File operations
@ -161,8 +157,8 @@ buffers."
;;; Sessions/tabs ;;; Sessions/tabs
(evil-ex-define-cmd "sclear" #'+workspace/kill-session) (evil-ex-define-cmd "sclear" #'+workspace/kill-session)
(evil-ex-define-cmd "sl[oad]" #'+workspace:load-session) (evil-ex-define-cmd "sl[oad]" #'doom/quickload-session)
(evil-ex-define-cmd "ss[ave]" #'+workspace:save-session) (evil-ex-define-cmd "ss[ave]" #'doom/quicksave-session)
(evil-ex-define-cmd "tabc[lose]" #'+workspace:delete) (evil-ex-define-cmd "tabc[lose]" #'+workspace:delete)
(evil-ex-define-cmd "tabclear" #'doom/kill-all-buffers) (evil-ex-define-cmd "tabclear" #'doom/kill-all-buffers)
(evil-ex-define-cmd "tabl[ast]" #'+workspace/switch-to-last) (evil-ex-define-cmd "tabl[ast]" #'+workspace/switch-to-last)

View file

@ -4,26 +4,25 @@
#+STARTUP: inlineimages #+STARTUP: inlineimages
* Table of Contents :TOC_3:noexport: * Table of Contents :TOC_3:noexport:
- [[Description][Description]] - [[#description][Description]]
- [[Module Flags][Module Flags]] - [[#module-flags][Module Flags]]
- [[Plugins][Plugins]] - [[#plugins][Plugins]]
- [[Hacks][Hacks]] - [[#hacks][Hacks]]
- [[Prerequisites][Prerequisites]] - [[#prerequisites][Prerequisites]]
- [[Features][Features]] - [[#features][Features]]
- [[Ported vim plugins][Ported vim plugins]] - [[#ported-vim-plugins][Ported vim plugins]]
- [[Custom Text Objects][Custom Text Objects]] - [[#custom-text-objects][Custom Text Objects]]
- [[Custom Ex Commands][Custom Ex Commands]] - [[#custom-ex-commands][Custom Ex Commands]]
- [[A hybrid code-folding system][A hybrid code-folding system]] - [[#configuration][Configuration]]
- [[Differences from vim][Differences from vim]] - [[#removing-evil-mode][Removing evil-mode]]
- [[Configuration][Configuration]] - [[#restoring-old-substitution-behavior-on-ss][Restoring old substitution behavior on s/S]]
- [[Removing evil-mode][Removing evil-mode]]
* Description * Description
This holy module brings the vim experience to Emacs. This holy module brings the vim experience to Emacs.
** Module Flags ** Module Flags
+ =+everywhere= Enables evilified keybinds everywhere possible, utilizing the + =+everywhere= Enables evilified keybinds everywhere possible. Uses the
~evil-collection~ plugin. [[https://github.com/emacs-evil/evil-collection][evil-collection]] plugin as a foundation.
** Plugins ** Plugins
+ [[https://github.com/emacs-evil/evil][evil]] + [[https://github.com/emacs-evil/evil][evil]]
@ -48,10 +47,9 @@ This holy module brings the vim experience to Emacs.
+ When a window is split, the new window will be focused. + When a window is split, the new window will be focused.
+ The o/O keys will respect and continue commented lines (can be disabled by + The o/O keys will respect and continue commented lines (can be disabled by
setting ~+evil-want-o/O-to-continue-comments~ to ~nil~). setting ~+evil-want-o/O-to-continue-comments~ to ~nil~).
+ From visual mode, =*= and =#= will search for the current selection instead of + In visual mode, =*= and =#= will search for the current selection instead of
the word-at-point. the word-at-point.
+ The ~:g[lobal]~ ex command has been modified to highlight matches + The ~:g[lobal]~ ex command has been modified to highlight matches.
incrementally.
+ More of vim's filename modifiers are supported in ex commands (like ~:p~, + More of vim's filename modifiers are supported in ex commands (like ~:p~,
~:p:h~ or ~:t~) than vanilla evil-mode offers. ~:p:h~ or ~:t~) than vanilla evil-mode offers.
+ A custom filename modifier is available in Doom: ~:P~, which expands to the + A custom filename modifier is available in Doom: ~:P~, which expands to the
@ -64,64 +62,115 @@ This module has no external prerequisites.
** Ported vim plugins ** Ported vim plugins
The following vim plugins have been ported to evil: The following vim plugins have been ported to evil:
| Vim Plugin | Emacs Plugin | Keybind(s) | | Vim Plugin | Emacs Plugin | Keybind(s) |
|-----------------------+--------------------------------+---------------------| |-----------------------+--------------------------------+--------------------------------------|
| vim-commentary | evil-commentary | omap =gc= | | vim-commentary | evil-commentary | omap =gc= |
| vim-easymotion | evil-easymotion | omap =gs= | | vim-easymotion | evil-easymotion | omap =gs= |
| vim-seek or vim-sneak | evil-snipe | mmap =s=/=S= | | vim-seek or vim-sneak | evil-snipe | mmap =s=/=S=, omap =z=/=Z= & =x=/=x= |
| vim-surround | evil-embrace and evil-surround | vmap =S=, omap =ys= | | vim-surround | evil-embrace and evil-surround | vmap =S=, omap =ys= |
In other modules: In other modules:
+ The tools/neotree & tools/treemacs modules contain a =NERDTree= equivalent. + The tools/neotree & tools/treemacs modules provide a =NERDTree= equivalent.
+ The editor/multiple-cursors module contains: + The editor/multiple-cursors module contains functionality equal to the
+ ~vim-multiedit~ => evil-multiedit following vim plugins:
+ ~vim-multiple-cursors~ => evil-mc + evil-multiedit => vim-multiedit
+ evil-mc => vim-multiple-cursors
** Custom Text Objects ** Custom Text Objects
+ A list of new text objects: This module provides a couple extra text objects, along with the built-in ones.
+ Blocks: ~B~ (from ~evil-textobj-anyblock~) For posterity, here are the built-in ones:
+ Args: ~a~ (from ~evil-args~)
+ Indentation: ~i~ / ~I~ / ~J~ (from ~evil-indent-plus~) + =w W= words
+ =s= sentences
+ =p= paragraphs
+ =b= parenthesized blocks
+ =b ( ) { } [ ] < >= braces, parentheses and brackets
+ =' " `= quotes
+ =t= tags
+ =o= symbols
And these are text objects added by this module:
+ =B= any block delimited by braces, parentheses or backets (provided by
~evil-textobj-anyblock~)
+ =a= C-style fucntion arguments (provided by ~evil-args~)
+ =i I J= By indentation (I includes on line above and J includes one line
below) (provided by ~evil-indent-plus~)
+ =x= XML attributes (provided by ~exato~)
** Custom Ex Commands ** Custom Ex Commands
| Ex Command | Description | | Ex Command | Description |
|----------------------+----------------------------------------------------------------------------------| |----------------------+--------------------------------------------------------------------------------------|
| ~:al[ign][!] REGEXP~ | Align text to the first match of REGEXP. If BANG, align all matches on each line | | ~:@~ | Apply macro on selected lines |
| ~:mv[!] NEWPATH~ | Move the current file to NEWPATH | | ~:ag[!] REGEXP~ | Perform a project search with ag |
| ~:cp[!] NEWPATH~ | Copy the current file to NEWPATH | | ~:agcwd[!] REGEXP~ | Perform a project search with ag |
| ~:rm[!] [PATH]~ | Delete the current buffer's file and buffer | | ~:al[ign] REGEXP~ | Align text that matches REGEXP |
| ~:al[ign][!] REGEXP~ | Align text to the first match of REGEXP. If BANG, align all matches on each line |
** A hybrid code-folding system | ~:cp[!] NEWPATH~ | Copy the current file to NEWPATH |
This module combines ~vimish-fold~ and ~hideshow~. The former allows arbitrary | ~:dash QUERY~ | Look up QUERY (or the symbol at point) in dash docsets |
folds and the latter allows folds on markers and indentation. Together, they | ~:dehtml [INPUT]~ | HTML decode selected text / inserts result if INPUT is given |
create a more consistent (and feature-complete) code-folding system. | ~:enhtml [INPUT]~ | HTML encode selected text / inserts result if INPUT is given |
| ~:grep[!]~ | Perform a project search with git-grep |
Most vim folding keys should work, e.g. =zr=, =zm=, =za=, =zo=, etc. | ~:grepcwd[!]~ | Perform a project search with git-grep |
| ~:iedit REGEXP~ | Invoke iedit on all matches for REGEXP |
** Differences from vim | ~:k[ill]all[!]~ | Kill all buffers (if BANG, affect buffer across workspaces) |
+ Column-wise ranges in ex commands are enabled by default. i.e. the range in | ~:k[ill]b~ | Kill all buried buffers |
=:'<,'>s/a/b= will only affects the visual selection, not full lines (see | ~:k[ill]m[!] REGEXP~ | Kill buffers whose name matches REGEXP (if BANG, affect buffers across workspaces) |
~evil-ex-visual-char-range~). | ~:k[ill]o~ | Kill all other buffers besides the selected one |
+ =:g= will incrementally highlight buffer matches. | ~:k[ill]~ | Kill the current buffer |
| ~:lo[okup] QUERY~ | Look up QUERY on an online search engine |
| ~:mc REGEXP~ | Invoke multiple cursors on all matches for REGEXP |
| ~:mv[!] NEWPATH~ | Move the current file to NEWPATH |
| ~:na[rrow]~ | Narrow the buffer to the selection |
| ~:pad~ | Open a scratch pad for running code quickly |
| ~:pt[!]~ | Perform a project search with pt |
| ~:ptcwd[!]~ | Perform a project search with pt |
| ~:ral[ign] REGEXP~ | Right-align text that matches REGEXP |
| ~:repl~ | Open a REPL and/or copy the current selection to it |
| ~:retab~ | Convert indentation to the default within the selection |
| ~:rev[erse]~ | Reverse the selected lines |
| ~:rg[!]~ | Perform a project search with ripgrep |
| ~:rgcwd[!]~ | Perform a project search with rigprep |
| ~:rm[!] [PATH]~ | Delete the current buffer's file and buffer |
| ~:tcd[!]~ | Send =cd X= to tmux. X = the project root if BANG, X = ~default-directory~ otherwise |
* Configuration * Configuration
** Removing evil-mode ** Removing evil-mode
You must do two things to remove Evil: You must do two things to remove Evil:
1. Remove =:feature evil= from =~/.doom.d/init.el=, 1. Remove =:feature evil= from =~/.doom.d/init.el=,
2. Run ~bin/doom refresh~ to clean up lingering dependencies and refresh yuor 2. Run ~doom refresh~ to clean up lingering dependencies and refresh yuor
autoloads files. autoloads files.
3. [OPTIONAL] You may want a new ~doom-leader-alt-key~ and 3. [OPTIONAL] You may want to assign new values to ~doom-leader-alt-key~ and
~doom-localleader-alt-key~. By default, these are bound to =M-SPC= and =M-SPC ~doom-localleader-alt-key~. These are bound to =C-c= and =C-c l= by default.
m=.
#+begin_quote #+begin_quote
Ignore ~doom-leader-key~ and ~doom-localleader-key~, they don't apply to Ignore ~doom-leader-key~ and ~doom-localleader-key~, they don't apply to
non-evil sessions. non-evil sessions.
#+end_quote #+end_quote
Note that evil-specific configuration and keybinds (defined with ~map!~) will be Evil-specific configuration and keybindings (defined with ~map!~) will be
ignored without evil present (and stripped out when byte-compiling). ignored without =:feature evil= present (and omitted when byte-compiling).
Unfortunately, since Doom was designed by a vimmer, for vimmers, little Keep in mind that, at the time of this writing, Doom was designed by a vimmer,
consideration into a keybinding scheme for vanilla Emacs users. for vimmers. Little consideration has been put into designing a keybind scheme
for vanilla Emacs users (though it's being worked on!).
That means that much of Doom's functionality will be orphaned in an evil-less
setup. You'll have to set your own keybinds.
I suggest studying [[file:../../config/default/+emacs-bindings.el][config/default/+emacs-bindings.el]] to see what keybinds are
available for non-evil users. Otherwise, you may find inspiration [[file:../../../docs/example_configs.org][on the example
Doom configurations page]].
** Restoring old substitution behavior on s/S
Doom replaces the =s= and =S= keys with the =evil-snipe= package (a port of
vim-seek/vim-sneak for 2-character versions of f/F/t/T).
To disable evil-snipe on s/S, you can either:
1. Disable ~evil-snipe-mode~ by adding ~(after! evil-snipe (evil-snipe-mode
-1))~ to =$DOOMDIR/config.el=,
2. Or disable =evil-snipe= completely with ~(package! evil-snipe :disable t)~
added to =$DOOMDIR/packages.el=, but this will also disable incremental
highlighting for the f/F/t/T motions keys.

View file

@ -10,7 +10,7 @@ to a pop up buffer."
(require 'pp) (require 'pp)
(let ((result (let ((result
(let ((debug-on-error t) (let ((debug-on-error t)
(doom--current-module (doom-module-from-path buffer-file-name))) (doom--current-module (ignore-errors (doom-module-from-path buffer-file-name))))
(eval (read (eval (read
(concat "(progn " (concat "(progn "
(buffer-substring-no-properties beg end) (buffer-substring-no-properties beg end)

View file

@ -124,6 +124,7 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
(def-package! elisp-demos (def-package! elisp-demos
:defer t :defer t
:init :init
(advice-add 'describe-function-1 :after #'elisp-demos-advice-describe-function-1)
(advice-add 'helpful-update :after #'elisp-demos-advice-helpful-update)) (advice-add 'helpful-update :after #'elisp-demos-advice-helpful-update))

View file

@ -160,14 +160,15 @@
;; navigation ;; navigation
(set-lookup-handlers! 'tide-mode :async t (set-lookup-handlers! 'tide-mode :async t
:definition #'tide-jump-to-definition :definition #'tide-jump-to-definition
:references #'tide-references :references #'tide-references)
:documentation #'tide-documentation-at-point)
;; resolve to `doom-project-root' if `tide-project-root' fails ;; resolve to `doom-project-root' if `tide-project-root' fails
(advice-add #'tide-project-root :override #'+javascript*tide-project-root) (advice-add #'tide-project-root :override #'+javascript*tide-project-root)
;; cleanup tsserver when no tide buffers are left ;; cleanup tsserver when no tide buffers are left
(add-hook! 'tide-mode-hook (add-hook! 'tide-mode-hook
(add-hook 'kill-buffer-hook #'+javascript|cleanup-tide-processes nil t)) (add-hook 'kill-buffer-hook #'+javascript|cleanup-tide-processes nil t))
(define-key tide-mode-map [remap +lookup/documentation] #'tide-documentation-at-point)
(map! :localleader (map! :localleader
:map tide-mode-map :map tide-mode-map
"R" #'tide-restart-server "R" #'tide-restart-server

View file

@ -76,6 +76,7 @@
(add-hook 'org-load-hook #'+org|setup-evil-keybinds) (add-hook 'org-load-hook #'+org|setup-evil-keybinds)
(add-hook 'evil-org-mode-hook #'evil-normalize-keymaps) (add-hook 'evil-org-mode-hook #'evil-normalize-keymaps)
:config :config
(add-hook 'org-open-at-point-functions #'evil-set-jump)
;; change `evil-org-key-theme' instead ;; change `evil-org-key-theme' instead
(advice-add #'evil-org-set-key-theme :override #'ignore) (advice-add #'evil-org-set-key-theme :override #'ignore)
(def-package! evil-org-agenda (def-package! evil-org-agenda

View file

@ -114,7 +114,7 @@ PLIST can have the following properties:
return t))) return t)))
#'+doom-dashboard-initial-buffer)) #'+doom-dashboard-initial-buffer))
(add-hook 'doom-init-ui-hook #'+doom-dashboard|init) (add-hook 'doom-init-ui-hook #'+doom-dashboard|init 'append)
;; ;;

View file

@ -27,6 +27,7 @@
:init :init
(unless doom-theme (unless doom-theme
(setq doom-theme 'doom-one)) (setq doom-theme 'doom-one))
:config
;; improve integration w/ org-mode ;; improve integration w/ org-mode
(add-hook 'doom-load-theme-hook #'doom-themes-org-config) (add-hook 'doom-load-theme-hook #'doom-themes-org-config)
;; more Atom-esque file icons for neotree/treemacs ;; more Atom-esque file icons for neotree/treemacs

View file

@ -1,50 +1,59 @@
#+TITLE: :feature popup #+TITLE: :ui popup
This module provides a highly customizable popup window management system. * Table of Contents :TOC:
- [[#description][Description]]
- [[#module-flags][Module Flags]]
- [[#prerequisites][Prerequisites]]
- [[#configuration][Configuration]]
- [[#set-popup-rule-and-set-popup-rules][~set-popup-rule!~ and ~set-popup-rules!~]]
- [[#disabling-aggressive-mode-line-hiding-in-popups][Disabling aggressive mode-line hiding in popups]]
- [[#appendix][Appendix]]
- [[#commands][Commands]]
- [[#library][Library]]
- [[#hacks][Hacks]]
* Description
This module provides a customizable popup window management system.
#+begin_quote
Not all windows are created equally. Some are less important. Some I want gone Not all windows are created equally. Some are less important. Some I want gone
once they have served their purpose, like code output or a help buffer. Others I once they have served their purpose, like code output or a help buffer. Others I
want to stick around, like a scratch buffer or org-capture popup. want to stick around, like a scratch buffer or org-capture popup.
More than that, popups ought to be be the second class citizens of my editor; More than that, popups ought to be be the second class citizens of my editor;
spawned off to the side, discarded with the simple push of a button spawned off to the side, discarded with the push of a button (e.g. =ESC= or
(Escape/C-g), and easily restored if I want to see them again. Of course, this =C-g=), and easily restored if I want to see them again. Of course, this system
system should clean up after itself and kill off buffers I mark as transient. should clean up after itself and kill off buffers I mark as transient.
#+end_quote
* Table of Contents :TOC: ** Module Flags
- [[Configuration][Configuration]] + =+all= Enables fallback rules to ensure all temporary/special buffers (whose
- [[~set-popup-rules!~][~set-popup-rules!~]] name begins with a space or asterix) are treated as popups.
- [[Disabling aggressive mode-line hiding in popups][Disabling aggressive mode-line hiding in popups]] + =+defaults= Enables reasonable default popup rules for a variety of buffers.
- [[Appendix][Appendix]]
- [[Commands][Commands]] * Prerequisites
- [[Library][Library]] This module has no external prerequisites.
- [[Hacks][Hacks]]
* Configuration * Configuration
** ~set-popup-rules!~ ** ~set-popup-rule!~ and ~set-popup-rules!~
This module has one setting for defining your own rules for popups: This module has two functions for defining your own rules for popups:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(set-popup-rule! PREDICATE &key IGNORE ACTIONS SIDE SIZE WIDTH HEIGHT SLOT VSLOT TTL QUIT SELECT MODELINE AUTOSAVE PARAMETERS)
(set-popup-rules! &rest RULESETS) (set-popup-rules! &rest RULESETS)
#+END_SRC #+END_SRC
+ ~RULESETS~ consist of a function or regexp string that matches the buffer's ~PREDICATE~ is a predicate function or regexp string to match against the
name, and a list of settings. See ~display-buffer~'s, buffer's name. To see what the other keywords do, check out the documentation
~display-window-parameters~'s, and ~+popup-window-parameters~'s documentation for ~set-popup-rule!~ (=SPC h f set-popup-rule!=).
for what parameters are supported.
#+begin_quote
Rules are added to ~display-buffer-alist~, which instructs ~display-buffer~ Rules are added to ~display-buffer-alist~, which instructs ~display-buffer~
calls on how to set up windows for buffers that meet certain conditions. calls on how to set up windows for buffers that meet certain conditions.
#+begin_quote
The ~switch-to-buffer~ command (and its ~switch-to-buffer-*~ variants) are not The ~switch-to-buffer~ command (and its ~switch-to-buffer-*~ variants) are not
affected by ~display-buffer-alist~. affected by ~display-buffer-alist~.
#+end_quote #+end_quote
Here are a couple example rules: e.g.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(set-popup-rules! (set-popup-rules!
'(("^ \\*" :slot -1) ; fallback rule for special buffers '(("^ \\*" :slot -1) ; fallback rule for special buffers
@ -57,25 +66,27 @@ Here are a couple example rules:
#+END_SRC #+END_SRC
Omitted parameters in a ~set-popup-rules!~ will use the defaults set in Omitted parameters in a ~set-popup-rules!~ will use the defaults set in
~+popup-default-alist~ and ~+popup-default-parameters~. ~+popup-defaults~.
** Disabling aggressive mode-line hiding in popups ** Disabling aggressive mode-line hiding in popups
There are two ways to go about this. You can turn on modelines by changing the There are two ways to go about this.
default ~'modeline~ window parameter in ~+popup-default-parameters~:
#+BEGIN_SRC emacs-lisp 1. Turn on modelines by changing the ~:modeline~ property in ~+popup-defaults~:
;; put in private/$USER/config.el
(map-put +popup-default-parameters 'modeline t)
#+END_SRC
This will ensure all popups have a modeline /by default/, but allows you to override this on a per-popup basis. #+BEGIN_SRC emacs-lisp
;; put in private/$USER/config.el
(map-put +popup-defaults :modeline t)
#+END_SRC
*Alternatively*, you can disable modeline-hiding entirely: This will ensure all popups have a modeline /by default/, but allows you to
override this on a per-popup basis.
#+BEGIN_SRC emacs-lisp 2. Disable modeline-hiding entirely:
;; put in private/$USER/config.el
(remove-hook '+popup-buffer-mode-hook '+popup|set-modeline) #+BEGIN_SRC emacs-lisp
#+END_SRC ;; in ~/.doom.d/config.el
(remove-hook '+popup-buffer-mode-hook #'+popup|set-modeline-on-enable)
#+END_SRC
* Appendix * Appendix
** Commands ** Commands

View file

@ -166,7 +166,9 @@ PLIST can be made up of any of the following properties:
An alist of custom window parameters. See `(elisp)Window Parameters'. An alist of custom window parameters. See `(elisp)Window Parameters'.
If any of these are omitted, defaults derived from `+popup-defaults' will be If any of these are omitted, defaults derived from `+popup-defaults' will be
used." used.
\(fn PREDICATE &key IGNORE ACTIONS SIDE SIZE WIDTH HEIGHT SLOT VSLOT TTL QUIT SELECT MODELINE AUTOSAVE PARAMETERS)"
(declare (indent defun)) (declare (indent defun))
(push (+popup--make predicate plist) +popup--display-buffer-alist) (push (+popup--make predicate plist) +popup--display-buffer-alist)
(when (bound-and-true-p +popup-mode) (when (bound-and-true-p +popup-mode)