diff --git a/CHANGELOG.org b/CHANGELOG.org index bd68c8d85..07df83255 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -10,6 +10,53 @@ - [[#200-jan-17-2017][2.0.0 (Jan 17, 2017)]] * Unreleased (develop) ++ *Module changes:* + + Split =lang/java= into two submodules: one for eclim, and another for + meghanada. The latter is still the default, however. Also, the eclim + submodule is experimental, since I have few opportunities to test it. + + Add =ui/window-select= (and moved ace-window out of ~core-ui~), which offers + two submodules for interactive window selection/moving: ace-window and + switch-window. ++ =general= + + New command naming convention: ~doom//...~ -- denotes that this an + interactive command meant for: + + Altering or maintaining your Emacs configuration itself. + + And can be safely called through a batch session on the command line. E.g. + ~emacs --batch -f doom//some-command~. + + New macro for defining fuzzy-find menus (powered by whatever completion + engine you have active): ~def-menu!~. + + Autoload files can now specify a predicate cookie to tell the + compiler/autoload reader whether or not to ignore that file. They look like + ~;;;###if (featurep! :feature evil)~. + + =core-keybinds= Add :g flag to ~map!~ for defining global keybinds along + with vim keybinds, so you don't have to repeat yourself, just for a global + binding. + + =core-packages= Fix an issue where Doom's package management system wouldn't + know what to do with a package that was initially installed with one backend + (e.g. ELPA), and whose ~package!~ definition was later changed so that it + should be handled by another (e.g. QUELPA). This would cause "FAILED" error + messages while trying to install or update these packages (see [[https://github.com/hlissner/doom-emacs/issues/222][#222]]). ++ =feature= + + =file-templates= Disable file templates for .dir-locals.el files. + + =jump= New command ~+jump/online-select~, which is like ~+jump/online~, but + will always prompt for which provider to use. ++ =ui= + + =doom= This module no longer sets a default font. This is left to the user + to set in their own private module. Use ~(set! :font "Font Name" :size N)~ + to do so. ++ =lang= + + =sh= + + Improve how variables and subshells in double-quoted strings are + fontified. + + Fix imenu not recognizing functions with dashes in their names. + + =java= + + Polished meghanada-mode integration. + + New (and optional) +eclim submodule and module flag. + + =rust= + + Now checks the ~RUST_SRC_PATH~ environment variable before looking for + Rust's source in ~+rust-src-dir~. + + Now looks for a ~racer~ binary in ~PATH~ before looking in + ~+rust-src-dir~. * 2.0.6 (Oct 05, 2017) + *Module changes:* @@ -122,199 +169,314 @@ * 2.0.5 (Sep 03, 2017) + =doom= - + Added new module: ~tools/rgb~, with tools for dealing with colors (thanks to [[https://github.com/bandresen][bandresen]]) - + Added new module: ~tools/prodigy~, with tools for managing external services (thanks to [[https://github.com/bandresen][bandresen]]) - + Added new module: ~feature/hydra~, offers an extra and customizable layer of modal keybinds (thanks to [[https://github.com/bandresen][bandresen]]) + + Added new module: ~tools/rgb~, with tools for dealing with colors (thanks to + [[https://github.com/bandresen][bandresen]]) + + Added new module: ~tools/prodigy~, with tools for managing external services + (thanks to [[https://github.com/bandresen][bandresen]]) + + Added new module: ~feature/hydra~, offers an extra and customizable layer of + modal keybinds (thanks to [[https://github.com/bandresen][bandresen]]) + Added two new core-lib helpers for macros: ~doom-enlist~ and ~doom-unquote~. - + Switch to ~doom-fallback-buffer~ after using ~doom/kill-all-buffers~ (or ~:killall!~). - + ~make doctor~ now does font detection and will complain when fonts are missing. - + When switching to a new project, a new workspace is spawned and a fuzzy find-file prompt is opened. However, a buffer from the previous workspace would linger on screen *and* the scratch buffer would CD to HOME, rather than the project root. This is fixed now. - + Added module flags to the ~doom!~ macro in init.el, and modified the ~featurep!~ macro so that it can be used to detect these flags from within modules. It is up to modules how to interpret them. More information in [[https://github.com/hlissner/.emacs.d/commit/0b7b8800a2478588bde408c92fcdfa0e43a5baf0][0b7b880]]. - + Fix projectile-find-file not respecting ~default-directory~ (caused by changes upstream). - + Rewrote, revised and expanded module documentation, and created a [[https://github.com/hlissner/.emacs.d/wiki][wiki]] with more information. + + Switch to ~doom-fallback-buffer~ after using ~doom/kill-all-buffers~ (or + ~:killall!~). + + ~make doctor~ now does font detection and will complain when fonts are + missing. + + When switching to a new project, a new workspace is spawned and a fuzzy + find-file prompt is opened. However, a buffer from the previous workspace + would linger on screen *and* the scratch buffer would CD to HOME, rather + than the project root. This is fixed now. + + Added module flags to the ~doom!~ macro in init.el, and modified the + ~featurep!~ macro so that it can be used to detect these flags from within + modules. It is up to modules how to interpret them. More information in + [[https://github.com/hlissner/.emacs.d/commit/0b7b8800a2478588bde408c92fcdfa0e43a5baf0][0b7b880]]. + + Fix projectile-find-file not respecting ~default-directory~ (caused by + changes upstream). + + Rewrote, revised and expanded module documentation, and created a [[https://github.com/hlissner/.emacs.d/wiki][wiki]] with + more information. + Removed the =:L= flag from =map!= and replaced it with a =:local= property. - + Added new function: ~doom|disable-vi-tilde-fringe~ for turning off vi-tilde-fringe in select buffers. - + Added support for relative line numbers (see ~doom-line-numbers-style~), using nlinum-relative on Emacs <26, and display-line-numbers on Emacs 26+. + + Added new function: ~doom|disable-vi-tilde-fringe~ for turning off + vi-tilde-fringe in select buffers. + + Added support for relative line numbers (see ~doom-line-numbers-style~), + using nlinum-relative on Emacs <26, and display-line-numbers on Emacs 26+. + =feature= + =file-templates= Added a file template for: + *.org files + Module README.org files. + =jump= - + Added documentation for ~:jump~ setting, describing the three properties it supports (~:definition~, ~:references~ and ~:documentation~). + + Added documentation for ~:jump~ setting, describing the three properties + it supports (~:definition~, ~:references~ and ~:documentation~). + Rewrote ~+jump/online~ to: - + Use the current selection, if active, or prompt for a query otherwise (with the thing at point as the initial input). - + Prompts for the provider (search engine) on first use, and reuses the last provider on consecutive uses. If the universal argument is supplied, force ~+jump/online~ to prompt for the provider anyway. - + =workspaces= Fix interactive renaming of workspaces, as well as the ability to save and load workspaces from files (see [[https://github.com/hlissner/doom-emacs/pull/200][#200]]). + + Use the current selection, if active, or prompt for a query otherwise + (with the thing at point as the initial input). + + Prompts for the provider (search engine) on first use, and reuses the + last provider on consecutive uses. If the universal argument is + supplied, force ~+jump/online~ to prompt for the provider anyway. + + =workspaces= Fix interactive renaming of workspaces, as well as the ability + to save and load workspaces from files (see [[https://github.com/hlissner/doom-emacs/pull/200][#200]]). + =completion= - + Added all-the-icons support to ~ivy-switch-buffer~ and ~+ivy/switch-workspace-buffer~. Enable this with ~(setq +ivy-buffer-icons t)~. + + Added all-the-icons support to ~ivy-switch-buffer~ and + ~+ivy/switch-workspace-buffer~. Enable this with ~(setq +ivy-buffer-icons + t)~. + =ui= + rainbow-mode is no longer activated on ~prog-mode-hook~. + =doom-modeline= - + Modeline now uses shrink-path.el to shrink the buffer name in the case of a small frame (thanks to [[https://github.com/bandresen][bandresen]]). [[https://github.com/hlissner/.emacs.d/pull/176][See #176]] + + Modeline now uses shrink-path.el to shrink the buffer name in the case of + a small frame (thanks to [[https://github.com/bandresen][bandresen]]). [[https://github.com/hlissner/.emacs.d/pull/176][See #176]] + Fixed mode-line going blank in terminal Emacs (thanks to [[https://github.com/bandresen][bandresen]]). + =doom-dashboard= Fixed "Load last session" button on dashboard. + =tools= - + =eshell= General improvements made to further integrate eshell with Doom (thanks to [[https://github.com/bandresen][bandresen]]). [[https://github.com/hlissner/.emacs.d/pull/160][See #160]] - + =pass= ~+pass-get-field~ now no-ops if used in a non-interactive session (e.g. during testing or byte compilation). - + =neotree= Add =r= and =d= bindings for renaming and deleting files, respectively. + + =eshell= General improvements made to further integrate eshell with Doom + (thanks to [[https://github.com/bandresen][bandresen]]). [[https://github.com/hlissner/.emacs.d/pull/160][See #160]] + + =pass= ~+pass-get-field~ now no-ops if used in a non-interactive session + (e.g. during testing or byte compilation). + + =neotree= Add =r= and =d= bindings for renaming and deleting files, + respectively. + =lang= - + =cc= The advise function ~c-lineup-arglist~ was missing, and has now been reimplemented. - + =haskell= With module flags implemented, Intero support is now available to lang/haskell and is now the default. Dante support is still available with the ~+dante~ flag. - + =java= Now auto-installs meghanda-server on first use, and fixed code-completion in java buffers. + + =cc= The advise function ~c-lineup-arglist~ was missing, and has now been + reimplemented. + + =haskell= With module flags implemented, Intero support is now available to + lang/haskell and is now the default. Dante support is still available with + the ~+dante~ flag. + + =java= Now auto-installs meghanda-server on first use, and fixed + code-completion in java buffers. + =org= - + Fixed vanilla C-j/C-k bindings overshadowing custom window navigation bindings. + + Fixed vanilla C-j/C-k bindings overshadowing custom window navigation + bindings. + Added C-[hjkl] keybindings in insert mode for org table navigation. - + Fixed ~+org/insert-item~ throwing =save-excursion: Wrong type argument: listp, 1= error when used from BOL on the first sub-item in a list. + + Fixed ~+org/insert-item~ throwing =save-excursion: Wrong type argument: + listp, 1= error when used from BOL on the first sub-item in a list. * 2.0.4 (Jul 14, 2017) + *Module changes:* - + Added =tools/password-store= -- Emacs as a password manager, using [[https://www.passwordstore.org/][pass]] as a backend (contributed by [[https://github.com/bandresen][brandresen]]). - + Added =app/irc= -- Emacs as an IRC client, using circe (contributed by [[https://github.com/bandresen][brandresen]]). + + Added =tools/password-store= -- Emacs as a password manager, using [[https://www.passwordstore.org/][pass]] as a + backend (contributed by [[https://github.com/bandresen][brandresen]]). + + Added =app/irc= -- Emacs as an IRC client, using circe (contributed by + [[https://github.com/bandresen][brandresen]]). + ~+pass/ivy~ for ivy integration, with edit/copy field/open url actions. + ~helm-pass~ for helm integration. - + Added =lang/hy= -- support for [[http://hylang.org][hylang]], a combination of Lisp and Python (thanks to [[https://github.com/bandresen][bandresen]]). + + Added =lang/hy= -- support for [[http://hylang.org][hylang]], a combination of Lisp and Python + (thanks to [[https://github.com/bandresen][bandresen]]). + Added =lang/ocaml= -- support for [[https://ocaml.org/][OCAML]] (thanks to [[https://github.com/Ptival][Ptival]]) + Added =lang/plantuml= -- drawing diagrams in plain text + Added =lang/perl= -- Perl6 support for Emacs - + Added =ui/tabbar= -- add tabs to Doom via [[https://github.com/dholm/tabbar][tabbar]] (I don't recommend using it) + + Added =ui/tabbar= -- add tabs to Doom via [[https://github.com/dholm/tabbar][tabbar]] (I don't recommend using + it) + Removed =lang/org= + Added =org= -- a new module category for org and org extensions + Removed =app/present= (replaced mostly with =org/org-present=) - + =org/org-babel= -- executable code snippets in org-mode, with support for a variety of languages. + + =org/org-babel= -- executable code snippets in org-mode, with support for + a variety of languages. + =org/org-capture= -- a better org-capture, in or outside of Emacs. + =org/org-export= -- a centralized export system with more export backends. + =org/org-notebook= -- org-mode as a general notebook. + =org/org-present= -- org-mode for presentations. + Added =tools/impatient-mode= -- show off live buffers via HTTP. + =core= - + New variable: ~doom-host-dir~, as a base path for ~doom-etc-dir~ and ~doom-cache-dir~. - + New hooks: ~doom-init-hook~ and ~doom-post-init-hook~, which are run on ~emacs-startup-hook~. This is meant to simplify post-Emacs initialization hooks (~after-init-hook~, ~emacs-startup-hook~ and ~window-setup-hook~) into two unambiguous ones. - + Fix =private//init.el= not being auto-loaded when the user's private module is absent in the root init.el file. - + Improve error handling across the board. Emacs should now report more helpful errors. Catastrophic errors will be less likely to inhibit later modules from being loaded. + + New variable: ~doom-host-dir~, as a base path for ~doom-etc-dir~ and + ~doom-cache-dir~. + + New hooks: ~doom-init-hook~ and ~doom-post-init-hook~, which are run on + ~emacs-startup-hook~. This is meant to simplify post-Emacs initialization + hooks (~after-init-hook~, ~emacs-startup-hook~ and ~window-setup-hook~) into + two unambiguous ones. + + Fix =private//init.el= not being auto-loaded when the + user's private module is absent in the root init.el file. + + Improve error handling across the board. Emacs should now report more + helpful errors. Catastrophic errors will be less likely to inhibit later + modules from being loaded. + Unit-tests have been moved to their respective modules (and =core/test/=). - + Fix ~def-setting!~ to act more like ~defmacro~; don't aggressively evaluate its arguments on expansion. - + New function: ~doom-set-buffer-real BUFFER FLAG~ -- makes Doom consider BUFFER real, no matter what. - + Add INSTALLED-ONLY-P argument to ~doom-get-packages~ to filter packages that aren't installed. + + Fix ~def-setting!~ to act more like ~defmacro~; don't aggressively evaluate + its arguments on expansion. + + New function: ~doom-set-buffer-real BUFFER FLAG~ -- makes Doom consider + BUFFER real, no matter what. + + Add INSTALLED-ONLY-P argument to ~doom-get-packages~ to filter packages that + aren't installed. + =core-ui= - + Add quit confirmation when trying to close a frame that contains real buffers. - + Fix quit confirmations for clients connected to ~emacs --daemon~ with ~emacsclient~. - + Brought back [[https://github.com/hlissner/emacs-nlinum-hl][nlinum-hl]], which offers some line number fixes for web-mode and markdown-mode. - + Don't report the buffer modified when injecting (or deleting) trailing whitespace in ~doom|inject-trailing-whitespace~ and ~doom|init-highlight-indentation~. + + Add quit confirmation when trying to close a frame that contains real + buffers. + + Fix quit confirmations for clients connected to ~emacs --daemon~ with + ~emacsclient~. + + Brought back [[https://github.com/hlissner/emacs-nlinum-hl][nlinum-hl]], which offers some line number fixes for web-mode + and markdown-mode. + + Don't report the buffer modified when injecting (or deleting) trailing + whitespace in ~doom|inject-trailing-whitespace~ and + ~doom|init-highlight-indentation~. + [[https://github.com/domtronn/all-the-icons.el][all-the-icons]] now fails gracefully in the terminal. - + New hook: ~doom-init-ui-hook~, run whenever the UI needs to be reloaded (and once at startup). Theme and font loading is also attached to this hook. - + New variables for font and theme loading: ~doom-theme~, ~doom-font~, ~doom-variable-pitch-font~, and ~doom-unicode-font~. - + New variables for customizing line numbers: ~doom-line-number-lpad~, ~doom-line-number-rpad~, and ~doom-line-number-pad-char~. These were added to facilitate custom whitespace characters in line numbers, e.g. /u2002 (a unicode character that looks like a space). Doing so fixes an issue where ~whitespace-mode~ with ~space-mark~ would replace all space characters indiscriminately, even in line numbers. - + Add hooks ~doom-pre-reload-theme-hook~ and ~doom-post-reload-theme-hook~ to ~doom/reload-theme~ command. + + New hook: ~doom-init-ui-hook~, run whenever the UI needs to be reloaded + (and once at startup). Theme and font loading is also attached to this + hook. + + New variables for font and theme loading: ~doom-theme~, ~doom-font~, + ~doom-variable-pitch-font~, and ~doom-unicode-font~. + + New variables for customizing line numbers: ~doom-line-number-lpad~, + ~doom-line-number-rpad~, and ~doom-line-number-pad-char~. These were added + to facilitate custom whitespace characters in line numbers, e.g. /u2002 (a + unicode character that looks like a space). Doing so fixes an issue where + ~whitespace-mode~ with ~space-mark~ would replace all space characters + indiscriminately, even in line numbers. + + Add hooks ~doom-pre-reload-theme-hook~ and ~doom-post-reload-theme-hook~ + to ~doom/reload-theme~ command. + =core-popups= - + Fix an issue where more specific popup rules were being overriden by more general rules. - + New command: ~doom/other-popup~ -- cycles between open popup windows and the original buffer that you originated from. Discussed in [[https://github.com/hlissner/.emacs.d/issues/141][#141]]. + + Fix an issue where more specific popup rules were being overriden by more + general rules. + + New command: ~doom/other-popup~ -- cycles between open popup windows and + the original buffer that you originated from. Discussed in [[https://github.com/hlissner/.emacs.d/issues/141][#141]]. + =core-editor= - + Change what files recentf will ignore: everything in ~doom-host-dir~ is now ignored and anything else in ~doom-local-dir~ won't be. - + New interactive command: ~doom/scratch-buffer~ (replaces ~+doom:scratch-buffer~ in =:ui doom=). + + Change what files recentf will ignore: everything in ~doom-host-dir~ is + now ignored and anything else in ~doom-local-dir~ won't be. + + New interactive command: ~doom/scratch-buffer~ (replaces + ~+doom:scratch-buffer~ in =:ui doom=). + =core-packages= - + Generalize ~doom-package-*-p~ functions into ~(doom-package-prop NAME PROPERTY)~. - + Fix quelpa temporary files (in ~quelpa-build-dir~) not being removed when a quelpa package was uninstalled. - + New hook: ~doom-reload-hook~ (sort of). This has been around for a while, but now it is defined and documented. It runs when ~doom/reload-load-path~ is called (which gets called remotely if you run package management while an Emacs session is active). + + Generalize ~doom-package-*-p~ functions into ~(doom-package-prop NAME + PROPERTY)~. + + Fix quelpa temporary files (in ~quelpa-build-dir~) not being removed when + a quelpa package was uninstalled. + + New hook: ~doom-reload-hook~ (sort of). This has been around for a while, + but now it is defined and documented. It runs when ~doom/reload-load-path~ + is called (which gets called remotely if you run package management while + an Emacs session is active). + ~load!~ can now accept a string as its first argument (the path). + =feature= + =feature/evil= - + Remove =goto-last-change=, which conflicts with =goto-chg=, which is a dependency of evil (that does the exact same thing, but is what evil uses). + + Remove =goto-last-change=, which conflicts with =goto-chg=, which is a + dependency of evil (that does the exact same thing, but is what evil + uses). + =feature/jump= + Remove ~:xref-backend~ setting (replaced with ~:jump~). - + Add ~:jump MAJOR-MODE &rest PLIST~ setting, which recognizes four properties (that accept functions/commands): + + Add ~:jump MAJOR-MODE &rest PLIST~ setting, which recognizes four + properties (that accept functions/commands): + ~:definition~: jumps to the definition of the symbol under point. - + ~:references~: lists all references of the symbol at point and lets you jump to them. + + ~:references~: lists all references of the symbol at point and lets you + jump to them. + ~:documentation~: shows documentation for the symbol at point. - + ~:xref-backend~: a function that serves as an xref backend; this replaces ~:definition~ and ~:references~. + + ~:xref-backend~: a function that serves as an xref backend; this + replaces ~:definition~ and ~:references~. + =feature/workspaces= - + New function: ~+workspace-contains-buffer-p &optional BUFFER PERSP~ -- return non-nil if BUFFER (defaults to current buffer) is in PERSP (defaults to current perspective). + + New function: ~+workspace-contains-buffer-p &optional BUFFER PERSP~ -- + return non-nil if BUFFER (defaults to current buffer) is in PERSP + (defaults to current perspective). + Fix ~+workspace-p~ not detecting a perspective struct. + Fix ~+workspace-buffer-list~ not preserving buffer order (by recency). + =completion= + =completion/company= - + Add ~company-dabbrev~ and ~company-ispell~ to the default Company backends. This ensures you have some completion available in buffers previously without any. This is especially useful for text-mode buffers. Discussed in [[https://github.com/hlissner/.emacs.d/issues/134][#134]]. + + Add ~company-dabbrev~ and ~company-ispell~ to the default Company + backends. This ensures you have some completion available in buffers + previously without any. This is especially useful for text-mode buffers. + Discussed in [[https://github.com/hlissner/.emacs.d/issues/134][#134]]. + =ui= + =ui/doom= - + Vastly improve daemon and terminal support for doom-themes by reloading the theme when a new client is attached, or new terminal/daemon frame is created. This prevents incorrect colors from bleeding across face class barriers. - + Removed evil command ~+doom:scratch-buffer~ (replaced with ~doom/scratch-buffer~ in =core-ui=). - + Decoupled font and theme loading from this module. This has now been delegated to =core-ui=. These variables no longer exist: ~+doom-theme~, ~+doom-font~, ~+doom-variable-pitch-font~, ~+doom-unicode-font~. Discussed in [[https://github.com/hlissner/.emacs.d/issues/117][#117]]. + + Vastly improve daemon and terminal support for doom-themes by reloading + the theme when a new client is attached, or new terminal/daemon frame is + created. This prevents incorrect colors from bleeding across face class + barriers. + + Removed evil command ~+doom:scratch-buffer~ (replaced with + ~doom/scratch-buffer~ in =core-ui=). + + Decoupled font and theme loading from this module. This has now been + delegated to =core-ui=. These variables no longer exist: ~+doom-theme~, + ~+doom-font~, ~+doom-variable-pitch-font~, ~+doom-unicode-font~. Discussed + in [[https://github.com/hlissner/.emacs.d/issues/117][#117]]. + =ui/doom-dashboard= + Fix dashboard not opening in emacsclient/daemon frames. - + Add =gg= and =G= keybinds in dashboard for moving to the first and last button (respectively). + + Add =gg= and =G= keybinds in dashboard for moving to the first and last + button (respectively). + =ui/doom-modeline= - + Reorganize order of modeline segments, placing the vc branch last. This minimizes the non-uniform spacing caused by all-the-icon icons. - + Fix blank mode-line caused by a nil buffer-file-name (used in vcs segment). For example, in org indirect buffers. + + Reorganize order of modeline segments, placing the vc branch last. This + minimizes the non-uniform spacing caused by all-the-icon icons. + + Fix blank mode-line caused by a nil buffer-file-name (used in vcs + segment). For example, in org indirect buffers. + =tools= + =tools/neotree= - + Fix neotree refusing to open when it was already open in another frame. This is especially frustrating when neotree is open in a (likely buried) terminal emacsclient session, and you're trying to open neotree in another. + + Fix neotree refusing to open when it was already open in another frame. + This is especially frustrating when neotree is open in a (likely buried) + terminal emacsclient session, and you're trying to open neotree in + another. + =lang= + =lang/cc= + Add code completion to glsl-mode (powered by [[https://github.com/Kaali/company-glsl][company-glsl]]). + =lang/markdown= - + Source blocks are now fontified natively, with the fontification of their native major-modes (see ~markdown-fontify-code-blocks-natively~). + + Source blocks are now fontified natively, with the fontification of their + native major-modes (see ~markdown-fontify-code-blocks-natively~). + =lang/sh= - + Fix fontification of command substitutions in double-quoted strings to help distinguish them from the rest of string literals. + + Fix fontification of command substitutions in double-quoted strings to + help distinguish them from the rest of string literals. + =lang/web= + Fix HTML entity encoding/decoding functions. + =org= + =org/org= + Fix M-RET in plain lists not preserving indent level for new items. - + Fix cursor jumping away when toggling folds or realigning org tables (pressing TAB). - + Minimized keybindings into the bare necessities; most custom bindings have been moved to my private module. + + Fix cursor jumping away when toggling folds or realigning org tables + (pressing TAB). + + Minimized keybindings into the bare necessities; most custom bindings have + been moved to my private module. + =org/org-capture= + Start org-capture-mode in insert-mode (if evil is loaded). * 2.0.3 (Jun 11, 2017) + *New modules* - + =ui/unicode= -- fixes unicode font-rendering for a variety of languages, using [[https://github.com/rolandwalker/unicode-fonts][unicode-fonts]]. - + =ui/evil-goggles= -- visual feedback for edit operations in evil-mode, using [[https://github.com/edkolev/evil-goggles][evil-goggles]]. - + =ui/nav-flash= (extracted from =ui/doom=) -- flashes current line when moving cursor considerable distrances, using [[https://github.com/rolandwalker/nav-flash][nav-flash]]. - + =tools/neotree= (extracted from =feature/evil=) -- a file explorer sidebar, using [[https://github.com/jaypei/emacs-neotree/][neotree]]. + + =ui/unicode= -- fixes unicode font-rendering for a variety of languages, + using [[https://github.com/rolandwalker/unicode-fonts][unicode-fonts]]. + + =ui/evil-goggles= -- visual feedback for edit operations in evil-mode, using + [[https://github.com/edkolev/evil-goggles][evil-goggles]]. + + =ui/nav-flash= (extracted from =ui/doom=) -- flashes current line when + moving cursor considerable distrances, using [[https://github.com/rolandwalker/nav-flash][nav-flash]]. + + =tools/neotree= (extracted from =feature/evil=) -- a file explorer sidebar, + using [[https://github.com/jaypei/emacs-neotree/][neotree]]. + =core= - + New special file: =private//init.el= is now loaded before modules (after core). + + New special file: =private//init.el= is now loaded before + modules (after core). + =:private = is now automatically loaded by ~doom!~. + New help command: ~doom/describe-module~ -- for DOOM modules. + New help command: ~doom/describe-setting~ -- for possible ~set!~ targets. + Add =make doctor= to diagnose common issues with your setup & environment. - + Removed ~def-bootstrap~ & ~doom-bootstrap~. It was a clumsy system. I'll replace it with README.org files in each module, with working, tangle-able source blocks. + + Removed ~def-bootstrap~ & ~doom-bootstrap~. It was a clumsy system. I'll + replace it with README.org files in each module, with working, tangle-able + source blocks. + =core-os= + Don't use GTK tooltips on Linux (ugly!). + =core-ui= + New plugin: [[https://github.com/syl20bnr/vi-tilde-fringe][vi-tilde-fringe]] -- subtle, vim-ish empty-line indicator. - + New variable: ~doom-ui-mode-names~ (alist) -- for changing ~mode-name~ of major-modes. - + Fix left-over hl-line overlays when hl-line-mode is uncleanly killed (e.g. when the major-mode is changed). + + New variable: ~doom-ui-mode-names~ (alist) -- for changing ~mode-name~ of + major-modes. + + Fix left-over hl-line overlays when hl-line-mode is uncleanly killed (e.g. + when the major-mode is changed). + Fix disappearing line numbers in nlinum (thanks to [[https://github.com/gilbertw1][gilbertw1]]). + Move theme/font bootstrap to core-ui. + New hook: ~doom-init-ui-hook~ + New global minor-mode ~doom-big-font-mode~ and variable ~doom-big-font~. + =core-keybinds= - + New property for ~map!~: ~:textobj~ -- for binding to evil text objects keymaps. + + New property for ~map!~: ~:textobj~ -- for binding to evil text objects + keymaps. + Fix ~:after~ & ~:map*~ properties in ~map!~ macro (wasn't working at all). - + Change keybinding scheme; the leader key is now =SPC= and localleader =SPC m=, inspired by spacemacs. + + Change keybinding scheme; the leader key is now =SPC= and localleader =SPC + m=, inspired by spacemacs. + Enable which-key pops up for all keys. + =core-popups= + Properly persist ~popup~ window parameter between sessions. - + Improve magit+shackle integration; ensures that links will be followed within the popup they were opened. - + Add ~doom-popup-no-fringe~ option (default = t). When non-nil, fringes will be disabled in popup windows (in ~doom-popup-mode~). + + Improve magit+shackle integration; ensures that links will be followed + within the popup they were opened. + + Add ~doom-popup-no-fringe~ option (default = t). When non-nil, fringes + will be disabled in popup windows (in ~doom-popup-mode~). + =core-packages= + Fix failure to detect out-of-date QUELPA packages. + Fix ~custom-file~ (and custom settings) not being loaded. - + Fix crash in ~doom-update-package~ caused by unreachable, new dependencies. + + Fix crash in ~doom-update-package~ caused by unreachable, new + dependencies. + Make ~doom-update-package~ atomic in case of failure. + Make ~doom-refresh-packages~ async. - + Improve the security of package management (via ELPA) by a) forcing Emacs to verify TLS connections and b) use HTTPS sources for MELPA and ELPA. - + Make ~doom-get-outdated-packages~ asynchronous, producing a substantial speed-up when updating packages from Quelpa sources. + + Improve the security of package management (via ELPA) by a) forcing Emacs + to verify TLS connections and b) use HTTPS sources for MELPA and ELPA. + + Make ~doom-get-outdated-packages~ asynchronous, producing a substantial + speed-up when updating packages from Quelpa sources. + =feature= + =feature/evil= + Add ~+evil:mc~ command [[https://github.com/gabesoft/evil-mc][evil-mc]]. + Add ~+evil/mc-make-cursor-here~, with visual-block support for [[https://github.com/gabesoft/evil-mc][evil-mc]]. + =d= (operator) now invokes ~wgrep-mark-deletion~ in wgrep buffers. - + New code folding system that combines hideshow (built-in; for indent/marker-based folds) and [[https://github.com/alexmurray/evil-vimish-fold][evil-vimish-fold]] (for arbitrary folds). + + New code folding system that combines hideshow (built-in; for + indent/marker-based folds) and [[https://github.com/alexmurray/evil-vimish-fold][evil-vimish-fold]] (for arbitrary folds). + Fix [[https://github.com/redguardtoo/evil-matchit][evil-matchit]] in visual mode. + Fix [[https://github.com/hlissner/evil-multiedit][evil-multiedit]] M-d bindings. + Fix stringp error caused by unintialized state in hideshow. + Fix evil normal-mode keybindings in help-mode popups. - + Change how ~+evil-esc-hook~ hooks are handled: they now short-circuit on the first hook to return non-nil. + + Change how ~+evil-esc-hook~ hooks are handled: they now short-circuit on + the first hook to return non-nil. + Remove ~+evil/matchit~ (thin wrapper around ~evilmi-jump-items~). + Remove [[https://github.com/jaypei/emacs-neotree/][neotree]] plugin (moved to =tools/neotree=). + =feature/jump= @@ -322,18 +484,27 @@ + =feature/workspaces= + No longer saves session on quit if session was blank. + Fix persp-mode switching to main workspace if auto-resume is on. - + Fix ~+workspace-get~ returning a non-nil "null perspective" on some occasions where NAME doesn't exist. This is because ~persp-get-by-name~ returns the value of ~persp-not-persp~ to signify null instead of actual nil. - + Decouple workspace buffer-list functions from doom buffer library. Now, the workspaces module will explicitly advise ~doom-buffer-list~. - + ~+workspace-list~ now returns a list of perspective structs, rather than a list of strings. ~+workspace-list-names~ was introduced for the latter. + + Fix ~+workspace-get~ returning a non-nil "null perspective" on some + occasions where NAME doesn't exist. This is because ~persp-get-by-name~ + returns the value of ~persp-not-persp~ to signify null instead of actual + nil. + + Decouple workspace buffer-list functions from doom buffer library. Now, + the workspaces module will explicitly advise ~doom-buffer-list~. + + ~+workspace-list~ now returns a list of perspective structs, rather than a + list of strings. ~+workspace-list-names~ was introduced for the latter. + =completion= + =completion/company= - + Change ~:company-backends~ to accept a variadic list of backends to prepend to ~company-backends~. Its signature is now ~(set! :company-backends MODES &rest BACKENDS)~ ([[https://github.com/hlissner/.emacs.d/pull/125][#125]]). + + Change ~:company-backends~ to accept a variadic list of backends to + prepend to ~company-backends~. Its signature is now ~(set! + :company-backends MODES &rest BACKENDS)~ ([[https://github.com/hlissner/.emacs.d/pull/125][#125]]). + =completion/ivy= + Flexible column width for ~+ivy/tasks~. + =ui= + =ui/doom= - + New plugin: [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]] -- replaces ~doom-buffer-mode~; brightens source windows and dims transient, temporary, or popup windows. - + BREAKING CHANGE: Decoupled theme and font loading from ui/doom. This has been moved to core-ui. The following variables have been renamed: + + New plugin: [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]] -- replaces ~doom-buffer-mode~; brightens source + windows and dims transient, temporary, or popup windows. + + BREAKING CHANGE: Decoupled theme and font loading from ui/doom. This has + been moved to core-ui. The following variables have been renamed: + ~+doom-theme~ => ~doom-theme~ + ~+doom-font~ => ~doom-font~ + ~+doom-variable-pitch-font~ => ~doom-variable-pitch-font~ @@ -344,22 +515,26 @@ + The vcs segment now uses a slightly darker color (in clean branches). + Fix blank mode-line when buffer-file-name is nil ([[https://github.com/hlissner/.emacs.d/pull/130][#130]]) + =ui/nav-flash= - + Fix over-aggressive nav-flash'ing on evil-multiedit or in eshell/term buffers. + + Fix over-aggressive nav-flash'ing on evil-multiedit or in eshell/term + buffers. + =tools= + =tools/gist= + Changed new gists to be private by default. + =lang= + =lang/haskell= - + New plugin: [[https://github.com/iquiw/company-ghc][company-ghc]] -- code-completion support for haskell (requires ~ghc-mod~). + + New plugin: [[https://github.com/iquiw/company-ghc][company-ghc]] -- code-completion support for haskell (requires + ~ghc-mod~). + =lang/php= - + New plugin: [[https://github.com/xcwen/ac-php][company-php]] -- code-completion support for php (requires a TAGs file created with [[https://github.com/xcwen/phpctags][phpctags]]). + + New plugin: [[https://github.com/xcwen/ac-php][company-php]] -- code-completion support for php (requires a + TAGs file created with [[https://github.com/xcwen/phpctags][phpctags]]). + =lang/emacs-lisp= + Omit defuns inside macros from the imenu index. + Don't enable ~flycheck-mode~ in emacs.d files. + =lang/org= + Replace org-bullets source with more up-to-date fork. + =lang/scala= - + Fix ~void-variable imenu-auto-rescan~ error caused by ~ensime--setup-imenu~ trying to use imenu variables before loading imenu. + + Fix ~void-variable imenu-auto-rescan~ error caused by + ~ensime--setup-imenu~ trying to use imenu variables before loading imenu. + =private/hlissner= + Add =gzz= binding (~+evil/mc-make-cursor-here~) + Add =:mc= ex command (~+evil:mc~) @@ -370,15 +545,26 @@ * 2.0.2 (May 13, 2017) + *New modules* + =tools/gist= -- allows you to manage and create gists, using [[https://github.com/defunkt/gist.el][gist.el]]. - + =tools/term= -- quickly spawn a terminal (in a popup or buffer) using [[https://github.com/emacsorphanage/multi-term][multi-term]] + + =tools/term= -- quickly spawn a terminal (in a popup or buffer) using + [[https://github.com/emacsorphanage/multi-term][multi-term]] + =app/twitter= -- Emacs as a twitter client, using [[https://github.com/hayamiz/twittering-mode][twittering-mode]] + =core= - + Stop "buffer is read-only" messages while in minibuffer, when I accidentally try to edit the prompt. It's correct behavior, but it consumes the minibuffers, hiding what I'm typing. - + Fix Emacs daemon compatibility with DOOM, which assumed a frame will always be visible on startup, causing errors when Emacs is launched as a daemon. - + Code-style change: use sharp-quote for functions. This makes the byte-compiler output missing-function warnings when they can't be found, which is helpful. - + Stop projectile & git-gutter checks when in a TRAMP buffer; it causes tremendous slowdowns, to the point of being unusable. - + Add ~message!~ & ~format!~ macros for printing colored output either a) in a popup buffer when in an interactive session or b) with ansi codes when in an noninteractive session. - + Changed ~doom/recompile~ to aggresively recompile =core/core.el= to fix load-path inconsistencies when you've byte-compiled your config and run a package management command. + + Stop "buffer is read-only" messages while in minibuffer, when I accidentally + try to edit the prompt. It's correct behavior, but it consumes the + minibuffers, hiding what I'm typing. + + Fix Emacs daemon compatibility with DOOM, which assumed a frame will always + be visible on startup, causing errors when Emacs is launched as a daemon. + + Code-style change: use sharp-quote for functions. This makes the + byte-compiler output missing-function warnings when they can't be found, + which is helpful. + + Stop projectile & git-gutter checks when in a TRAMP buffer; it causes + tremendous slowdowns, to the point of being unusable. + + Add ~message!~ & ~format!~ macros for printing colored output either a) in a + popup buffer when in an interactive session or b) with ansi codes when in an + noninteractive session. + + Changed ~doom/recompile~ to aggresively recompile =core/core.el= to fix + load-path inconsistencies when you've byte-compiled your config and run a + package management command. + =core-lib= + Add ~:append~ support to ~add-transient-hook!~ macro. + =core-popups= @@ -394,33 +580,45 @@ + Fix lack of syntax highlighting in scratch buffer + Use comment face as default color for ~+doom-folded-face~ + =ui/doom-modeline= - + Fix modeline disappearing due to loss of state. ~doom--modeline-format~ was being killed when switching major modes. + + Fix modeline disappearing due to loss of state. ~doom--modeline-format~ + was being killed when switching major modes. + =feature= + =feature/eval= + Fix ~:repl~ & ~+eval/repl-send-region~. - + Fix ~+eval/region~ failing only on first invocation because ~+eval-runners~ wasn't populated until quickrun is loaded. + + Fix ~+eval/region~ failing only on first invocation because + ~+eval-runners~ wasn't populated until quickrun is loaded. + Add TAB auto-completion in comint-mode and REPL buffers + =feature/evil= + Fix ~:mv~ & ~:rm~. - + Fix Neotree forgetting that it's a neotree window when switching perspectives. - + New plugin: [[https://github.com/gabesoft/evil-mc][evil-mc]] -- multiple cursors for evil-mode (thanks to [[https://github.com/gilbertw1][gilbertw1]]) - + Achieve vim parity w/ file modifiers (~+evil*ex-replace-special-filenames~) + + Fix Neotree forgetting that it's a neotree window when switching + perspectives. + + New plugin: [[https://github.com/gabesoft/evil-mc][evil-mc]] -- multiple cursors for evil-mode (thanks to + [[https://github.com/gilbertw1][gilbertw1]]) + + Achieve vim parity w/ file modifiers + (~+evil*ex-replace-special-filenames~) + =feature/version-control= + New plugin: [[https://github.com/pidu/git-timemachine][git-timemachine]] -- stepping through a file's git history. - + New plugin: [[https://github.com/sshaw/git-link][git-link]] -- generates and opens links to "this file"'s remote repo with your default browser. + + New plugin: [[https://github.com/sshaw/git-link][git-link]] -- generates and opens links to "this file"'s remote + repo with your default browser. + Add ~:gbrowse~: find this file on github/gitlab/bitbucket in your browser. + Add ~:gissues~: open this project's issues page in your browser. + Fix ~+vcs/git-browse~ and ~+vcs/git-browse-issues~. + =feature/workspaces= + Add BANG modifier to ~:cleanup~ to span all workspaces. - + Since persp-mode handles its "nil" perspective differently from others, pretend that it doesn't exist and spawn a new "main" perspective. + + Since persp-mode handles its "nil" perspective differently from others, + pretend that it doesn't exist and spawn a new "main" perspective. + =completion= + =completion/ivy= + Add ~+ivy-do-action!~ factory macro. Use it for in-ivy keybindings. - + Add ripgrep file search support. Ripgrep doesn't support multiline searches, but is faster. Use =ag= for multiline (or more PCRE-compliant) searches. - + Reverse ivy's built-in behavior of reversing escaping of parentheses when using the_silver_searcher or ripgrep. If you want literal parentheses, escape them explicitly. + + Add ripgrep file search support. Ripgrep doesn't support multiline + searches, but is faster. Use =ag= for multiline (or more PCRE-compliant) + searches. + + Reverse ivy's built-in behavior of reversing escaping of parentheses when + using the_silver_searcher or ripgrep. If you want literal parentheses, + escape them explicitly. + Removed ~def-counsel-action!~ - + When a selection is used for ~:ag~, the selected text is now regexp-escaped. + + When a selection is used for ~:ag~, the selected text is now + regexp-escaped. + =tools= + =tools/tmux= + Fix and refactor library (general update). @@ -431,63 +629,90 @@ + Improve electric indent support for ~js2-mode~ and ~rjsx-mode~ + =lang/org= + Fix org-checkbox-statistics not respecting underlying faces - + Disable ~show-paren-mode~ in org-mode due to conflicts with org-indent which cause indentation flickering. - + Bind ~M-z~ (~undo~), ~C-u~ (~delete-line~) and ~C-w~ (~delete-word~) in ~org-store-link~ and ~org-insert-link~ prompts. - + Apply org-headline-done face to checked-checkbox lines, to match how DONE headlines look. Also applies this to items whose subitems are all complete. - + Changed default fold behavior when loading an org-file to unfold first level folds. - + Add =bin/org-capture= shell script for invoking the org-capture frame from outside Emacs. - + Add babel support for: rust, restclient, sql, google translate, haskell and go. - + Add ~+org-pretty-mode~ for toggling "pretty" fontification. Prettified entities or hidden regions can make editing difficult. + + Disable ~show-paren-mode~ in org-mode due to conflicts with org-indent + which cause indentation flickering. + + Bind ~M-z~ (~undo~), ~C-u~ (~delete-line~) and ~C-w~ (~delete-word~) in + ~org-store-link~ and ~org-insert-link~ prompts. + + Apply org-headline-done face to checked-checkbox lines, to match how DONE + headlines look. Also applies this to items whose subitems are all + complete. + + Changed default fold behavior when loading an org-file to unfold first + level folds. + + Add =bin/org-capture= shell script for invoking the org-capture frame from + outside Emacs. + + Add babel support for: rust, restclient, sql, google translate, haskell + and go. + + Add ~+org-pretty-mode~ for toggling "pretty" fontification. Prettified + entities or hidden regions can make editing difficult. + =lang/python= + Add ipython detection and REPL support - + Simplify matchit key (%) in python. The default is to prioritize if-else and other blocks over brackets. I found this frustrating. + + Simplify matchit key (%) in python. The default is to prioritize if-else + and other blocks over brackets. I found this frustrating. + =lang/web= - + Fix ~+web-encode-entities~, ~+web-decode-entities~, ~+web/encode-entities-region~ and ~+web/decode-entities-region~. + + Fix ~+web-encode-entities~, ~+web-decode-entities~, + ~+web/encode-entities-region~ and ~+web/decode-entities-region~. + =app= + =app/email= + Replace mbsync with offlineimap. - + Add support for marking multiple emails when in visual-mode (evil) in a ~mu4e-headers-mode~ buffer. + + Add support for marking multiple emails when in visual-mode (evil) in a + ~mu4e-headers-mode~ buffer. + Fix trash mark causing duplicates upstream. + Make refiling more compatible with archiving in gmail. + =private/hlissner= - + Add keybinds for [[https://github.com/gabesoft/evil-mc][evil-mc]]: based around ~gz~ (like ~gzz~ to toggle cursor freeze, and ~gzc~ to create a cursor "here"). + + Add keybinds for [[https://github.com/gabesoft/evil-mc][evil-mc]]: based around ~gz~ (like ~gzz~ to toggle cursor + freeze, and ~gzc~ to create a cursor "here"). + Add keybinds for [[https://github.com/hlissner/evil-multiedit][evil-multiedit]]: based around ~M-d~ and ~M-D~. + Replace ~:find~ with ~:ag~, ~:agc[wd]~, ~:rg~ and ~:rgc[wd]~. + Fix ~:x~ ex command (open scratch buffer) * 2.0.1 (Apr 8, 2017) + *New modules* - + =feature/jump= -- extra code navigation tools, a jump-to-definition implementation that just works ([[https://github.com/jacktasia/dumb-jump][dumb-jump]]), and tools for looking things up online. + + =feature/jump= -- extra code navigation tools, a jump-to-definition + implementation that just works ([[https://github.com/jacktasia/dumb-jump][dumb-jump]]), and tools for looking things up + online. + =app/rss= -- Emacs as an RSS reader, using [[https://github.com/skeeto/elfeed][elfeed]] + =core= + Fix ~doom-kill-process-buffers~ not killing process buffers. + Fix ~hippie-expand~ in ex mode/the minibuffer. + Remove unnecessary ~provide~'s in core autoloaded libraries. - + Fix ~doom-buffers-in-mode~ not detecting buffers in major-modes derived from the target mode. + + Fix ~doom-buffers-in-mode~ not detecting buffers in major-modes derived from + the target mode. + Fix out-of-bounds error in ~doom/backward-delete-whitespace-to-column~. + Remove ~doom/append-semicolon~; use evil append mode instead. - + Add module bootstrapping mechanism (for installing external dependencies); see ~doom-bootstrap~, ~make bootstrap~ and ~def-bootstrap!~. + + Add module bootstrapping mechanism (for installing external dependencies); + see ~doom-bootstrap~, ~make bootstrap~ and ~def-bootstrap!~. + Use ~doom-local-dir~ for TRAMP's temp files. - + New variable: ~doom-real-buffer-functions~ -- for customizing how ~doom-real-buffer-p~ determines what a "real" buffer is. - + Add ~def-memoize!~ for defining memoized functions and ~doom-memoize~ for memoizing existing ones. + + New variable: ~doom-real-buffer-functions~ -- for customizing how + ~doom-real-buffer-p~ determines what a "real" buffer is. + + Add ~def-memoize!~ for defining memoized functions and ~doom-memoize~ for + memoizing existing ones. + =core-lib= + Fix ~remove-hook!~ macro not expanding correctly. - + New macro: ~add-transient-hook!~; attach a hook to a hook or function that will remove itself once it runs. + + New macro: ~add-transient-hook!~; attach a hook to a hook or function that + will remove itself once it runs. + =core-packages= + Add ~doom/recompile~, for re-byte-compiling DOOM. - + Add ~doom/compile-lite~ / ~make compile-lite~, which will only byte-compile DOOM's core files, which is a lighter alternative to ~doom/compile~. + + Add ~doom/compile-lite~ / ~make compile-lite~, which will only + byte-compile DOOM's core files, which is a lighter alternative to + ~doom/compile~. + Fix duplicates packages appearing in package-management retrieval library. + =core-os= - + Reducing how aggressive ~exec-path~ caching is. A =persistent-soft= /and/ byte-compilation cache is excessive. The latter is good (and flexible) enough. + + Reducing how aggressive ~exec-path~ caching is. A =persistent-soft= /and/ + byte-compilation cache is excessive. The latter is good (and flexible) + enough. + =core-popups= + Set default ~:align~ and ~:select~ shackle properties (of =8= and =below=). + =core-editor= - + Advise ~delete-trailing-whitespace~ to not affect current line. If evil is loaded, then it may affect the current line if we're *not* in insert mode. + + Advise ~delete-trailing-whitespace~ to not affect current line. If evil is + loaded, then it may affect the current line if we're *not* in insert mode. + =core-projects= - + Recognize =package.json= as a project-root file (see ~projectile-project-root-files~). + + Recognize =package.json= as a project-root file (see + ~projectile-project-root-files~). + Fix ~:files~ property in ~def-project-mode!~ not detecting project files. + =core-ui= - + Replace [[https://github.com/DarthFennec/highlight-indent-guides][highlight-indent-guides-mode]] with [[https://github.com/antonj/Highlight-Indentation-for-Emacs/][highlight-indentation-mode]]; the former won't display indent guides on blank lines, even with my whitespace injection hook. + + Replace [[https://github.com/DarthFennec/highlight-indent-guides][highlight-indent-guides-mode]] with [[https://github.com/antonj/Highlight-Indentation-for-Emacs/][highlight-indentation-mode]]; the + former won't display indent guides on blank lines, even with my whitespace + injection hook. + =feature= + =feature/eval= + Fix build tasks system; now tested and works. @@ -499,20 +724,27 @@ + Enable ~yas-triggers-in-field~, which adds support for nested snippets. + Fix snippet aliases (~%alias~). + =feature/version-control= - + Remove ~evil-magit~ and evil-ified bindings for magit in general. Instead, just use emacs mode. If evil is needed, toggle it with =C-z=. + + Remove ~evil-magit~ and evil-ified bindings for magit in general. Instead, + just use emacs mode. If evil is needed, toggle it with =C-z=. + =feature/workspaces= + Fix ~+workspace/kill-session~ not actually killing the session. - + Revert forcing persp-mode to stay quiet when it saves the session to file. It just isn't important enough. - + Create a new perspective when switching projects (integrates projectile with persp-mode). + + Revert forcing persp-mode to stay quiet when it saves the session to file. + It just isn't important enough. + + Create a new perspective when switching projects (integrates projectile + with persp-mode). + Create a new perspective for new frames. + =ui= + =ui/doom= - + Improve ~doom-buffer-mode~ heuristics with ~doom-real-buffer-p~, so that only truly real buffers are enlightened. - + Replace plugin [[https://github.com/Malabarba/beacon][beacon]] with [[https://github.com/rolandwalker/nav-flash][nav-flash]] -- the former had a habit of causing pauses and pushing my cursor. It also didn't look as nice. + + Improve ~doom-buffer-mode~ heuristics with ~doom-real-buffer-p~, so that + only truly real buffers are enlightened. + + Replace plugin [[https://github.com/Malabarba/beacon][beacon]] with [[https://github.com/rolandwalker/nav-flash][nav-flash]] -- the former had a habit of causing + pauses and pushing my cursor. It also didn't look as nice. + =ui/doom-modeline= + Complete rewrite of the module for code readability and performance. + =ui/doom-dashboard= - + Fix a ~max-specpdl-size~ error caused on MacOS, having to do with a ~kill-buffer-query-function~ hook being attached way too soon in the startup process. + + Fix a ~max-specpdl-size~ error caused on MacOS, having to do with a + ~kill-buffer-query-function~ hook being attached way too soon in the + startup process. + =lang= + =lang/cc= + Fix empty ~buffer-file-name~ in ~magic-mode-alist~ rule for obj-c. @@ -524,10 +756,13 @@ + Add code navigation support with [[https://github.com/dominikh/go-mode.el/blob/master/go-guru.el][go-guru]] (built-in to go-mode). + Add REPL support with [[https://github.com/manute/gorepl-mode][gore and gorepl-mode]]. + =lang/haskell= - + New plugin: [[https://github.com/jyp/dante][dante]] -- offers xref and flycheck integration, as well as code-navigation tools, like finding definitions, references, type info, etc. + + New plugin: [[https://github.com/jyp/dante][dante]] -- offers xref and flycheck integration, as well as + code-navigation tools, like finding definitions, references, type info, + etc. + Fix errors on haskell-mode (caused by missing dependencies). + =lang/javascript= - + New plugin: [[https://github.com/skeeto/skewer-mode][skewer-mode]] -- provides live JS/CSS/HTML evaluation in a browser. + + New plugin: [[https://github.com/skeeto/skewer-mode][skewer-mode]] -- provides live JS/CSS/HTML evaluation in a + browser. + New plugin: [[https://github.com/yasuyk/web-beautify][web-beautify]] -- js reformatting. + New plugin: [[https://github.com/NicolasPetton/xref-js2][xref-js2]] -- xref integration for javascript. + New plugin: [[https://github.com/felipeochoa/rjsx-mode][rjsx-mode]] -- adds jsx support. @@ -538,26 +773,37 @@ + Force [[https://github.com/ternjs/tern][tern]] use projectile for project path detection and resolution. + Add gulpfile.js detection (~+javascript-gulp-mode~). + =lang/latex= - + Improve integration between auctex, evil and ~reftex-toc-mode~: j/k motion keys have been bound in reftex-toc-mode, the modeline is hidden, and ~reftex-toc-rescan~ is run automatically. + + Improve integration between auctex, evil and ~reftex-toc-mode~: j/k motion + keys have been bound in reftex-toc-mode, the modeline is hidden, and + ~reftex-toc-rescan~ is run automatically. + =lang/org= - + Add =+notes= submodule, which makes it easy to access org-mode based notes for the current major-mode or the current project. See ~+org/browse-notes-for-major-mode~ and ~+org/browse-notes-for-project~. - + Ensure newer org-mode 9.0+ (downloaded from ELPA) is loaded instead of the older, built-in version of org-mode (8.3). - + Update ~+org/dwim-at-point~, ~+org/insert-item~ & ~+org/toggle-checkbox~ for org-mode 9.0 + + Add =+notes= submodule, which makes it easy to access org-mode based notes + for the current major-mode or the current project. See + ~+org/browse-notes-for-major-mode~ and ~+org/browse-notes-for-project~. + + Ensure newer org-mode 9.0+ (downloaded from ELPA) is loaded instead of the + older, built-in version of org-mode (8.3). + + Update ~+org/dwim-at-point~, ~+org/insert-item~ & ~+org/toggle-checkbox~ + for org-mode 9.0 + Fix shackle popup integration with org-export dispatch window. + =lang/ruby= + Add ={Pod,Puppet,Berks}file= detection for ~ruby-mode~. + =lang/web= + New plugin: [[https://github.com/yasuyk/web-beautify][web-beautify]] -- html/css reformatting - + Remove ~+web-bower-mode~. I don't use it anymore; I prefer npm as my sole package manager. - + Improve ~+web-angularjs-mode~ detection by searching for angular 1 and 2 dependencies in package.json. - + Add ~+web-react-mode~ and detect it by searching for reactjs dependencies in package.json. + + Remove ~+web-bower-mode~. I don't use it anymore; I prefer npm as my sole + package manager. + + Improve ~+web-angularjs-mode~ detection by searching for angular 1 and 2 + dependencies in package.json. + + Add ~+web-react-mode~ and detect it by searching for reactjs dependencies + in package.json. + =app= + =app/rss= + Hide modeline in ~elfeed-search-mode~ buffer. + =app/present= - + New plugin: [[https://github.com/yjwen/org-reveal/][ox-reveal]] -- export a presentation to html, js & css from org-mode using [[http://lab.hakim.se/reveal-js/][reveal.js]]. + + New plugin: [[https://github.com/yjwen/org-reveal/][ox-reveal]] -- export a presentation to html, js & css from + org-mode using [[http://lab.hakim.se/reveal-js/][reveal.js]]. + New plugin: [[https://github.com/takaxp/org-tree-slide][org-tree-slides]] -- use ~org-mode~ directly for presentations. - + Add ~+present/big-mode~; which will toggle large fonts, controlled by ~+present-big-font~. + + Add ~+present/big-mode~; which will toggle large fonts, controlled by + ~+present-big-font~. + New plugin: [[https://github.com/skeeto/impatient-mode][impatient-mode]] -- show off current buffer(s) over HTTP. + =app/email= + Add support for writing emails in org-mode, which renders to HTML on send. @@ -568,22 +814,31 @@ * 2.0.0 (Jan 17, 2017) + *New modules* - + =tools/upload= -- map local files to remotes, allowing you to upload/download files between them. - + =feature/jump= -- offers a system for navigating codebases that "just works", powered by xref (new experimental Emacs reference API) & [[https://github.com/jacktasia/dumb-jump][dumb-jump]]. - + =feature/workspaces= -- offers grouped buffers/windows and persistent sessions. Recently replaced [[https://github.com/pashinin/workgroups2][workgroups2]] with the much-faster [[https://github.com/Bad-ptr/persp-mode.el][persp-mode]]. + + =tools/upload= -- map local files to remotes, allowing you to + upload/download files between them. + + =feature/jump= -- offers a system for navigating codebases that "just + works", powered by xref (new experimental Emacs reference API) & [[https://github.com/jacktasia/dumb-jump][dumb-jump]]. + + =feature/workspaces= -- offers grouped buffers/windows and persistent + sessions. Recently replaced [[https://github.com/pashinin/workgroups2][workgroups2]] with the much-faster [[https://github.com/Bad-ptr/persp-mode.el][persp-mode]]. + =core= + Add .travis.yml and unit-tests. + Remove mplist library -- it was unused and poorly written. + =core-popups= - + Replaced popwin with shackle; which is significantly lighter and more stable. + + Replaced popwin with shackle; which is significantly lighter and more + stable. + =feature/spellcheck= - + Add selection popup for correcting spelling mistakes highlighted by flyspell. + + Add selection popup for correcting spelling mistakes highlighted by + flyspell. + =completion/ivy= + Add ~+ivy:todo~ for jumping to TODO/FIXME tags in your project. + =lang/org= - + Make TAB do-what-I-mean (~+org/dwim-at-point~), which will either: follow a link, realign/recalculate tables, toggle checkboxes, toggle TODO/DONE tags, cycle archived subtrees, toggle latex preview fragments, execute babel blocks, or refresh inline images -- depending on where the cursor is. + + Make TAB do-what-I-mean (~+org/dwim-at-point~), which will either: follow a + link, realign/recalculate tables, toggle checkboxes, toggle TODO/DONE tags, + cycle archived subtrees, toggle latex preview fragments, execute babel + blocks, or refresh inline images -- depending on where the cursor is. + =lang/web= - + Add ~+css/toggle-inline-or-block~ command; it will expand/contract curly-braced blocks. + + Add ~+css/toggle-inline-or-block~ command; it will expand/contract + curly-braced blocks. + =private/hlissner= + Add ~:todo~ ex command (~+ivy:todo~) diff --git a/Makefile b/Makefile index 669ba1a05..a53dc66e3 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ # Ensure emacs always runs from this makefile's PWD EMACS_FLAGS=--eval '(setq user-emacs-directory default-directory)' -l core/core.el -EMACS=emacs --batch $(EMACS_FLAGS) +EMACS=emacs --quick --batch $(EMACS_FLAGS) EMACSI=emacs -q $(EMACS_FLAGS) MODULES=$(patsubst modules/%, %, $(shell find modules/ -maxdepth 2 -type d)) all: autoloads autoremove install -## Aliases +## Shortcuts a: autoloads i: install u: update @@ -18,16 +18,16 @@ ce: compile-elpa ## Package management install: init.el .local/autoloads.el - @$(EMACS) -f doom/packages-install + @$(EMACS) -f doom//packages-install update: init.el .local/autoloads.el - @$(EMACS) -f doom/packages-update + @$(EMACS) -f doom//packages-update autoremove: init.el .local/autoloads.el - @$(EMACS) -f doom/packages-autoremove + @$(EMACS) -f doom//packages-autoremove autoloads: init.el - @$(EMACS) -f doom/reload-autoloads + @$(EMACS) -f doom//reload-autoloads ## Byte compilation @@ -36,29 +36,22 @@ autoloads: init.el # compile-module # compile-module/submodule compile: init.el clean - @$(EMACS) -f doom/compile + @$(EMACS) -f doom//byte-compile compile-core: init.el clean - @$(EMACS) -f doom/compile -- init.el core + @$(EMACS) -f doom//byte-compile-core compile-elpa: init.el - @$(EMACS) -f doom/recompile-packages + @$(EMACS) -f doom//byte-recompile-plugins $(patsubst %, compile-%, $(MODULES)): init.el .local/autoloads.el - @rm -fv $(shell find $(patsubst compile-%, modules/%, $@) -type f -name '*.elc') - @$(EMACS) -f doom/compile -- $(patsubst compile-%, modules/%, $@) + @$(EMACS) -f doom//byte-compile -- $(patsubst compile-%, %, $@) recompile: init.el - @$(EMACS) -f doom/recompile + @$(EMACS) -f doom//byte-compile -- -r clean: - @$(EMACS) -f doom/clean-compiled-files - -clean-pcache: - @$(EMACS) -l persistent-soft --eval '(delete-directory pcache-directory t)' - -reset: - @$(EMACS) -f doom/reset + @$(EMACS) -f doom//clean-byte-compiled-files ## Unit tests @@ -67,14 +60,14 @@ reset: # test-module # test-module/submodule test: init.el .local/autoloads.el - @$(EMACS) -f doom-run-tests + @$(EMACS) -f doom//run-tests test-core $(patsubst %, test-%, $(MODULES)): init.el .local/autoloads.el - @$(EMACS) -f doom-run-tests -- $(subst test-, , $@) + @$(EMACS) -f doom//run-tests -- $(subst test-, , $@) # run tests interactively testi: init.el .local/autoloads.el - @$(EMACSI) -f doom-run-tests -f ert + @$(EMACSI) -f doom//run-tests -f ert ## Utility tasks @@ -84,7 +77,7 @@ run: # Diagnoses potential OS/environment issues doctor: - @./bin/doom-doctor + @bin/doom-doctor ## Internal tasks init.el: @@ -93,7 +86,4 @@ init.el: .local/autoloads.el: @$(EMACS) -f doom-initialize-autoloads -%.elc: %.el - @$(EMACS) -f doom/compile -- $< - -.PHONY: all compile test testi +.PHONY: all compile test testi clean diff --git a/README.md b/README.md index 9990e3699..55f0a4e1e 100644 --- a/README.md +++ b/README.md @@ -23,16 +23,13 @@ It is a story as old as time. A stubborn, shell-dwelling, and melodramatic vimmer -- envious of the features of modern text editors -- spirals into despair -before he finally succumbs to the [dark side][evil-mode]. This is his config. +before finally succumbing to the [dark side][evil-mode]. This is his config. -DOOM's philosophy is simple: be **fast**, be **readable**, and be **pretty**. It -is tailored for neckbeards with a blue-belt or better in command-line-fu who -don't shy away from dabbling with Elisp. +Doom strives to be fast, fabulous and hacker friendly. It is tailored for +neckbeards with blue belts or better in command-line-fu, Elisp and git. -Rip and tear. Until it compiles. - -> **Important:** Doom only supports Emacs >= 25.1, and is tailored for Arch -> Linux 4.7+ and Mac OS 10.11+. +> Doom **only** supports Emacs >= 25.1, and is tested on Arch Linux 4.7+ and +> MacOS 10.11. YMMV on other platforms. - - - @@ -45,6 +42,8 @@ cp init.example.el init.el # maybe edit init.el make install ``` +Don't forget to run `make` every time you modify init.el! + Visit the wiki for [a more detailed guide on installing, customizing and grokking Doom][wiki]. @@ -53,22 +52,24 @@ grokking Doom][wiki]. + A fast, organized and opinionated Emacs configuration with a command line interface. + A custom, declarative [package management system][doom-packages] that combines - package.el, [use-package] and [quelpa]. This lets you install packages from - sources other than ELPA, as well as manage packages from the command line. + package.el, [use-package] and [quelpa], allowing you to manage packages from + the command line and install packages from sources other than ELPA. + A [popup management system][doom-popups] (powered by [shackle]) that minimizes the presence and footprint of temporary and/or disposable buffers. + A vim-like experience with [evil-mode], including ports for several vim - plugins, C-x omnicompletion and a slew of [custom ex commands][doom-my-commands]. -+ Integration with [editorconfig]. Let someone else argue about tabs and spaces + plugins, C-x omnicompletion and a slew of [custom ex + commands][doom-my-commands]. ++ Integration with [editorconfig]. Let someone else argue about tabs and spaces. (spaces, duh). -+ Code completion for a variety of languages, powered by [company-mode] (there - may be other dependencies for certain languages). -+ Project-awareness powered by [projectile], with tools to navigate and manage - projects and project files. ++ Code completion for many languages, powered by [company-mode] (some languages + may have external dependencies). ++ Project-awareness powered by [projectile], with tools and an API to navigate + and manage projects and their files. + Fast project search (and replace) utilities, powered by [the_silver_searcher], - [ripgrep] and [wgrep], with [ivy] (the default), [helm] and ido integration. -+ Isolated and persistent workspaces powered by [persp-mode]. This can - substitute for vim tabs. + [ripgrep] and [wgrep], with integration for [ivy] (the default), [helm] and + ido. ++ Isolated and persistent workspaces powered by [persp-mode]. Also substitutes + for vim tabs. + Inline/live code evaluation (using [quickrun]), including REPLs for a variety of languages. @@ -76,34 +77,32 @@ grokking Doom][wiki]. Found a problem? Here are some things to try: -+ Make sure all plugins are installed with `make install`. -+ A `void-function` or `void-variable` might signal an out-of-date autoloads - file. Update it with `make autoloads`. -+ Diagnose common OS/environment issues that could interfere with Emacs with - `make doctor`. -+ If you byte-compiled Doom, run `make clean` or `M-x doom/clean-compiled-files` - and restart Emacs. Never debug byte-compiled code, it will interfere with your - efforts in subtle (and not-so-subtle) ways. ++ Run `make install` to ensure all plugins are installed. ++ `void-function` or `void-variable` errors could signal an out-of-date + autoloads file. Run `make autoloads` or `M-x doom//reload-autoloads` to update + it. ++ Scan for common OS/environment issues with `make doctor`. ++ **Never debug byte-compiled code. It will interfere in subtle ways.** Clean up + \*.elc files with `make clean` or `M-x doom//clean-byte-compiled-files`. + Check [the FAQ][wiki-troubleshooting] to see if your issue is mentioned. -+ If your issue is associated with a particular module, like code-completion, - check the module's README.org, if any. ++ Check the relevant module's README.org, if one exists. There may be extra + steps to getting certain features to work. -If all else fails, [file a bug report][doom-new-issue]. +If all else has failed, [file a bug report][doom-new-issue]. ## Contribute Doom (and my Emacs work in general) is a labor of love and incurable madness, -done on my free time. It wasn't intended for public use, but I enjoy making Doom -a resource for others. +done on my spare time. It wasn't intended for public use, but I enjoy making +Doom a resource for others. If you'd like to support my efforts, I welcome contributions of any kind: -+ I love pull requests and bug reports, and elisp pointers are especially - welcome. Seriously, don't hesitate to [tell me my Elisp-fu - sucks][doom-new-issue]! -+ I'm happy to discuss Emacs workflow, ideas or tooling. If you think I, Doom or - other Emacs users could benefit from them (or you just want to chat), drop me - a line at henrik@lissner.net. I'm eager to learn. ++ I love pull requests and bug reports. Elisp pointers are especially welcome. + Seriously, don't hesitate to [tell me my Elisp-fu sucks][doom-new-issue]! ++ Talk to me about Emacs workflow, ideas or tooling. Or talk to me about + gamedev, or pixel art, or anime, or programming, or the weather, or band camp. + Whatever. I don't mind. Holler at henrik@lissner.net. [wiki]: /../../wiki diff --git a/bin/doom-doctor b/bin/doom-doctor index d0892a974..a57693582 100755 --- a/bin/doom-doctor +++ b/bin/doom-doctor @@ -1,6 +1,6 @@ #!/usr/bin/env bash ":"; command -v emacs >/dev/null || { >&2 echo "Emacs isn't installed"; exit 1; } # -*-emacs-lisp-*- -":"; [[ $(emacs --version | head -n1) == *\ 2[0-2].[0-1].[0-9] ]] && { echo "You're running $(emacs --version | head -n1)"; echo "That version is too old to run the doctor. Check your PATH"; echo; exit 2; } || exec emacs --no-site-file --batch -l "$0" +":"; [[ $(emacs --version | head -n1) == *\ 2[0-2].[0-1].[0-9] ]] && { echo "You're running $(emacs --version | head -n1)"; echo "That version is too old to run the doctor. Check your PATH"; echo; exit 2; } || exec emacs --quick --script "$0" ;; Uses a couple simple heuristics to locate issues with your environment that ;; could interfere with running or setting up DOOM Emacs. @@ -145,17 +145,6 @@ (warn! "Warning: unable to detect font") (explain! "The `find-font' function is missing. This could indicate the incorrect " "version of Emacs is being used!")) - (defun -find-font (family) - (when (fontp family) - (setq family (symbol-name (font-get doom-font :family)))) - (let ((inhibit-message t)) - (shell-command (format "fc-list | grep %s" (shell-quote-argument family))))) - - (when (boundp 'doom-font) - (if (-find-font doom-font) - (success! "Found font %s" (font-get doom-font :family)) - (warn! "Warning: couldn't find %s font (default) (%s)" - (font-get doom-font :family)))) ;; all-the-icons fonts (let ((font-dest (pcase system-type ('gnu/linux (concat (or (getenv "XDG_DATA_HOME") @@ -294,7 +283,7 @@ (indented 4 (columns 3 23 (mapcar (lambda (x) (format "+%s" x)) - (mapcar #'cdr (doom--module-pairs))))))) + (mapcar #'cdr (doom-module-pairs))))))) (when (and (bound-and-true-p doom-packages) (require 'package nil t)) diff --git a/bin/org-tangle b/bin/org-tangle index c1ed45d67..fbe90fb23 100755 --- a/bin/org-tangle +++ b/bin/org-tangle @@ -1,5 +1,6 @@ -#!/bin/sh -":"; exec emacs --no-site-file --script "$0" -- "$@" # -*-emacs-lisp-*- +#!/usr/bin/env bash +":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*- +;;; bin/org-tangle ;; Extracts source blocks from org files and prints them to stdout. Debug/info ;; messages are directed to stderr and can be ignored. -l/--lang can be used to @@ -10,7 +11,7 @@ ;; org-tangle modules/ui/doom/README.org > install_fira_mono.sh ;; org-tangle -l sh modules/lang/go/README.org | sh -(load "~/.emacs.d/core/core.el" nil t) +(load (expand-file-name "../core/core.el" (file-name-directory load-file-name)) nil t) (require 'org-install) (require 'org) @@ -24,9 +25,20 @@ (apply orig-fn args))) (advice-add #'org-babel-tangle :around #'*org-babel-tangle) -(let ((lang (when (member (car command-line-args-left) '("--lang" "-l")) - (pop command-line-args-left) - (pop command-line-args-left))) - (srcs (cl-remove-if-not 'file-exists-p command-line-args-left))) +(let (lang srcs) + (pop argv) + (while argv + (let ((arg (pop argv))) + (pcase arg + ((or "--lang" "-l") + (setq lang (pop argv))) + ((guard (string-match-p "^--lang=" arg)) + (setq lang (cadr (split-string arg "=" t t)))) + ((guard (file-exists-p arg)) + (push arg srcs)) + (_ + (error "Unknown option or file: %s" arg))))) + (dolist (file srcs) - (org-babel-tangle-file file nil lang))) + (org-babel-tangle-file file nil lang)) + (kill-emacs 0)) diff --git a/core/autoload/help.el b/core/autoload/help.el index 739f7f25c..52ee799b6 100644 --- a/core/autoload/help.el +++ b/core/autoload/help.el @@ -25,7 +25,7 @@ submodule in the format, e.g. ':feature evil')." nil t))) (cl-destructuring-bind (category submodule) (mapcar #'intern (split-string module " ")) - (unless (member (cons category submodule) (doom--module-pairs)) + (unless (member (cons category submodule) (doom-module-pairs)) (error "'%s' isn't a valid module" module)) (let ((doc-path (expand-file-name "README.org" (doom-module-path category submodule)))) (unless (file-exists-p doc-path) diff --git a/core/autoload/packages.el b/core/autoload/packages.el index c6bc37c11..abd4d0696 100644 --- a/core/autoload/packages.el +++ b/core/autoload/packages.el @@ -9,7 +9,7 @@ (when force-p (doom-refresh-clear-cache)) (unless (or (persistent-soft-fetch 'last-pkg-refresh "emacs") - doom--refresh-p) + doom--refreshed-p) (condition-case-unless-debug ex (progn (message "Refreshing package archives") @@ -23,25 +23,22 @@ ;;;###autoload (defun doom-refresh-clear-cache () "Clear the cache for `doom-refresh-packages'." - (setq doom--refresh-p nil) + (setq doom--refreshed-p nil) (persistent-soft-store 'last-pkg-refresh nil "emacs")) ;;;###autoload -(defun doom-package-backend (name) - "Get which backend the package NAME was installed with. Can either be elpa, -quelpa or nil (if not installed)." +(defun doom-package-backend (name &optional noerror) + "Get which backend the package NAME was installed with. Can either be elpa or +quelpa. Throws an error if NOERROR is nil and the package isn't installed." (cl-assert (symbolp name) t) - (doom-initialize-packages) - (cond ((let ((plist (cdr (assq name doom-packages)))) - (and (not (plist-get plist :pin)) - (or (quelpa-setup-p) - (error "Could not initialize quelpa")) - (or (assq name quelpa-cache) - (plist-get plist :recipe)))) + (doom-initialize) + (cond ((and (or (quelpa-setup-p) + (error "Could not initialize quelpa")) + (assq name quelpa-cache)) 'quelpa) ((assq name package-alist) 'elpa) - (t + ((not noerror) (error "%s package not installed" name)))) ;;;###autoload @@ -79,6 +76,18 @@ list of the package." (doom-initialize-packages) (plist-get (cdr (assq name doom-packages)) prop)) +;;;###autoload +(defun doom-package-different-backend-p (name) + "Return t if NAME (a package's symbol) has a new backend than what it was +installed with. Returns nil otherwise, or if package isn't installed." + (cl-assert (symbolp name) t) + (doom-initialize-packages) + (and (package-installed-p name) + (let* ((plist (cdr (assq name doom-packages))) + (old-backend (doom-package-backend name t)) + (new-backend (if (plist-get plist :recipe) 'quelpa 'elpa))) + (not (eq old-backend new-backend))))) + ;;;###autoload (defun doom-get-packages (&optional installed-only-p) "Retrieves a list of explicitly installed packages (i.e. non-dependencies). @@ -129,38 +138,26 @@ Used by `doom/packages-update'." (let ((sym (car pkg))) (when (and (or (not (doom-package-prop sym :freeze)) include-frozen-p) - (not (doom-package-prop sym :ignore))) + (not (doom-package-prop sym :ignore)) + (not (doom-package-different-backend-p sym))) (push sym (if (eq (doom-package-backend sym) 'quelpa) quelpa-pkgs elpa-pkgs))))) - ;; The bottleneck in this process is quelpa's version checks, so partition - ;; and check them asynchronously. - (let* ((max-threads 3) ; TODO Do real CPU core/thread count - (min-per-part 2) - (per-part (max min-per-part (ceiling (/ (length quelpa-pkgs) (float max-threads))))) - (leftover (mod (length quelpa-pkgs) per-part)) - parts - futures) - (while quelpa-pkgs - (let (part) - (dotimes (_i (+ per-part leftover)) - (when-let (p (pop quelpa-pkgs)) - (push p part))) - (setq leftover 0) - (push (nreverse part) parts))) - (dolist (part (reverse parts)) - (debug! "New thread for: %s" part) + ;; The bottleneck in this process is quelpa's version checks, so check them + ;; asynchronously. + (let (futures) + (dolist (pkg quelpa-pkgs) + (debug! "New thread for: %s" pkg) (push (async-start `(lambda () (setq user-emacs-directory ,user-emacs-directory) (let ((noninteractive t)) (load ,(expand-file-name "core.el" doom-core-dir))) - (delq nil (mapcar #'doom-package-outdated-p ',part)))) + (doom-package-outdated-p ',pkg))) futures)) - (apply #'append - (delq nil (mapcar #'doom-package-outdated-p elpa-pkgs)) - (mapcar #'async-get futures))))) + (append (delq nil (mapcar #'doom-package-outdated-p elpa-pkgs)) + (delq nil (mapcar #'async-get (reverse futures))))))) ;;;###autoload (defun doom-get-orphaned-packages () @@ -171,7 +168,10 @@ Used by `doom/packages-autoremove'." (doom-initialize-packages t) (let ((package-selected-packages (append (mapcar #'car doom-packages) doom-core-packages))) - (package--removable-packages))) + (append (package--removable-packages) + (cl-loop for pkg in package-selected-packages + if (doom-package-different-backend-p pkg) + collect pkg)))) ;;;###autoload (defun doom-get-missing-packages (&optional include-ignored-p) @@ -184,14 +184,15 @@ If INCLUDE-IGNORED-P is non-nil, includes missing packages that are ignored, i.e. they have an :ignore property. Used by `doom/packages-install'." - (cl-loop for pkgsym in (doom-get-packages) - unless - (let ((pkg (car pkgsym))) - (or (assq pkg package-alist) - (unless include-ignored-p (doom-package-prop pkg :ignore)) - (and (not (plist-get (assq pkg doom-packages) :pin)) - (assq pkg package--builtins)))) - collect pkgsym)) + (cl-loop for desc in (doom-get-packages) + for (name . plist) = desc + if (and (or include-ignored-p + (not (plist-get plist :ignore))) + (or (plist-get plist :pin) + (not (assq name package--builtins))) + (or (not (assq name package-alist)) + (doom-package-different-backend-p name))) + collect desc)) ;;;###autoload (defun doom*package-delete (desc &rest _) @@ -251,6 +252,8 @@ Used by `doom/packages-install'." example; the package name can be omitted)." (doom-initialize-packages) (when (package-installed-p name) + (when (doom-package-different-backend-p name) + (doom-delete-package name t)) (user-error "%s is already installed" name)) (let ((plist (or plist (cdr (assq name doom-packages)))) (inhibit-message (not doom-debug-mode)) @@ -316,7 +319,7 @@ package.el as appropriate." ;; ;;;###autoload -(defun doom/packages-install () +(defun doom//packages-install () "Interactive command for installing missing packages." (interactive) (let ((packages (doom-get-missing-packages))) @@ -327,14 +330,20 @@ package.el as appropriate." (y-or-n-p (format "%s packages will be installed:\n\n%s\n\nProceed?" (length packages) - (mapconcat (lambda (pkg) - (format "+ %s (%s)" - (car pkg) - (if (plist-get (cdr pkg) :recipe) - "QUELPA" - "ELPA"))) - (sort (cl-copy-list packages) #'doom--sort-alpha) - "\n"))))) + (mapconcat + (lambda (pkg) + (format "+ %s (%s)" + (car pkg) + (cond ((doom-package-different-backend-p (car pkg)) + (if (plist-get (cdr pkg) :recipe) + "ELPA -> QUELPA" + "QUELPA -> ELPA")) + ((plist-get (cdr pkg) :recipe) + "QUELPA") + (t + "ELPA")))) + (sort (cl-copy-list packages) #'doom--sort-alpha) + "\n"))))) (message! (yellow "Aborted!"))) (t @@ -354,10 +363,10 @@ package.el as appropriate." ""))))) (message! (bold (green "Finished!"))) - (doom/reload-load-path)))) + (doom//reload-load-path)))) ;;;###autoload -(defun doom/packages-update () +(defun doom//packages-update () "Interactive command for updating packages." (interactive) (doom-refresh-packages doom-debug-mode) @@ -395,10 +404,10 @@ package.el as appropriate." (if result "DONE" "FAILED")))))) (message! (bold (green "Finished!"))) - (doom/reload-load-path))))) + (doom//reload-load-path))))) ;;;###autoload -(defun doom/packages-autoremove () +(defun doom//packages-autoremove () "Interactive command for auto-removing orphaned packages." (interactive) (let ((packages (doom-get-orphaned-packages))) @@ -409,12 +418,21 @@ package.el as appropriate." (y-or-n-p (format "%s packages will be deleted:\n\n%s\n\nProceed?" (length packages) - (mapconcat (lambda (sym) (format "+ %s (%s)" sym - (pcase (doom-package-backend sym) - ('quelpa "QUELPA") - ('elpa "ELPA")))) - (sort (cl-copy-list packages) #'string-lessp) - "\n"))))) + (mapconcat + (lambda (sym) + (format + "+ %s (%s)" + sym + (let ((backend (doom-package-backend sym))) + (if (doom-package-different-backend-p sym) + (if (eq backend 'quelpa) + "QUELPA->ELPA" + "ELPA->QUELPA") + (if (eq backend 'quelpa) + "QUELPA" + "ELPA"))))) + (sort (cl-copy-list packages) #'string-lessp) + "\n"))))) (message! (yellow "Aborted!"))) (t @@ -428,7 +446,8 @@ package.el as appropriate." pkg))))) (message! (bold (green "Finished!"))) - (doom/reload-load-path))))) + (doom//reload-load-path))))) + ;;;###autoload (defalias 'doom/install-package #'package-install) diff --git a/core/autoload/popups.el b/core/autoload/popups.el index 9cb8b26d7..12617d28b 100644 --- a/core/autoload/popups.el +++ b/core/autoload/popups.el @@ -238,7 +238,7 @@ without leaving any trace behind (muahaha)." (call-interactively (if (featurep 'evil) #'evil-force-normal-state - #'keyboard-escape-quit)) + #'keyboard-quit)) (delete-window))) ;;;###autoload diff --git a/core/autoload/test.el b/core/autoload/test.el index 2c1b948d1..c8c4035b5 100644 --- a/core/autoload/test.el +++ b/core/autoload/test.el @@ -1,14 +1,13 @@ -;;; core/autoload/test.el -*- lexical-binding: t; -*- +;;; core/autoload/test.el -*- lexical-binding: t; no-byte-compile: t; -*- ;;;###autoload -(defun doom-run-tests (&optional modules) +(defun doom//run-tests (&optional modules) "Run all loaded tests, specified by MODULES (a list of module cons cells) or command line args following a double dash (each arg should be in the 'module/submodule' format). If neither is available, run all tests in all enabled modules." - (interactive) ; must be interactive to be run from batch - ;; FIXME Refactor this + (interactive) (condition-case-unless-debug ex (let (targets) ;; ensure DOOM is initialized @@ -16,19 +15,18 @@ If neither is available, run all tests in all enabled modules." (load (expand-file-name "core/core.el" user-emacs-directory) nil t) (doom-initialize-modules nil)) ;; collect targets - (cond ((and command-line-args-left - (equal (car command-line-args-left) "--")) - (cl-loop for arg in (cdr argv) + (cond ((and argv (equal (car argv) "--")) + (cl-loop for arg in argv if (equal arg "core") - do (push (expand-file-name "test/" doom-core-dir) targets) + do (push (expand-file-name "test/" doom-core-dir) targets) else - collect - (cl-destructuring-bind (car &optional cdr) (split-string arg "/" t) - (cons (intern (concat ":" car)) - (and cdr (intern cdr)))) - into args - finally do (setq modules args - command-line-args-left nil))) + collect + (cl-destructuring-bind (car &optional cdr) (split-string arg "/" t) + (cons (intern (concat ":" car)) + (and cdr (intern cdr)))) + into args + finally do + (setq modules args argv nil))) (modules (unless (cl-loop for module in modules @@ -42,7 +40,7 @@ If neither is available, run all tests in all enabled modules." (let ((noninteractive t) doom-modules) (load (expand-file-name "init.test.el" user-emacs-directory) nil t) - (setq modules (doom--module-pairs) + (setq modules (doom-module-pairs) targets (list (expand-file-name "test/" doom-core-dir)))))) ;; resolve targets to a list of test files and load them (cl-loop with targets = @@ -58,8 +56,8 @@ If neither is available, run all tests in all enabled modules." collect (expand-file-name "test/" path)))) for dir in targets if (file-directory-p dir) - nconc (reverse (directory-files-recursively dir "\\.el$")) - into items + nconc (reverse (directory-files-recursively dir "\\.el$")) + into items finally do (quiet! (mapc #'load-file items))) ;; run all loaded tests (when noninteractive diff --git a/core/autoload/ui.el b/core/autoload/ui.el index 2336d5fbe..bec5426bb 100644 --- a/core/autoload/ui.el +++ b/core/autoload/ui.el @@ -68,17 +68,6 @@ window changes before then, the undo expires." (delete-frame)) (save-buffers-kill-emacs))) -;;;###autoload -(defun doom/reload-theme () - "Reset the color theme currently in use." - (interactive) - (let ((theme (or (car-safe custom-enabled-themes) doom-theme))) - (when theme - (mapc #'disable-theme custom-enabled-themes)) - (run-hooks 'doom-pre-reload-theme-hook) - (doom|init-ui) - (run-hooks 'doom-post-reload-theme-hook))) - ;;;###autoload (define-minor-mode doom-big-font-mode "A global mode that resizes the font, for streams, screen-sharing and @@ -91,3 +80,14 @@ presentations." (if doom-big-font-mode (set-frame-font doom-big-font t t) (set-frame-font doom-font t t))) + +;;;###autoload +(defun doom//reload-theme () + "Reset the color theme currently in use." + (interactive) + (let ((theme (or (car-safe custom-enabled-themes) doom-theme))) + (when theme + (mapc #'disable-theme custom-enabled-themes)) + (run-hooks 'doom-pre-reload-theme-hook) + (doom|init-ui) + (run-hooks 'doom-post-reload-theme-hook))) diff --git a/core/core-editor.el b/core/core-editor.el index e5a4af288..3e2fcbbcc 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -15,7 +15,7 @@ modes are active and the buffer is read-only.") ;; Save clipboard contents into kill-ring before replacing them save-interprogram-paste-before-kill t ;; Bookmarks - bookmark-default-file (concat doom-cache-dir "bookmarks") + bookmark-default-file (concat doom-etc-dir "bookmarks") bookmark-save-flag t ;; Formatting delete-trailing-lines nil @@ -61,17 +61,6 @@ modes are active and the buffer is read-only.") (ignore (bury-buffer)))) (add-hook 'kill-buffer-query-functions #'doom|dont-kill-scratch-buffer) -(defun doom*delete-trailing-whitespace (orig-fn &rest args) - "Don't affect trailing whitespace on current line." - (let ((linestr (buffer-substring-no-properties - (line-beginning-position) - (line-end-position)))) - (apply orig-fn args) - (when (and (if (featurep 'evil) (evil-insert-state-p) t) - (string-match-p "^[\s\t]*$" linestr)) - (insert linestr)))) -(advice-add #'delete-trailing-whitespace :around #'doom*delete-trailing-whitespace) - (defun doom|check-large-file () "Check if the buffer's file is large (see `doom-large-file-size'). If so, ask for confirmation to open it literally (read-only, disabled undo and in @@ -111,10 +100,8 @@ enable multiple minor modes for the same regexp.") (if (string-match-p (caar alist) name) (funcall (cdar alist) 1)) (setq alist (cdr alist)))))) - (add-hook 'find-file-hook #'doom|enable-minor-mode-maybe) -;; ensure indirect buffers have buffer-file-name (defun doom*set-indirect-buffer-filename (orig-fn base-buffer name &optional clone) "In indirect buffers, `buffer-file-name' is nil, which can cause problems with functions that require it (like modeline segments)." @@ -128,6 +115,19 @@ with functions that require it (like modeline segments)." buffer)) (advice-add #'make-indirect-buffer :around #'doom*set-indirect-buffer-filename) +(defun doom*delete-trailing-whitespace (orig-fn &rest args) + "Don't affect trailing whitespace on current line." + (let ((linestr (buffer-substring-no-properties + (line-beginning-position) + (line-end-position)))) + (apply orig-fn args) + (when (and (if (featurep 'evil) (evil-insert-state-p) t) + (string-match-p "^[\s\t]*$" linestr)) + (insert linestr)))) +(advice-add #'delete-trailing-whitespace :around #'doom*delete-trailing-whitespace) + +(push '("/LICENSE$" . text-mode) auto-mode-alist) + ;; ;; Built-in plugins @@ -152,7 +152,7 @@ with functions that require it (like modeline segments)." (def-package! recentf :init (add-hook 'doom-init-hook #'recentf-mode) :config - (setq recentf-save-file (concat doom-cache-dir "recentf") + (setq recentf-save-file (concat doom-etc-dir "recentf") recentf-max-menu-items 0 recentf-max-saved-items 300 recentf-exclude @@ -186,6 +186,32 @@ with functions that require it (like modeline segments)." :config (add-hook 'doom-init-hook #'editorconfig-mode) + ;; editorconfig cannot procure the correct settings for extension-less files. + ;; Executable scripts with a shebang line, for example. So why not use Emacs' + ;; major mode to drop editorconfig a hint? This is accomplished by temporarily + ;; appending an extension to `buffer-file-name' when we talk to editorconfig. + (defvar doom-editorconfig-mode-alist + '((sh-mode . "sh") + (python-mode . "py") + (ruby-mode . "rb") + (perl-mode . "pl") + (php-mode . "php")) + "An alist mapping major modes to extensions. Used by +`doom*editorconfig-smart-detection' to give editorconfig filetype hints.") + + (defun doom*editorconfig-smart-detection (orig-fn &rest args) + "Retrieve the properties for the current file. If it doesn't have an +extension, try to guess one." + (let ((buffer-file-name + (if (file-name-extension buffer-file-name) + buffer-file-name + (format "%s%s" buffer-file-name + (let ((ext (cdr (assq major-mode doom-editorconfig-mode-alist)))) + (or (and ext (concat "." ext)) + "")))))) + (apply orig-fn args))) + (advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection) + ;; Editorconfig makes indentation weird in Lisp modes, so we disable it. It ;; still applies other project settings (e.g. tabs vs spaces) though. (set! :editorconfig :remove 'emacs-lisp-mode) diff --git a/core/core-keybinds.el b/core/core-keybinds.el index f2d70468e..b2f31fe6f 100644 --- a/core/core-keybinds.el +++ b/core/core-keybinds.el @@ -17,7 +17,8 @@ (?e . emacs) (?o . operator) (?m . motion) - (?r . replace)) + (?r . replace) + (?g . global)) "A list of cons cells that map a letter to a evil state symbol.") @@ -109,10 +110,8 @@ For example, :nvi will map to (list 'normal 'visual 'insert). See `doom-evil-state-alist' to customize this." (cl-loop for l across (substring (symbol-name keyword) 1) - if (cdr (assq l doom-evil-state-alist)) - collect it - else - do (error "not a valid state: %s" l))) + if (cdr (assq l doom-evil-state-alist)) collect it + else do (error "not a valid state: %s" l))) ;; Register keywords for proper indentation (see `map!') @@ -258,7 +257,7 @@ Example (setq def (pop rest)) (when desc (push `(doom--keybind-register ,(key-description (eval key)) - ,desc ',modes) + ,desc ',modes) forms)) (cond ((and doom--local doom--keymaps) (push `(lwarn 'doom-map :warning @@ -267,16 +266,23 @@ Example forms) (throw 'skip 'local)) ((and doom--keymaps states) - (unless (featurep 'evil) (throw 'skip 'evil)) + (unless (featurep 'evil) + (throw 'skip 'evil)) (dolist (keymap doom--keymaps) - (push `(,(if doom--defer 'evil-define-key 'evil-define-key*) - ',states ,keymap ,key ,def) - forms))) + (when (memq 'global states) + (push `(define-key ,keymap ,key ,def) forms)) + (when-let (states (delq 'global states)) + (push `(,(if doom--defer 'evil-define-key 'evil-define-key*) + ',states ,keymap ,key ,def) + forms)))) (states - (unless (featurep 'evil) (throw 'skip 'evil)) + (unless (featurep 'evil) + (throw 'skip 'evil)) (dolist (state states) (push `(define-key - ,(intern (format "evil-%s-state-%smap" state (if doom--local "local-" ""))) + ,(if (eq state 'global) + '(current-global-map) + (intern (format "evil-%s-state-%smap" state (if doom--local "local-" "")))) ,key ,def) forms))) (doom--keymaps diff --git a/core/core-packages.el b/core/core-packages.el index 7ba141790..4633d99cd 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -68,7 +68,7 @@ package's name as a symbol, and whose CDR is the plist supplied to its `package!' declaration. Set by `doom-initialize-packages'.") (defvar doom-core-packages - '(persistent-soft quelpa use-package) + '(persistent-soft quelpa use-package async) "A list of packages that must be installed (and will be auto-installed if missing) and shouldn't be deleted.") @@ -90,7 +90,7 @@ missing) and shouldn't be deleted.") "A backup of `load-path' before it was altered by `doom-initialize'. Used as a base by `doom!' and for calculating how many packages exist.") -(defvar doom--refresh-p nil) +(defvar doom--refreshed-p nil) (setq load-prefer-newer (or noninteractive doom-debug-mode) package--init-file-ensured t @@ -147,7 +147,11 @@ startup." (dolist (dir (list doom-local-dir doom-etc-dir doom-cache-dir package-user-dir)) (unless (file-directory-p dir) (make-directory dir t))) - (package-initialize t) + (condition-case _ (package-initialize t) + ('error + (package-refresh-contents) + (setq doom--refreshed-p t) + (package-initialize t))) ;; We could let `package-initialize' fill `load-path', but it costs precious ;; milliseconds and does other stuff I don't need (like load autoload ;; files). My premature optimization quota isn't filled yet. @@ -159,9 +163,9 @@ startup." ;; Ensure core packages are installed (dolist (pkg doom-core-packages) (unless (package-installed-p pkg) - (unless doom--refresh-p + (unless doom--refreshed-p (package-refresh-contents) - (setq doom--refresh-p t)) + (setq doom--refreshed-p t)) (let ((inhibit-message t)) (package-install pkg)) (if (package-installed-p pkg) @@ -177,7 +181,7 @@ startup." "Ensures that `doom-autoload-file' exists and is loaded. Otherwise run `doom/reload-autoloads' to generate it." (unless (file-exists-p doom-autoload-file) - (quiet! (doom/reload-autoloads)))) + (quiet! (doom//reload-autoloads)))) (defun doom-initialize-packages (&optional force-p load-p) "Crawls across your emacs.d to fill `doom-modules' (from init.el) and @@ -187,33 +191,38 @@ If FORCE-P is non-nil, do it even if they are. This aggressively reloads core autoload files." (doom-initialize force-p) - (let ((noninteractive t) - (load-prefer-newer t) - (load-fn - (lambda (file &optional noerror) - (condition-case-unless-debug ex - (load file noerror :nomessage :nosuffix) - ('error - (error (format "(doom-initialize-packages) %s in %s: %s" - (car ex) - (file-relative-name file doom-emacs-dir) - (error-message-string ex)) - :error)))))) - (when (or force-p (not doom-modules)) - (setq doom-modules nil) - (funcall load-fn (expand-file-name "init.el" doom-emacs-dir)) - (when load-p + (with-temp-buffer ; prevent buffer-local settings from propagating + (let ((noninteractive t) + (load-prefer-newer t) + (load-fn + (lambda (file &optional noerror) + (condition-case-unless-debug ex + (load file noerror :nomessage :nosuffix) + ('error + (error (format "(doom-initialize-packages) %s in %s: %s" + (car ex) + (file-relative-name file doom-emacs-dir) + (error-message-string ex)) + :error)))))) + (when (or force-p (not doom-modules)) + (setq doom-modules nil) (let (noninteractive) - (funcall load-fn (doom-module-path :private user-login-name "init.el") t) - (funcall load-fn (expand-file-name "core.el" doom-core-dir))) - (mapc load-fn (file-expand-wildcards (expand-file-name "autoload/*.el" doom-core-dir)))) - (doom|finalize)) - (when (or force-p (not doom-packages)) - (setq doom-packages nil) - (funcall load-fn (expand-file-name "packages.el" doom-core-dir)) - (cl-loop for (module . submodule) in (doom--module-pairs) - for path = (doom-module-path module submodule "packages.el") - do (funcall load-fn path t))))) + (load (concat doom-core-dir "core.el") nil t)) + (funcall load-fn (expand-file-name "init.el" doom-emacs-dir)) + (when load-p + (let (noninteractive) + (funcall load-fn (doom-module-path :private user-login-name "init.el") t)) + (mapc load-fn (file-expand-wildcards (expand-file-name "autoload/*.el" doom-core-dir))) + (cl-loop for (module . submodule) in (doom-module-pairs) + for path = (doom-module-path module submodule "config.el") + do (funcall load-fn path t)))) + (when (or force-p (not doom-packages)) + (setq doom-packages nil) + (funcall load-fn (expand-file-name "packages.el" doom-core-dir)) + (cl-loop for (module . submodule) in (doom-module-pairs) + for path = (doom-module-path module submodule "packages.el") + do (funcall load-fn path t))))) + (doom|finalize)) (defun doom-initialize-modules (modules) "Adds MODULES to `doom-modules'. MODULES must be in mplist format. @@ -246,6 +255,14 @@ This aggressively reloads core autoload files." (cons (intern (concat ":" (match-string 1 path))) (intern (match-string 2 path))))) +(defun doom-module-paths (&optional append-file) + "Returns a list of absolute file paths to activated modules, with APPEND-FILE +added, if the file exists." + (cl-loop for (module . submodule) in (doom-module-pairs) + for path = (doom-module-path module submodule append-file) + if (file-exists-p path) + collect path)) + (defun doom-module-flags (module submodule) "Returns a list of flags provided for MODULE SUBMODULE." (and (hash-table-p doom-modules) @@ -265,7 +282,7 @@ Used by `require!' and `depends-on!'." (doom-enlist (or flags t)) doom-modules)) -(defun doom--module-pairs () +(defun doom-module-pairs () "Returns `doom-modules' as a list of (MODULE . SUBMODULE) cons cells. The list is sorted by order of insertion unless ALL-P is non-nil. If ALL-P is non-nil, include all modules, enabled or otherwise." @@ -274,15 +291,7 @@ include all modules, enabled or otherwise." (cl-loop for key being the hash-keys of doom-modules collect key)) -(defun doom--module-paths (&optional append-file) - "Returns a list of absolute file paths to activated modules, with APPEND-FILE -added, if the file exists." - (cl-loop for (module . submodule) in (doom--module-pairs) - for path = (doom-module-path module submodule append-file) - if (file-exists-p path) - collect path)) - -(defun doom--display-benchmark () +(defun doom-packages--display-benchmark () (message "Doom loaded %s packages across %d modules in %.03fs" ;; Certainly imprecise, especially where custom additions to ;; load-path are concerned, but I don't mind a [small] margin of @@ -311,7 +320,7 @@ MODULES is an malformed plist of modules to load." (unless noninteractive (load ,(doom-module-path :private user-login-name "init") t t) - ,@(cl-loop for (module . submodule) in (doom--module-pairs) + ,@(cl-loop for (module . submodule) in (doom-module-pairs) collect `(require! ,module ,submodule nil t)) (when (display-graphic-p) @@ -319,7 +328,7 @@ MODULES is an malformed plist of modules to load." (unless (server-running-p) (server-start))) - (add-hook 'doom-init-hook #'doom--display-benchmark t) + (add-hook 'doom-init-hook #'doom-packages--display-benchmark t) (message "Doom modules initialized")))) (defmacro def-package! (name &rest plist) @@ -482,7 +491,24 @@ loads MODULE SUBMODULE's packages.el file." ;; Commands ;; -(defun doom/reload-load-path () +(defun doom-packages--read-if-cookies (file) + "Returns the value of the ;;;###if predicate form in FILE." + (with-temp-buffer + (insert-file-contents-literally file nil 0 256) + (if (re-search-forward "^;;;###if " nil t) + (eval (sexp-at-point)) + t))) + +(defun doom-packages--async-run (fn) + (let ((compilation-filter-hook + (list (lambda () (ansi-color-apply-on-region compilation-filter-start (point)))))) + (compile (format "%s --quick --batch -l core/core.el -f %s" + (executable-find "emacs") + (symbol-name fn))) + (while compilation-in-progress + (sit-for 1)))) + +(defun doom//reload-load-path () "Reload `load-path' and recompile files (if necessary). Use this when `load-path' is out of sync with your plugins. This should only @@ -492,20 +518,19 @@ an Emacs session is running. This isn't necessary if you use Doom's package management commands because they call `doom/reload-load-path' remotely (through emacsclient)." (interactive) + (byte-recompile-file (expand-file-name "core.el" doom-core-dir) t) (cond (noninteractive (message "Reloading...") (require 'server) - (unless (ignore-errors (server-eval-at "server" '(doom/reload-load-path))) - (message "Recompiling") - (doom/recompile))) + (when (file-exists-p (if server-use-tcp server-auth-dir server-socket-dir)) + (server-eval-at "server" '(doom//reload-load-path)))) (t (doom-initialize t) - (doom/recompile) (message "Reloaded %d packages" (length doom--package-load-path)) (run-with-timer 1 nil #'redraw-display) (run-hooks 'doom-reload-hook)))) -(defun doom/reload-autoloads () +(defun doom//reload-autoloads () "Refreshes the autoloads.el file, specified by `doom-autoload-file'. It scans and reads core/autoload/*.el, modules/*/*/autoload.el and @@ -518,156 +543,164 @@ This should be run whenever init.el or an autoload file is modified. Running (interactive) ;; This function must not use autoloaded functions or external dependencies. ;; It must assume nothing is set up! - (doom-initialize-packages (not noninteractive)) - (let ((evil-p (doom-module-loaded-p :feature 'evil)) - (targets - (file-expand-wildcards - (expand-file-name "autoload/*.el" doom-core-dir)))) - (dolist (path (doom--module-paths)) - (let ((auto-dir (expand-file-name "autoload" path)) - (auto-file (expand-file-name "autoload.el" path))) - (when (file-exists-p auto-file) - (push auto-file targets)) - (when (file-directory-p auto-dir) - (dolist (file (file-expand-wildcards (expand-file-name "*.el" auto-dir) t)) - ;; Make evil*.el autoload files a special case; don't load - ;; them unless evil is enabled. - (unless (and (string-prefix-p "evil" (file-name-nondirectory file)) - (not evil-p)) - (push file targets)))))) - (when (file-exists-p doom-autoload-file) - (delete-file doom-autoload-file) - (message "Deleted old autoloads.el")) - (dolist (file (reverse targets)) - (message (if (update-file-autoloads file nil doom-autoload-file) - "Nothing in %s" - "Scanned %s") - (file-relative-name file doom-emacs-dir))) - (let ((buf (get-file-buffer doom-autoload-file)) - current-sexp) - (unwind-protect - (condition-case-unless-debug ex - (with-current-buffer buf - (save-buffer) - (goto-char (point-min)) - (while (re-search-forward "^(" nil t) - (save-excursion - (backward-char) - (setq current-sexp (read (thing-at-point 'sexp t))) - (eval current-sexp t)) - (forward-char)) - (message "Finished generating autoloads.el!")) - ('error - (delete-file doom-autoload-file) - (error "Error in autoloads.el: (%s %s ...) %s -- %s" - (nth 0 current-sexp) - (nth 1 current-sexp) - (car ex) (error-message-string ex)))) - (kill-buffer buf))))) + (if (not noninteractive) + ;; This is done "asynchroniously" to protect the current session's state. + ;; This is because `doom-initialize-packages' rereads your emacs config, + ;; which has side effects. + (and (doom-packages--async-run 'doom//reload-autoloads) + (load doom-autoload-file)) + (doom-initialize-packages) + (let ((targets + (file-expand-wildcards + (expand-file-name "autoload/*.el" doom-core-dir)))) + (dolist (path (doom-module-paths)) + (let ((auto-dir (expand-file-name "autoload" path)) + (auto-file (expand-file-name "autoload.el" path))) + (when (and (file-exists-p auto-file) + (doom-packages--read-if-cookies auto-file)) + (push auto-file targets)) + (when (file-directory-p auto-dir) + (dolist (file (file-expand-wildcards (expand-file-name "*.el" auto-dir) t)) + ;; Make evil*.el autoload files a special case; don't load + ;; them unless evil is enabled. + (when (doom-packages--read-if-cookies file) + (push file targets)))))) + (when (file-exists-p doom-autoload-file) + (delete-file doom-autoload-file) + (message "Deleted old autoloads.el")) + (dolist (file (reverse targets)) + (message (if (update-file-autoloads file nil doom-autoload-file) + "Nothing in %s" + "Scanned %s") + (file-relative-name file doom-emacs-dir))) + (let ((buf (get-file-buffer doom-autoload-file)) + current-sexp) + (unwind-protect + (condition-case-unless-debug ex + (with-current-buffer buf + (save-buffer) + (goto-char (point-min)) + (while (re-search-forward "^(" nil t) + (save-excursion + (backward-char) + (setq current-sexp (read (thing-at-point 'sexp t))) + (eval current-sexp t)) + (forward-char)) + (message "Finished generating autoloads.el!")) + ('error + (delete-file doom-autoload-file) + (error "Error in autoloads.el: (%s %s ...) %s -- %s" + (nth 0 current-sexp) + (nth 1 current-sexp) + (car ex) (error-message-string ex)))) + (kill-buffer buf)))))) -(defun doom/compile (&optional lite-p only-recompile-p) +(defun doom//byte-compile (&optional modules recompile-p) "Byte compiles your emacs configuration. -Specifically, this byte-compiles init.el, core/*.el, core/autoload/*.el & -modules/*/*/**.el. It ignores unit tests and files with `no-byte-compile' -enabled. +init.el is always byte-compiled by this. -DOOM Emacs was designed to benefit from byte-compilation, but the process may -take a while. Also, while your config files are byte-compiled, changes to them -will not take effect! Use `doom/clean-compiled' or `make clean' to undo -byte-compilation. +If MODULES is specified (a list of module strings, e.g. \"lang/php\"), those are +byte-compiled. Otherwise, all enabled modules are byte-compiled, including Doom +core. It always ignores unit tests and files with `no-byte-compile' enabled. -If LITE-P is non-nil, only compile the core DOOM files (init.el & core/**/*.el). +Doom was designed to benefit from byte-compilation, but the process may take a +while. Also, while your config files are byte-compiled, changes to them will not +take effect! Use `doom//clean-byte-compiled-files' or `make clean' to remove +these files. -If ONLY-RECOMPILE-P is non-nil, only recompile out-of-date files." +If RECOMPILE-P is non-nil, only recompile out-of-date files." + (interactive + (list nil current-prefix-arg)) + (let ((default-directory doom-emacs-dir) + (recompile-p (or recompile-p + (and (member "-r" (cdr argv)) t)))) + (if (not noninteractive) + ;; This is done "asynchroniously" to protect the current session's + ;; state. This is because `doom-initialize-packages' rereads your emacs + ;; config, which has side effects. + (doom-packages--async-run 'doom//byte-compile) + (let ((total-ok 0) + (total-fail 0) + (total-noop 0) + (modules (or modules (cdr argv))) + compile-targets) + (doom-initialize-packages t t) + (setq compile-targets + (cl-loop for target + in (or modules (append (list doom-core-dir) (doom-module-paths))) + if (equal target "core") + nconc (nreverse (directory-files-recursively doom-core-dir "\\.el$")) + else if (file-directory-p target) + nconc (nreverse (directory-files-recursively target "\\.el$")) + else if (file-directory-p (expand-file-name target doom-modules-dir)) + nconc (nreverse (directory-files-recursively (expand-file-name target doom-modules-dir) "\\.el$")) + else if (file-exists-p target) + collect target + finally do (setq argv nil))) + (unless compile-targets + (error "No targets to compile")) + (let ((use-package-expand-minimally t)) + (push (expand-file-name "init.el" doom-emacs-dir) compile-targets) + (dolist (target compile-targets) + (when (or (not recompile-p) + (let ((elc-file (byte-compile-dest-file target))) + (and (file-exists-p elc-file) + (file-newer-than-file-p file elc-file)))) + (let ((result (if (and (string-match-p "/autoload/.*\\.el$" target) + (not (doom-packages--read-if-cookies target))) + 'no-byte-compile + (byte-compile-file target))) + (short-name (file-relative-name target doom-emacs-dir))) + (cl-incf + (cond ((eq result 'no-byte-compile) + (message! (dark (white "Ignored %s" short-name))) + total-noop) + ((null result) + (message! (red "Failed to compile %s" short-name)) + total-fail) + (t + (message! (green "Compiled %s" short-name)) + (quiet! (load target t t)) + total-ok)))))) + (message! + (bold + (color (if (= total-fail 0) 'green 'red) + "%s %s file(s) %s" + (if recompile-p "Recompiled" "Compiled") + (format "%d/%d" total-ok (- (length compile-targets) total-noop)) + (format "(%s ignored)" total-noop))))))))) + +(defun doom//byte-compile-core (&optional recompile-p) + "Byte compile the core Doom files. + +This is faster than `doom//byte-compile', still yields considerable performance +benefits, and is more reliable in an ever-changing Emacs config (since you won't +likely change core files directly). + +If RECOMPILE-P is non-nil, only recompile out-of-date core files." (interactive "P") - ;; Ensure all relevant config files are loaded and up-to-date. This way we - ;; don't need eval-when-compile and require blocks scattered all over. - (doom-initialize-packages t noninteractive) - (let ((targets - (cond ((equal (car command-line-args-left) "--") - (cl-loop for file in (cdr command-line-args-left) - if (file-exists-p file) - collect (expand-file-name file) - finally do (setq command-line-args-left nil)) ) - (t - (append (list (expand-file-name "init.el" doom-emacs-dir) - doom-core-dir) - (unless lite-p (doom--module-paths)))))) - (total-success 0) - (total-fail 0) - (total-nocomp 0) - (use-package-expand-minimally t)) - (let ((el-files (cl-loop for path in targets - if (file-directory-p path) - nconc (nreverse (directory-files-recursively path "\\.el$")) - else if (file-exists-p path) - collect path))) - (dolist (file el-files) - (when (or (not only-recompile-p) - (let ((elc-file (byte-compile-dest-file file))) - (and (file-exists-p elc-file) - (file-newer-than-file-p file elc-file)))) - (let ((result (if (string-match-p "/test/.+\\.el$" file) - 'no-byte-compile - (byte-compile-file file))) - (short-name (file-relative-name file doom-emacs-dir))) - (cl-incf - (cond ((eq result 'no-byte-compile) - (message! (dark (white "Ignored %s" short-name))) - total-nocomp) - ((null result) - (message! (red "Failed to compile %s" short-name)) - total-fail) - (t - (message! (green "Compiled %s" short-name)) - (quiet! (load file t t)) - total-success)))))) - (message! - (bold - (color (if (= total-fail 0) 'green 'red) - "%s %s file(s) %s" - (if only-recompile-p "Recompiled" "Compiled") - (format (if el-files "%d/%d" "%d") - total-success - (- (length el-files) total-nocomp)) - (format "(%s ignored)" total-nocomp))))))) + (doom//byte-compile (list "core") recompile-p)) -(defun doom/recompile () - "Recompile any out-of-date compiled *.el files in your Emacs configuration." - (interactive) - (doom/compile nil :recompile) - ;; Forcibly recompile core.el in case `load-path' has changed - (byte-recompile-file (expand-file-name "core.el" doom-core-dir) t)) - -(defun doom/recompile-packages () - "Recompile all installed elpa packages. If you're getting odd errors after -upgrading Emacs, this may fix it." +(defun doom//byte-recompile-plugins () + "Recompile all installed plugins. If you're getting odd errors after upgrading +(or downgrading) Emacs, this may fix it." (interactive) (byte-recompile-directory package-user-dir 0 t)) -(defun doom/reset () - "Clear the local cache completely (in `doom-cache-dir'). +(defun doom//clean-byte-compiled-files () + "Delete all the compiled elc files in your Emacs configuration. -This resets Emacs to a blank slate. You must restart Emacs for some components -to feel its effects." - (interactive) - (delete-directory doom-cache-dir t) - (make-directory doom-cache-dir t)) - -(defun doom/clean-compiled-files () - "Delete all compiled elc files in your Emacs configuration. - -This excludes compiled packages in `doom-packages-dir'." +This excludes compiled packages in `doom-packages-dir'.'" (interactive) (let ((targets (append (list (expand-file-name "init.elc" doom-emacs-dir)) (directory-files-recursively doom-core-dir "\\.elc$") (directory-files-recursively doom-modules-dir "\\.elc$")))) (unless (cl-loop for path in targets if (file-exists-p path) - collect path - and do (delete-file path) - and do (message "Deleted %s" (file-relative-name path))) + collect path + and do (delete-file path) + and do (message "Deleted %s" (file-relative-name path))) (message "Everything is clean")))) diff --git a/core/core-popups.el b/core/core-popups.el index 5d54b88c6..f19d33ae5 100644 --- a/core/core-popups.el +++ b/core/core-popups.el @@ -97,6 +97,7 @@ recognized by DOOM's popup system. They are: ("^\\*doom:" :regexp t :size 0.35 :noesc t :select t) ("^ ?\\*doom " :regexp t :noselect t :autokill t :autoclose t :autofit t) ;; built-in (emacs) + ("*compilation*" :size 0.25 :noselect t :autokill t :autoclose t) ("*ert*" :same t :modeline t) ("*info*" :size 0.5 :select t :autokill t) ("*Backtrace*" :size 20 :noselect t) @@ -110,7 +111,7 @@ recognized by DOOM's popup system. They are: (grep-mode :size 25 :noselect t :autokill t) (profiler-report-mode :size 0.3 :regexp t :autokill t :modeline minimal) (tabulated-list-mode :noesc t) - ("^ ?\\*" :regexp t :size 0.3 :noselect t :autokill t :autoclose t :autofit t))) + ("^ ?\\*" :regexp t :size 15 :noselect t :autokill t :autoclose t))) :config (add-hook 'doom-post-init-hook #'shackle-mode) @@ -137,7 +138,6 @@ recognized by DOOM's popup system. They are: (define-key map [escape] #'doom/popup-close-maybe) (define-key map (kbd "ESC") #'doom/popup-close-maybe) (define-key map [remap quit-window] #'doom/popup-close-maybe) - (define-key map [remap delete-window] #'doom/popup-close-maybe) (define-key map [remap doom/kill-this-buffer] #'delete-window) (define-key map [remap split-window-right] #'ignore) (define-key map [remap split-window-below] #'ignore) diff --git a/core/core-projects.el b/core/core-projects.el index bee087f9f..f9eee1431 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -6,8 +6,7 @@ state are passed in.") (def-package! projectile :demand t - :init (add-hook 'doom-init-hook #'projectile-mode) - :config + :init (setq projectile-cache-file (concat doom-cache-dir "projectile.cache") projectile-enable-caching (not noninteractive) projectile-indexing-method 'alien @@ -16,10 +15,12 @@ state are passed in.") projectile-globally-ignored-files '(".DS_Store" "Icon " "TAGS") projectile-globally-ignored-file-suffixes '(".elc" ".pyc" ".o")) + (add-hook 'doom-init-hook #'projectile-mode) + :config ;; a more generic project root file (push ".project" projectile-project-root-files-bottom-up) - (nconc projectile-globally-ignored-directories (list doom-local-dir ".sync")) + (nconc projectile-globally-ignored-directories (list (abbreviate-file-name doom-local-dir) ".sync")) (nconc projectile-other-file-alist '(("css" . ("scss" "sass" "less" "style")) ("scss" . ("css")) ("sass" . ("css")) @@ -47,7 +48,7 @@ state are passed in.") ;; Library ;; -(defun doom/reload-project () +(defun doom//reload-project () "Reload the project root cache." (interactive) (projectile-invalidate-cache nil) diff --git a/core/core-ui.el b/core/core-ui.el index 9913c9db0..7d965686e 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -29,7 +29,7 @@ shorter major mode name in the mode-line. See `doom|set-mode-name'.") ;; Hook(s) (defvar doom-init-ui-hook nil "List of hooks to run when the theme and font is initialized (or reloaded with -`doom/reload-theme').") +`doom//reload-theme').") ;; Settings diff --git a/core/core.el b/core/core.el index 9dfbe3533..06b1cad4c 100644 --- a/core/core.el +++ b/core/core.el @@ -5,6 +5,7 @@ ;; doom-... public variables or non-interactive functions ;; doom--... private anything (non-interactive), not safe for direct use ;; doom/... an interactive function; safe for M-x or keybinding +;; doom//... an interactive function for managing/maintaining Doom itself ;; doom:... an evil operator, motion or command ;; doom|... hook function ;; doom*... advising functions @@ -17,7 +18,7 @@ ;; Autoloaded functions are in core/autoload/*.el and modules/*/*/autoload.el or ;; modules/*/*/autoload/*.el. -(defvar doom-version "2.0.6" +(defvar doom-version "2.0.7" "Current version of DOOM emacs.") (defvar doom-debug-mode (or (getenv "DEBUG") init-file-debug) @@ -105,6 +106,7 @@ melodramatic ex-vimmer disappointed with the text-editor status quo." auto-save-list-file-name (concat doom-cache-dir "autosave") backup-directory-alist (list (cons "." (concat doom-cache-dir "backup/"))) pcache-directory (concat doom-cache-dir "pcache/") + mc/list-file (concat doom-etc-dir "mc-lists.el") server-auth-dir (concat doom-cache-dir "server/") shared-game-score-directory (concat doom-etc-dir "shared-game-score/") tramp-auto-save-directory (concat doom-cache-dir "tramp-auto-save/") @@ -160,7 +162,8 @@ ability to invoke the debugger in debug mode." ;; reset it to a reasonable default. (setq gc-cons-threshold 16777216 gc-cons-percentage 0.1 - file-name-handler-alist doom--file-name-handler-alist)) + file-name-handler-alist doom--file-name-handler-alist) + t) ;;; diff --git a/core/packages.el b/core/packages.el index 5adea83c4..3a5004ed5 100644 --- a/core/packages.el +++ b/core/packages.el @@ -2,7 +2,6 @@ ;;; core/packages.el ;; core packages -(package! async) (package! s) (package! f) diff --git a/modules/app/email/autoload/evil.el b/modules/app/email/autoload/evil.el index ccc281a17..d7b64c9c6 100644 --- a/modules/app/email/autoload/evil.el +++ b/modules/app/email/autoload/evil.el @@ -1,4 +1,5 @@ -;;; app/email/autoload/evil.el -*- lexical-binding: t; -*- +;; app/email/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (defun +email/mark (&optional beg end) diff --git a/modules/app/irc/autoload/evil.el b/modules/app/irc/autoload/evil.el deleted file mode 100644 index 8eb627682..000000000 --- a/modules/app/irc/autoload/evil.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; app/irc/autoload/evil.el -*- lexical-binding: t; -*- - diff --git a/modules/completion/company/test/company.el b/modules/completion/company/test/company.el index de61d779f..d8969d398 100644 --- a/modules/completion/company/test/company.el +++ b/modules/completion/company/test/company.el @@ -1,4 +1,5 @@ -;;; completion/company/test/company.el -*- lexical-binding: t; -*- +;; -*- lexical-binding: t; no-byte-compile: t; -*- +;;; completion/company/test/company.el (require! :completion company) (require 'company) diff --git a/modules/completion/helm/autoload/evil.el b/modules/completion/helm/autoload/evil.el index eceb08f0f..d1f1b5f59 100644 --- a/modules/completion/helm/autoload/evil.el +++ b/modules/completion/helm/autoload/evil.el @@ -1,4 +1,5 @@ ;;; completion/helm/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+helm:swoop "completion/helm/autoload/evil" nil t) (evil-define-command +helm:swoop (&optional search bang) diff --git a/modules/completion/helm/autoload/helm.el b/modules/completion/helm/autoload/helm.el deleted file mode 100644 index 0e739c12b..000000000 --- a/modules/completion/helm/autoload/helm.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; completion/helm/autoload/helm.el -*- lexical-binding: t; -*- - diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index db13f2595..ba315c5d5 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -63,7 +63,7 @@ (map! :map global-map [remap apropos] #'helm-apropos [remap find-file] #'helm-find-files - [remap recentf] #'helm-recentf + [remap recentf-open-files] #'helm-recentf [remap projectile-switch-to-buffer] #'helm-projectile-switch-to-buffer [remap projectile-recentf] #'helm-projectile-recentf [remap projectile-find-file] #'helm-projectile-find-file diff --git a/modules/completion/ivy/autoload/evil.el b/modules/completion/ivy/autoload/evil.el index f8789be6a..5abf326a3 100644 --- a/modules/completion/ivy/autoload/evil.el +++ b/modules/completion/ivy/autoload/evil.el @@ -1,4 +1,5 @@ -;;; completion/ivy/autoload/evil.el -*- lexical-binding: t; -*- +;; completion/ivy/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+ivy:swiper "completion/ivy/autoload/evil" nil t) (evil-define-command +ivy:swiper (&optional search) @@ -24,6 +25,9 @@ (directory (or directory project-root)) (recursion-p +ivy--file-search-recursion-p) (all-files-p +ivy--file-search-all-files-p) + (engine (or engine + (and (executable-find "rg") 'rg) + (and (executable-find "ag") 'ag))) (query (or query (if (evil-visual-state-p) diff --git a/modules/feature/debugger/autoload/evil.el b/modules/feature/debugger/autoload/evil.el index c1b9c0a5b..7ae3027ef 100644 --- a/modules/feature/debugger/autoload/evil.el +++ b/modules/feature/debugger/autoload/evil.el @@ -1,4 +1,5 @@ -;;; feature/debugger/autoload/evil.el -*- lexical-binding: t; -*- +;; feature/debugger/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+debugger:start "feature/debugger/autoload/evil" nil t) (evil-define-command +debugger:start (&optional path) diff --git a/modules/feature/eval/autoload/evil.el b/modules/feature/eval/autoload/evil.el index 00b87245c..e36320976 100644 --- a/modules/feature/eval/autoload/evil.el +++ b/modules/feature/eval/autoload/evil.el @@ -1,4 +1,5 @@ -;;; feature/eval/autoload/evil.el -*- lexical-binding: t; -*- +;; feature/eval/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+eval:region "feature/eval/autoload/evil" nil t) (evil-define-operator +eval:region (beg end) diff --git a/modules/feature/evil/autoload/evil.el b/modules/feature/evil/autoload/evil.el index c471de661..7e1d6d773 100644 --- a/modules/feature/evil/autoload/evil.el +++ b/modules/feature/evil/autoload/evil.el @@ -1,4 +1,5 @@ -;;; feature/evil/autoload/evil.el -*- lexical-binding: t; -*- +;; feature/evil/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (defun +evil/visual-indent () diff --git a/modules/feature/file-templates/config.el b/modules/feature/file-templates/config.el index 8c55c349c..b8d6fcf10 100644 --- a/modules/feature/file-templates/config.el +++ b/modules/feature/file-templates/config.el @@ -11,13 +11,12 @@ :init (setq auto-insert-query nil ; Don't prompt before insertion auto-insert-alist nil) ; Tabula rasa + (after! yasnippet + (push '+file-templates-dir yas-snippet-dirs)) :config (auto-insert-mode 1) - (after! yasnippet - (push '+file-templates-dir yas-snippet-dirs)) - (defun +file-templates--expand (key &optional mode project-only) "Auto insert a snippet of yasnippet into new file." (when (if project-only (doom-project-p) t) @@ -32,10 +31,13 @@ (evil-initialize-state 'insert)))) (defun +file-templates-add (args) - (cl-destructuring-bind (regexp trigger mode &optional project-only-p) args + (cl-destructuring-bind (regexp trigger &optional mode project-only-p) args (define-auto-insert regexp - (vector `(lambda () (+file-templates--expand ,trigger ',mode ,project-only-p)))))) + (if trigger + (vector + `(lambda () (+file-templates--expand ,trigger ',mode ,project-only-p))) + #'ignore)))) (mapc #'+file-templates-add ;; General @@ -52,6 +54,7 @@ ("/Makefile$" "__" makefile-gmake-mode) ;; Elisp ("\\.el$" "__initfile" emacs-lisp-mode) + ("/.dir-locals.el$" nil) ("-test\\.el$" "__" emacs-ert-mode) ("/.emacs.d/.+\\.el$" "__doom-module" emacs-lisp-mode) ("/.emacs.d/.+/packages\\.el$" "__doom-packages" emacs-lisp-mode) diff --git a/modules/feature/jump/autoload/evil.el b/modules/feature/jump/autoload/evil.el index 7f74c5205..51142c206 100644 --- a/modules/feature/jump/autoload/evil.el +++ b/modules/feature/jump/autoload/evil.el @@ -1,4 +1,5 @@ ;;; feature/jump/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+jump:online "feature/jump/autoload/evil" nil t) (evil-define-command +jump:online (query &optional bang) diff --git a/modules/feature/jump/autoload/jump.el b/modules/feature/jump/autoload/jump.el index 60f9395c0..3c83ee32c 100644 --- a/modules/feature/jump/autoload/jump.el +++ b/modules/feature/jump/autoload/jump.el @@ -33,14 +33,18 @@ Tries xref and falls back to `dumb-jump', then rg/ag, then (xref-find-definitions identifier)) t)) - ((and (fboundp 'dumb-jump-go) + ((and (require 'dumb-jump nil t) ;; dumb-jump doesn't tell us if it succeeded or not - (let (successful) - (cl-letf (((symbol-function 'dumb-jump-result-follow) - `(lambda (result &optional use-tooltip proj) - (setq successful t) - (,(symbol-function 'dumb-jump-result-follow) - result use-tooltip proj)))) + (let ((old-fn-sym (make-symbol "old-fn")) + successful) + (cl-letf ((old-fn-sym (symbol-function 'dumb-jump-get-results)) + ((symbol-function 'dumb-jump-get-results) + (lambda (&optional prompt) + (let* ((plist (funcall old-fn-sym prompt)) + (results (plist-get plist :results))) + (when (and results (> (length results) 0)) + (setq successful t)) + plist)))) (if other-window (dumb-jump-go-other-window) (dumb-jump-go)) @@ -56,7 +60,7 @@ Tries xref and falls back to `dumb-jump', then rg/ag, then ((and (featurep 'evil) evil-mode - (cl-destructuring-bind (beg end) + (cl-destructuring-bind (beg . end) (bounds-of-thing-at-point 'symbol) (evil-goto-definition) (let ((pt (point))) diff --git a/modules/feature/snippets/autoload/evil.el b/modules/feature/snippets/autoload/evil.el index cac086280..c8d5cfc7f 100644 --- a/modules/feature/snippets/autoload/evil.el +++ b/modules/feature/snippets/autoload/evil.el @@ -1,4 +1,5 @@ ;;; feature/snippets/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (defun +snippets/expand-on-region () diff --git a/modules/feature/snippets/config.el b/modules/feature/snippets/config.el index 322ab221e..a00450d79 100644 --- a/modules/feature/snippets/config.el +++ b/modules/feature/snippets/config.el @@ -11,6 +11,8 @@ (defvar yas-minor-mode-map (make-sparse-keymap)) :init + (setq yas-snippet-dirs '(yas-installed-snippets-dir)) + ;; Ensure `yas-reload-all' is called as late as possible. Other modules could ;; have additional configuration for yasnippet. For example, file-templates. (add-transient-hook! 'yas-minor-mode-hook (yas-reload-all)) @@ -23,7 +25,6 @@ yas-indent-line 'auto yas-also-auto-indent-first-line t yas-prompt-functions '(yas-completing-prompt yas-ido-prompt yas-no-prompt) - yas-snippet-dirs '(yas-installed-snippets-dir) yas-use-menu nil ;; Allow nested snippets yas-triggers-in-field t) diff --git a/modules/feature/workspaces/autoload/evil.el b/modules/feature/workspaces/autoload/evil.el index a4aee5e15..16f75c4e6 100644 --- a/modules/feature/workspaces/autoload/evil.el +++ b/modules/feature/workspaces/autoload/evil.el @@ -1,4 +1,5 @@ ;;; feature/workspaces/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+workspace:save-session "feature/workspaces/autoload/evil" nil t) (evil-define-command +workspace:save-session (&optional bang name) diff --git a/modules/feature/workspaces/autoload/workspaces.el b/modules/feature/workspaces/autoload/workspaces.el index ffd7d46ba..11cff9413 100644 --- a/modules/feature/workspaces/autoload/workspaces.el +++ b/modules/feature/workspaces/autoload/workspaces.el @@ -442,7 +442,7 @@ the workspace and move to the next." (cl-loop for name in names for i to (length names) collect - (propertize (format " [%d] %s " i name) + (propertize (format " [%d] %s " (1+ i) name) 'face (if (equal current-name name) '+workspace-tab-selected-face '+workspace-tab-face))) diff --git a/modules/feature/workspaces/config.el b/modules/feature/workspaces/config.el index aacc47ca7..759b7406b 100644 --- a/modules/feature/workspaces/config.el +++ b/modules/feature/workspaces/config.el @@ -28,7 +28,7 @@ renamed.") persp-nil-name "nil" persp-nil-hidden t persp-auto-save-fname "autosave" - persp-save-dir (concat doom-cache-dir "workspaces/") + persp-save-dir (concat doom-etc-dir "workspaces/") persp-set-last-persp-for-new-frames nil persp-switch-to-added-buffer nil persp-remove-buffers-from-nil-persp-behaviour nil diff --git a/modules/lang/elixir/autoload/elixir.el b/modules/lang/elixir/autoload/elixir.el deleted file mode 100644 index 0f8221801..000000000 --- a/modules/lang/elixir/autoload/elixir.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; lang/elixir/autoload/elixir.el -*- lexical-binding: t; -*- - diff --git a/modules/lang/go/README.org b/modules/lang/go/README.org index c5a230d72..3447c530e 100644 --- a/modules/lang/go/README.org +++ b/modules/lang/go/README.org @@ -15,7 +15,7 @@ This module adds [[https://golang.org][Go]] support. #+begin_quote I have mixed feelings about Go. It's a decent compromise between C and higher-level languages, is pleasantly straight-forward and elegant, but lacks /native/ support for luxuries I miss from other languages, like generics, optional arguments, and function overloading. You've got to learn to love ~interface{}~. -Still, Go has been a remarkably useful (and fast!) companion for a variety of small-to-medium backend web and CLI projects. +Still, Go is a remarkably useful (and fast!) companion for a variety of small-to-medium backend web and CLI projects. #+end_quote * Table of Contents :TOC: diff --git a/modules/lang/haskell/README.org b/modules/lang/haskell/README.org index 7961af579..f29b189e2 100644 --- a/modules/lang/haskell/README.org +++ b/modules/lang/haskell/README.org @@ -1,6 +1,6 @@ #+TITLE: :lang haskell -This module adds [[https://www.haskell.org/][Haskell]] support. +This module adds [[https://www.haskell.org/][Haskell]] support, powered by either [[https://haskell-lang.org/intero][intero]] (the default) or [[https://github.com/jyp/dante][dante]]. + Code completion (~company-ghc~) + Look up documentation (~hoogle~) @@ -11,29 +11,40 @@ This module adds [[https://www.haskell.org/][Haskell]] support. + [[https://github.com/hlissner/emacs-snippets/tree/master/haskell-mode][Snippets]] #+begin_quote -Haskell contends with C and Ruby as my favorite language. I don't think my Haskell code will ever save the world, but I'll reach for it for small projects and programming exercises (like projecteuler.com or exercism.io). +Haskell contends with C and Ruby as my favorite language. My Haskell code will never save the world, but I'll reach for it for small projects and programming exercises (like projecteuler.com or exercism.io). -I'd love to incorporate more of it into my machine learning work, but Python and Julia hold that crown. For now. +I'd love to incorporate it into my machine learning work, but Python and Julia hold that crown. For now. #+end_quote * Table of Contents :TOC: - [[#install][Install]] - - [[#haskell][Haskell]] - - [[#dependencies][Dependencies]] + - [[#intero][Intero]] + - [[#dante][Dante]] - [[#troubleshooting][Troubleshooting]] - [[#resources][Resources]] * Install -** Haskell -To get started with Haskell, you need *stack* installed. +This module has two submodules: *Intero* or *Dante*. To activate one, specify one or the other in your pubilc ~init.el~, e.g.: -*** MacOS +#+BEGIN_SRC emacs-lisp +(doom! :lang (haskell +intero)) +;; or +(doom! :lang (haskell +dante)) +#+END_SRC + +Your dependencies will change slightly, depending on which you choose: + +** Intero +*** Haskell +To get started you must install *stack*: + +**** MacOS #+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes") brew install haskell-stack stack setup #+END_SRC -*** Arch Linux +**** Arch Linux #+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes") sudo pacman --needed --noconfirm -S stack # Replace pacaur with your AUR package manager of choice @@ -41,8 +52,8 @@ pacaur --needed --noconfirm -S ncurses5-compat-lib stack setup #+END_SRC -** Dependencies -This module requires ~ghc-mod~ (as well as ~intero~, but those will be automatically installed). +*** External dependencies +This module requires ~ghc-mod~. #+BEGIN_SRC sh stack install ghc-mod @@ -55,9 +66,41 @@ Also ensure that ~\~/.local/bin~ is in ~PATH~: export PATH="~/.local/bin:$PATH" #+END_SRC +** Dante +*** Haskell +To get started with Dante and Haskell, you must install cabal + ++ cabal (the haskell package builder) ++ ghc/ghci (the compiler, syntax checker & repl) + +**** MacOS +#+BEGIN_SRC sh +brew install cabal-install ghc +#+END_SRC + +**** Arch Linux +#+BEGIN_SRC sh +sudo pacman --needed --noconfirm -S cabal-install ghc +#+END_SRC + +*** External dependencies +Dante requires ~ghc-mod~ and ~hoogle~: + +#+BEGIN_SRC sh +cabal update +cabal install happy haskell-src-exts # ghc-mod/hoogle dependencies +cabal ghc-mod hoogle +#+END_SRC + +And add Cabal's bin path to $PATH: + +#+BEGIN_SRC sh +export PATH="$HOME/.cabal/bin:$PATH" +#+END_SRC + * Troubleshooting -+ Stack users: if a ~dist/setup-config~ file exists in your project, [[ https://github.com/DanielG/ghc-mod/wiki#known-issues-related-to-stack][ghc-mod may - refuse to work]]. ++ Stack users: a ~dist/setup-config~ in your project may cause [[ https://github.com/DanielG/ghc-mod/wiki#known-issues-related-to-stack][ghc-mod to not + work]]. * Resources Here are a few resources I've found indespensible in my Haskell adventures: @@ -65,3 +108,4 @@ Here are a few resources I've found indespensible in my Haskell adventures: + [[http://learnyouahaskell.com/][Learn you a haskell for great good]] + [[http://haskellbook.com/][Haskell Programming from first principles]] + [[https://github.com/krispo/awesome-haskell][Awesome Haskell]]: an extensive list of haskell resources ++ [[https://docs.haskellstack.org/en/stable/README/][The Haskell Tool Stack docs]] diff --git a/modules/lang/java/+eclim.el b/modules/lang/java/+eclim.el index 7e8059480..3e9c97dc9 100644 --- a/modules/lang/java/+eclim.el +++ b/modules/lang/java/+eclim.el @@ -46,9 +46,9 @@ (map! :map java-mode-map :localleader - :nv "r" #'+java/refactor-menu - :nv "c" #'+java/compile-menu - :nv "p" #'+java/project-menu)) + "r" #'+java/refactor-menu + "c" #'+java/compile-menu + "p" #'+java/project-menu)) (def-package! company-emacs-eclim diff --git a/modules/lang/java/+meghanada.el b/modules/lang/java/+meghanada.el index 8107c1847..1c78e7ba5 100644 --- a/modules/lang/java/+meghanada.el +++ b/modules/lang/java/+meghanada.el @@ -2,6 +2,8 @@ (def-package! meghanada :commands meghanada-mode + :init + (add-hook! 'java-mode-hook #'(meghanada-mode rainbow-delimiters-mode)) :config (setq meghanada-server-install-dir (concat doom-etc-dir "meghanada-server/") meghanada-use-company (featurep! :completion company) @@ -9,12 +11,10 @@ meghanada-use-eldoc t meghanada-use-auto-start t) - (add-hook 'java-mode-hook #'(rainbow-delimiters-mode eldoc-mode)) - ;; Setup on first use (meghanada-install-server) (if (file-exists-p (meghanada--locate-server-jar)) - (add-hook! 'java-mode-hook #'(meghanada-mode flycheck-mode)) + (add-hook! 'meghanada-mode-hook #'(flycheck-mode eldoc-mode)) (warn "java-mode: meghanada-server not installed, java-mode will run with reduced functionality")) (set! :jump 'java-mode diff --git a/modules/lang/php/config.el b/modules/lang/php/config.el index fe0cfe1f2..5bfe186af 100644 --- a/modules/lang/php/config.el +++ b/modules/lang/php/config.el @@ -86,7 +86,7 @@ (unless (executable-find "phpctags") (warn "php-mode: phpctags isn't installed, auto-completion will be gimped")) - (setq ac-php-tags-path (concat doom-cache-dir "ac-php/"))) + (setq ac-php-tags-path (concat doom-etc-dir "ac-php/"))) ;; diff --git a/modules/lang/rust/README.org b/modules/lang/rust/README.org new file mode 100644 index 000000000..7469620c3 --- /dev/null +++ b/modules/lang/rust/README.org @@ -0,0 +1,51 @@ +#+TITLE: :lang rust + +#+begin_quote +This module is a work in progress. +#+end_quote + +This module adds [[https://www.rust-lang.org][Rust]] support to Emacs. + ++ Code completion (~racer~) ++ Syntax checking (~flycheck~) ++ Eldoc support (~go-eldoc~) ++ [[https://github.com/hlissner/emacs-snippets/tree/master/rust-mode][Snippets]] + +#+begin_quote +... +#+end_quote + +* Table of Contents :TOC: +- [[#install][Install]] + - [[#rust][Rust]] + - [[#dependencies][Dependencies]] + +* Install +** Rust +To get started with Rust, you can either use =rustup= and install rust with: + +~curl https://sh.rustup.rs -sSf | sh~ + +Or through your package manager (which is my preference): + +*** MacOS +#+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes") +brew install rust +cargo install racer +#+END_SRC + +*** Arch Linux +#+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes") +sudo pacman --needed --noconfirm -S rust rust-racer +#+END_SRC + +** Dependencies +This module requires ~racer~ for code completion, which also requires access to Rust's source code. + +#+BEGIN_SRC sh +cargo install racer +git clone https://github.com/rust-lang/rust $RUST_SRC_PATH +#+END_SRC + +Either set ~$RUST_SRC_PATH~ in your shell (so that it's available in Emacs), or adjust ~+rust-src-dir~ to point at the correct directory. + diff --git a/modules/lang/rust/config.el b/modules/lang/rust/config.el index 22e5b8bf9..7afabf06e 100644 --- a/modules/lang/rust/config.el +++ b/modules/lang/rust/config.el @@ -24,13 +24,15 @@ :init (add-hook! 'rust-mode-hook #'(racer-mode eldoc-mode flycheck-rust-setup)) :config - (setq racer-cmd (expand-file-name "racer/target/release/racer" +rust-src-dir) - racer-rust-src-path (expand-file-name "rust/src/" +rust-src-dir)) - - (set! :jump 'rust-mode :definition #'racer-find-definition) + (setq racer-cmd (or (executable-find "racer") + (expand-file-name "racer/target/release/racer" +rust-src-dir)) + racer-rust-src-path (or (getenv "RUST_SRC_PATH") + (expand-file-name "rust/src/" +rust-src-dir))) (unless (file-exists-p racer-cmd) - (warn "rust-mode: racer binary can't be found; auto-completion is disabled"))) + (warn "rust-mode: racer binary can't be found; auto-completion is disabled")) + + (set! :jump 'rust-mode :definition #'racer-find-definition)) (def-package! company-racer diff --git a/modules/lang/sh/autoload.el b/modules/lang/sh/autoload.el index e1baafc77..ad78ecc4b 100644 --- a/modules/lang/sh/autoload.el +++ b/modules/lang/sh/autoload.el @@ -8,7 +8,7 @@ (while (and (setq res (re-search-forward - "\\(\\$\\)\\({.+?}\\|\\<.+?\\>\\)" + "[^\\]\\(\\$\\)\\({.+?}\\|\\<[a-zA-Z0-9_]+\\|[@*#!]\\)" limit t)) (not (eq (nth 3 (syntax-ppss)) ?\")))) res))) @@ -20,7 +20,7 @@ (let (res) (while (and (setq res - (re-search-forward "\\(\\$(.+?)\\|`.+?`\\)" + (re-search-forward "[^\\]\\(\\$(.+?)\\|`.+?`\\)" limit t)) (not (eq (nth 3 (syntax-ppss)) ?\")))) res))) diff --git a/modules/lang/sh/config.el b/modules/lang/sh/config.el index f5c93a8bc..6a78ed628 100644 --- a/modules/lang/sh/config.el +++ b/modules/lang/sh/config.el @@ -2,10 +2,9 @@ (defvar +sh-builtin-keywords '("cat" "cat" "cd" "chmod" "chown" "cp" "curl" "date" "echo" "find" "git" - "grep" "head" "kill" "less" "ls" "make" "mkdir" "mv" "pgrep" "pkill" "pwd" - "rm" "sleep" "sudo" "tail" "tee" "touch") - "A list of common shell commands and keywords to be fontified especially in -`sh-mode'.") + "grep" "kill" "less" "ls" "make" "mkdir" "mv" "pgrep" "pkill" "pwd" + "rm" "sleep" "sudo" "touch") + "A list of common shell commands to be fontified especially in `sh-mode'.") ;; @@ -24,17 +23,22 @@ (setq sh-indent-after-continuation 'always) + ;; recognize function names with dashes in them + (push '((sh . ((nil "^\\s-*function\\s-+\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*\\(?:()\\)?" 1) + (nil "^\\s-*\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*()" 1)))) + sh-imenu-generic-expression) + ;; 1. Fontifies variables in double quotes ;; 2. Fontify command substitution in double quotes ;; 3. Fontify built-in/common commands (see `+sh-builtin-keywords') (font-lock-add-keywords 'sh-mode `((+sh--match-variables-in-quotes - (1 'default prepend) + (1 'font-lock-constant-face prepend) (2 'font-lock-variable-name-face prepend)) (+sh--match-command-subst-in-quotes - (0 'sh-quoted-exec prepend)) + (1 'sh-quoted-exec prepend)) (,(regexp-opt +sh-builtin-keywords 'words) - (0 'font-lock-builtin-face append)))) + (0 'font-lock-type-face append)))) ;; autoclose backticks (sp-local-pair 'sh-mode "`" nil :unless '(sp-point-before-word-p sp-point-before-same-p)) diff --git a/modules/lang/web/autoload/evil.el b/modules/lang/web/autoload/evil.el index c719018eb..8886f1ae0 100644 --- a/modules/lang/web/autoload/evil.el +++ b/modules/lang/web/autoload/evil.el @@ -1,4 +1,5 @@ ;;; lang/html/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+web:encode-html-entities "lang/web/autoload/evil" nil t) (evil-define-operator +web:encode-html-entities (beg end &optional input) diff --git a/modules/lang/web/autoload/html.el b/modules/lang/web/autoload/html.el index b9945da9f..4afdb1cb6 100644 --- a/modules/lang/web/autoload/html.el +++ b/modules/lang/web/autoload/html.el @@ -1,7 +1,7 @@ ;;; lang/web/autoload/html.el -*- lexical-binding: t; -*- (defvar +web-entities-list - [[" " " "] [" " " "] [" " " "] [" " " "] + [["&" "&"] [" " " "] [" " " "] [" " " "] [" " " "] ["‏" "‏"] ["‎" "‎"] ["‍" "‍"] ["‌" "‌"] ["¡" "¡"] ["¢" "¢"] ["£" "£"] ["¤" "¤"] ["¥" "¥"] ["¦" "¦"] ["§" "§"] ["¨" "¨"] ["©" "©"] ["ª" "ª"] diff --git a/modules/lang/web/autoload/web.el b/modules/lang/web/autoload/web.el deleted file mode 100644 index ce61a69d6..000000000 --- a/modules/lang/web/autoload/web.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; lang/web/autoload/web.el -*- lexical-binding: t; -*- - diff --git a/modules/org/org-attach/autoload/evil.el b/modules/org/org-attach/autoload/evil.el index 7570f465b..b32920298 100644 --- a/modules/org/org-attach/autoload/evil.el +++ b/modules/org/org-attach/autoload/evil.el @@ -1,4 +1,5 @@ -;;; org/org-attach/autoload/evil.el -*- lexical-binding: t; -*- +;; org/org-attach/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;; TODO +org-attach:find diff --git a/modules/org/org-babel/config.el b/modules/org/org-babel/config.el index e3c1332f5..fd1d39c87 100644 --- a/modules/org/org-babel/config.el +++ b/modules/org/org-babel/config.el @@ -2,6 +2,28 @@ (add-hook 'org-load-hook #'+org-babel|init t) +(defvar +org-babel-languages + '(calc + css + emacs-lisp + haskell + js + latex + ledger + lilypond + lisp + matlab + plantuml + python + restclient ; ob-restclient + ruby + rust ; ob-rust + shell + sqlite + sql-mode ; ob-sql-mode + translate) ; ob-translate + "A list of org-babel languages to load.") + (defun +org-babel|init () (setq org-src-fontify-natively t ; make code pretty org-src-preserve-indentation t ; use native major-mode indentation @@ -11,27 +33,11 @@ (org-babel-do-load-languages 'org-babel-load-languages - (mapcar (lambda (sym) (cons sym t)) - '(calc - css - emacs-lisp - haskell - js - latex - ledger - lilypond - lisp - matlab - plantuml - python - restclient ; ob-restclient - ruby - rust ; ob-rust - shell - sqlite - sql-mode ; ob-sql-mode - translate ; ob-translate - ))) + (cl-loop for sym in +org-babel-languages + collect (cons sym t))) + + ;; I prefer C-c C-c for confirming over the default C-c ' + (map! :map org-src-mode-map "C-c C-c" #'org-edit-src-exit) ;; In a recent update, `org-babel-get-header' was removed from org-mode, which ;; is something a fair number of babel plugins use. So until those plugins @@ -42,11 +48,7 @@ if (funcall fn (eq (car p) key)) collect p)) - ;; I prefer C-c C-c for confirming over the default C-c ' - (map! :map org-src-mode-map "C-c C-c" #'org-edit-src-exit) - (defun +org|src-mode-remove-header () "Remove header-line with keybinding help; I know the keybinds." - (when header-line-format - (setq header-line-format nil))) + (setq header-line-format nil)) (add-hook 'org-src-mode-hook #'+org|src-mode-remove-header)) diff --git a/modules/org/org-capture/autoload/evil.el b/modules/org/org-capture/autoload/evil.el index 7becec046..b6efbb629 100644 --- a/modules/org/org-capture/autoload/evil.el +++ b/modules/org/org-capture/autoload/evil.el @@ -1,4 +1,5 @@ ;;; org/org-capture/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+org-capture:open "org/org-capture/autoload/evil" nil t) (evil-define-operator +org-capture:open (&optional beg end) diff --git a/modules/org/org/autoload/org-link.el b/modules/org/org/autoload/org-link.el new file mode 100644 index 000000000..8d55ef8d0 --- /dev/null +++ b/modules/org/org/autoload/org-link.el @@ -0,0 +1,15 @@ +;;; org/org/autoload/org-link.el -*- lexical-binding: t; -*- + +;;;###autoload +(defun +org-link-read-file (key dir) + (let ((file (read-file-name (format "%s: " (capitalize key)) dir))) + (format "%s:%s" + key + (file-relative-name file dir)))) + +;;;###autoload +(defun +org-link-read-directory (key dir) + (let ((file (read-directory-name (format "%s: " (capitalize key)) dir))) + (format "%s:%s" + key + (file-relative-name file dir)))) diff --git a/modules/org/org/autoload/org.el b/modules/org/org/autoload/org.el index 9c293b075..da252317a 100644 --- a/modules/org/org/autoload/org.el +++ b/modules/org/org/autoload/org.el @@ -71,7 +71,8 @@ If on a: (goto-char (org-element-property :post-affiliated context)) (call-interactively #'org-footnote-action)) - ((or `planning `timestamp) (org-follow-timestamp-link)) + ((or `planning `timestamp) + (org-follow-timestamp-link)) ((or `table `table-row) (if (org-at-TBLFM-p) @@ -199,15 +200,12 @@ wrong places)." ((memq type '(table table-row)) (pcase direction ('below (org-table-insert-row t)) - ('above (+org/table-prepend-row-or-shift-up)))) + ('above (org-shiftmetadown)))) ((memq type '(headline inlinetask)) - (let* ((subcontext (org-element-context)) - (level (save-excursion - (org-back-to-heading) - (if (eq (org-element-type subcontext) 'headline) - (org-element-property :level subcontext) - 1)))) + (let ((level (if (eq (org-element-type context) 'headline) + (org-element-property :level context) + 1))) (pcase direction ('below (let ((at-eol (= (point) (1- (line-end-position))))) @@ -272,7 +270,7 @@ with `org-cycle'). Also: (interactive) (save-excursion (org-beginning-of-line) - (cond ((org-table-p) + (cond ((org-at-table-p) (org-table-align)) ((org-in-src-block-p) (org-babel-remove-result)) diff --git a/modules/org/org/autoload/tables.el b/modules/org/org/autoload/tables.el index 6f9e42748..7248f4625 100644 --- a/modules/org/org/autoload/tables.el +++ b/modules/org/org/autoload/tables.el @@ -51,16 +51,3 @@ re-align the table if necessary. (Necessary because org-mode has a (interactive) (if (org-at-table-p) (org-shiftmetaright) (org-shiftmetaleft))) -;;;###autoload -(defun +org/table-append-row-or-shift-down () - (interactive) - (org-shiftmetadown) - (when (org-at-table-p) (org-metadown))) - -;;;###autoload -(defun +org/table-prepend-row-or-shift-up () - (interactive) - (if (org-at-table-p) - (org-shiftmetadown) - (org-shiftmetaup))) - diff --git a/modules/org/org/config.el b/modules/org/org/config.el index 69afdc5dd..46ae32b43 100644 --- a/modules/org/org/config.el +++ b/modules/org/org/config.el @@ -122,9 +122,10 @@ org-startup-indented t org-startup-with-inline-images nil org-tags-column 0 - org-todo-keywords '((sequence "[ ](t)" "[-](p)" "[?](m)" "|" "[X](d)") - (sequence "TODO(T)" "|" "DONE(D)") - (sequence "IDEA(i)" "NEXT(n)" "ACTIVE(a)" "WAITING(w)" "LATER(l)" "|" "CANCELLED(c)")) + org-todo-keywords + '((sequence "[ ](t)" "[-](p)" "[?](m)" "|" "[X](d)") + (sequence "TODO(T)" "|" "DONE(D)") + (sequence "NEXT(n)" "ACTIVE(a)" "WAITING(w)" "LATER(l)" "|" "CANCELLED(c)")) org-use-sub-superscripts '{} outline-blank-line t @@ -138,11 +139,15 @@ 'default) :background nil t))) - ;; Use ivy/helm if either is available - (when (or (featurep! :completion ivy) - (featurep! :completion helm)) - (setq-default org-completion-use-ido nil - org-outline-path-complete-in-steps nil))) + ;; Custom links + (org-link-set-parameters + "org" + :complete (lambda () (+org-link-read-file "org" +org-dir)) + :follow (lambda (link) (find-file (expand-file-name link +org-dir))) + :face (lambda (link) + (if (file-exists-p (expand-file-name link +org-dir)) + 'org-link + 'error)))) (defun +org-init-keybinds () "Sets up org-mode and evil keybindings. Tries to fix the idiosyncrasies @@ -164,8 +169,8 @@ between the two." ;; Expand tables (or shiftmeta move) :ni "C-S-l" #'+org/table-append-field-or-shift-right :ni "C-S-h" #'+org/table-prepend-field-or-shift-left - :ni "C-S-k" #'+org/table-prepend-row-or-shift-up - :ni "C-S-j" #'+org/table-append-row-or-shift-down + :ni "C-S-k" #'org-metaup + :ni "C-S-j" #'org-metadown :n [tab] #'+org/toggle-fold :i [tab] #'+org/indent-or-next-field-or-yas-expand diff --git a/modules/private/hlissner/+bindings.el b/modules/private/hlissner/+bindings.el index b0cae52e2..378ea57ab 100644 --- a/modules/private/hlissner/+bindings.el +++ b/modules/private/hlissner/+bindings.el @@ -20,64 +20,61 @@ (map! ;; --- Global keybindings --------------------------- ;; Make M-x available everywhere - :nvime "M-x" #'execute-extended-command - :nvime "A-x" #'execute-extended-command + :gnvime "M-x" #'execute-extended-command + :gnvime "A-x" #'execute-extended-command ;; Emacs debug utilities - "M-;" #'eval-expression - :nvime "M-;" #'eval-expression - "M-:" #'doom/open-scratch-buffer - :nvime "M-:" #'doom/open-scratch-buffer + :gnvime "M-;" #'eval-expression + :gnvime "M-:" #'doom/open-scratch-buffer ;; Text-scaling - "M-+" (λ! (text-scale-set 0)) - "M-=" #'text-scale-increase - "M--" #'text-scale-decrease + "M-+" (λ! (text-scale-set 0)) + "M-=" #'text-scale-increase + "M--" #'text-scale-decrease ;; Simple window navigation/manipulation - "C-`" #'doom/popup-toggle - "C-~" #'doom/popup-raise - "M-t" #'+workspace/new - "M-T" #'+workspace/display - "M-w" #'delete-window - "M-W" #'+workspace/close-workspace-or-frame - "M-n" #'evil-buffer-new - "M-N" #'make-frame - "M-1" (λ! (+workspace/switch-to 0)) - "M-2" (λ! (+workspace/switch-to 1)) - "M-3" (λ! (+workspace/switch-to 2)) - "M-4" (λ! (+workspace/switch-to 3)) - "M-5" (λ! (+workspace/switch-to 4)) - "M-6" (λ! (+workspace/switch-to 5)) - "M-7" (λ! (+workspace/switch-to 6)) - "M-8" (λ! (+workspace/switch-to 7)) - "M-9" (λ! (+workspace/switch-to 8)) - "M-0" #'+workspace/switch-to-last + "C-`" #'doom/popup-toggle + "C-~" #'doom/popup-raise + "M-t" #'+workspace/new + "M-T" #'+workspace/display + "M-w" #'delete-window + "M-W" #'+workspace/close-workspace-or-frame + "M-n" #'evil-buffer-new + "M-N" #'make-frame + "M-1" (λ! (+workspace/switch-to 0)) + "M-2" (λ! (+workspace/switch-to 1)) + "M-3" (λ! (+workspace/switch-to 2)) + "M-4" (λ! (+workspace/switch-to 3)) + "M-5" (λ! (+workspace/switch-to 4)) + "M-6" (λ! (+workspace/switch-to 5)) + "M-7" (λ! (+workspace/switch-to 6)) + "M-8" (λ! (+workspace/switch-to 7)) + "M-9" (λ! (+workspace/switch-to 8)) + "M-0" #'+workspace/switch-to-last ;; Other sensible, textmate-esque global bindings - "M-r" #'+eval/buffer - "M-R" #'+eval/region-and-replace - "M-b" #'+eval/build - "M-a" #'mark-whole-buffer - "M-c" #'evil-yank - "M-q" (if (daemonp) #'delete-frame #'save-buffers-kill-emacs) - "M-s" #'save-buffer - "M-v" #'clipboard-yank - "M-f" #'swiper - "C-M-f" #'doom/toggle-fullscreen - :m "A-j" #'+hlissner:multi-next-line - :m "A-k" #'+hlissner:multi-previous-line + :ne "M-r" #'+eval/buffer + :ne "M-R" #'+eval/region-and-replace + :ne "M-b" #'+eval/build + :ne "M-a" #'mark-whole-buffer + :ne "M-c" #'evil-yank + :ne "M-q" (if (daemonp) #'delete-frame #'save-buffers-kill-emacs) + :ne "M-f" #'swiper + :ne "C-M-f" #'doom/toggle-fullscreen + :n "M-s" #'save-buffer + :m "A-j" #'+hlissner:multi-next-line + :m "A-k" #'+hlissner:multi-previous-line :nv "C-SPC" #'+evil:fold-toggle + :gnvimer "M-v" #'clipboard-yank ;; Easier window navigation - :en "C-h" #'evil-window-left - :en "C-j" #'evil-window-down - :en "C-k" #'evil-window-up - :en "C-l" #'evil-window-right + :en "C-h" #'evil-window-left + :en "C-j" #'evil-window-down + :en "C-k" #'evil-window-up + :en "C-l" #'evil-window-right - (:prefix "C-x" - "p" #'doom/other-popup) + "C-x p" #'doom/other-popup ;; --- ------------------------------------- (:leader - :desc "Ex command" :nv ";" #'evil-ex - :desc "M-x" :nv ":" #'execute-extended-command + :desc "Ex command" :nv ";" #'evil-ex + :desc "M-x" :nv ":" #'execute-extended-command :desc "Pop up scratch buffer" :nv "x" #'doom/open-scratch-buffer :desc "Org Capture" :nv "X" #'+org-capture/open @@ -92,30 +89,30 @@ :desc "Jump to bookmark" :n "RET" #'bookmark-jump ;; C-u is used by evil - :desc "Universal argument" :n "u" #'universal-argument - :desc "window" :n "w" evil-window-map + :desc "Universal argument" :n "u" #'universal-argument + :desc "window" :n "w" evil-window-map (:desc "previous..." :prefix "[" - :desc "Text size" :nv "[" #'text-scale-decrease - :desc "Buffer" :nv "b" #'doom/previous-buffer - :desc "Diff Hunk" :nv "d" #'git-gutter:previous-hunk - :desc "Todo" :nv "t" #'hl-todo-previous - :desc "Error" :nv "e" #'previous-error - :desc "Workspace" :nv "w" #'+workspace/switch-left - :desc "Smart jump" :nv "h" #'smart-backward - :desc "Spelling error" :nv "s" #'evil-prev-flyspell-error - :desc "Spelling correction" :n "S" #'flyspell-correct-previous-word-generic) + :desc "Text size" :nv "[" #'text-scale-decrease + :desc "Buffer" :nv "b" #'doom/previous-buffer + :desc "Diff Hunk" :nv "d" #'git-gutter:previous-hunk + :desc "Todo" :nv "t" #'hl-todo-previous + :desc "Error" :nv "e" #'previous-error + :desc "Workspace" :nv "w" #'+workspace/switch-left + :desc "Smart jump" :nv "h" #'smart-backward + :desc "Spelling error" :nv "s" #'evil-prev-flyspell-error + :desc "Spelling correction" :n "S" #'flyspell-correct-previous-word-generic) (:desc "next..." :prefix "]" - :desc "Text size" :nv "]" #'text-scale-increase - :desc "Buffer" :nv "b" #'doom/next-buffer - :desc "Diff Hunk" :nv "d" #'git-gutter:next-hunk - :desc "Todo" :nv "t" #'hl-todo-next - :desc "Error" :nv "e" #'next-error - :desc "Workspace" :nv "w" #'+workspace/switch-right - :desc "Smart jump" :nv "l" #'smart-forward - :desc "Spelling error" :nv "s" #'evil-next-flyspell-error - :desc "Spelling correction" :n "S" #'flyspell-correct-word-generic) + :desc "Text size" :nv "]" #'text-scale-increase + :desc "Buffer" :nv "b" #'doom/next-buffer + :desc "Diff Hunk" :nv "d" #'git-gutter:next-hunk + :desc "Todo" :nv "t" #'hl-todo-next + :desc "Error" :nv "e" #'next-error + :desc "Workspace" :nv "w" #'+workspace/switch-right + :desc "Smart jump" :nv "l" #'smart-forward + :desc "Spelling error" :nv "s" #'evil-next-flyspell-error + :desc "Spelling correction" :n "S" #'flyspell-correct-word-generic) (:desc "search" :prefix "/" :desc "Swiper" :nv "/" #'swiper @@ -188,63 +185,64 @@ :desc "Yank filename" :n "y" #'+hlissner/yank-buffer-filename) (:desc "git" :prefix "g" - :desc "Git status" :n "s" #'magit-status - :desc "Git blame" :n "b" #'magit-blame - :desc "Git time machine" :n "t" #'git-timemachine-toggle - :desc "Git revert hunk" :n "r" #'git-gutter:revert-hunk - :desc "Git revert buffer" :n "R" #'vc-revert - :desc "List gists" :n "g" #'+gist:list - :desc "Next hunk" :nv "]" #'git-gutter:next-hunk - :desc "Previous hunk" :nv "[" #'git-gutter:previous-hunk) + :desc "Git status" :n "S" #'magit-status + :desc "Git blame" :n "b" #'magit-blame + :desc "Git time machine" :n "t" #'git-timemachine-toggle + :desc "Git stage hunk" :n "s" #'git-gutter:stage-hunk + :desc "Git revert hunk" :n "r" #'git-gutter:revert-hunk + :desc "Git revert buffer" :n "R" #'vc-revert + :desc "List gists" :n "g" #'+gist:list + :desc "Next hunk" :nv "]" #'git-gutter:next-hunk + :desc "Previous hunk" :nv "[" #'git-gutter:previous-hunk) (:desc "help" :prefix "h" :n "h" help-map - :desc "Apropos" :n "a" #'apropos - :desc "Reload theme" :n "R" #'doom/reload-theme - :desc "Find library" :n "l" #'find-library - :desc "Toggle Emacs log" :n "m" #'doom/popup-toggle-messages - :desc "Command log" :n "L" #'global-command-log-mode - :desc "Describe function" :n "f" #'describe-function - :desc "Describe key" :n "k" #'describe-key - :desc "Describe char" :n "c" #'describe-char - :desc "Describe mode" :n "M" #'describe-mode - :desc "Describe variable" :n "v" #'describe-variable - :desc "Describe face" :n "F" #'describe-face - :desc "Describe DOOM setting" :n "s" #'doom/describe-setting - :desc "Describe DOOM module" :n "d" #'doom/describe-module - :desc "Find definition" :n "." #'+jump/definition - :desc "Find references" :n "/" #'+jump/references - :desc "Find documentation" :n "h" #'+jump/documentation - :desc "What face" :n "'" #'doom/what-face - :desc "What minor modes" :n ";" #'doom/what-minor-mode - :desc "Info" :n "i" #'info - :desc "Toggle profiler" :n "p" #'doom/toggle-profiler) + :desc "Apropos" :n "a" #'apropos + :desc "Reload theme" :n "R" #'doom/reload-theme + :desc "Find library" :n "l" #'find-library + :desc "Toggle Emacs log" :n "m" #'doom/popup-toggle-messages + :desc "Command log" :n "L" #'global-command-log-mode + :desc "Describe function" :n "f" #'describe-function + :desc "Describe key" :n "k" #'describe-key + :desc "Describe char" :n "c" #'describe-char + :desc "Describe mode" :n "M" #'describe-mode + :desc "Describe variable" :n "v" #'describe-variable + :desc "Describe face" :n "F" #'describe-face + :desc "Describe DOOM setting" :n "s" #'doom/describe-setting + :desc "Describe DOOM module" :n "d" #'doom/describe-module + :desc "Find definition" :n "." #'+jump/definition + :desc "Find references" :n "/" #'+jump/references + :desc "Find documentation" :n "h" #'+jump/documentation + :desc "What face" :n "'" #'doom/what-face + :desc "What minor modes" :n ";" #'doom/what-minor-mode + :desc "Info" :n "i" #'info + :desc "Toggle profiler" :n "p" #'doom/toggle-profiler) (:desc "insert" :prefix "i" - :desc "From kill-ring" :nv "y" #'counsel-yank-pop - :desc "From snippet" :nv "s" #'yas-insert-snippet) + :desc "From kill-ring" :nv "y" #'counsel-yank-pop + :desc "From snippet" :nv "s" #'yas-insert-snippet) (:desc "notes" :prefix "n" - :desc "Find file in notes" :n "n" #'+hlissner/find-in-notes - :desc "Browse notes" :n "N" #'+hlissner/browse-notes - :desc "Org capture" :n "x" #'+org-capture/open - :desc "Browse mode notes" :n "m" #'+org/browse-notes-for-major-mode - :desc "Browse project notes" :n "p" #'+org/browse-notes-for-project) + :desc "Find file in notes" :n "n" #'+hlissner/find-in-notes + :desc "Browse notes" :n "N" #'+hlissner/browse-notes + :desc "Org capture" :n "x" #'+org-capture/open + :desc "Browse mode notes" :n "m" #'+org/browse-notes-for-major-mode + :desc "Browse project notes" :n "p" #'+org/browse-notes-for-project) (:desc "open" :prefix "o" - :desc "Default browser" :n "b" #'browse-url-of-file - :desc "Debugger" :n "d" #'+debug/open - :desc "REPL" :n "r" #'+eval/open-repl - :v "r" #'+eval:repl - :desc "Neotree" :n "n" #'+neotree/toggle - :desc "Terminal" :n "t" #'+term/open-popup - :desc "Terminal in project" :n "T" #'+term/open-popup-in-project + :desc "Default browser" :n "b" #'browse-url-of-file + :desc "Debugger" :n "d" #'+debug/open + :desc "REPL" :n "r" #'+eval/open-repl + :v "r" #'+eval:repl + :desc "Neotree" :n "n" #'+neotree/toggle + :desc "Terminal" :n "t" #'+term/open-popup + :desc "Terminal in project" :n "T" #'+term/open-popup-in-project ;; applications - :desc "APP: elfeed" :n "E" #'=rss - :desc "APP: email" :n "M" #'=email - :desc "APP: twitter" :n "T" #'=twitter - :desc "APP: regex" :n "X" #'=regex + :desc "APP: elfeed" :n "E" #'=rss + :desc "APP: email" :n "M" #'=email + :desc "APP: twitter" :n "T" #'=twitter + :desc "APP: regex" :n "X" #'=regex ;; macos (:when IS-MAC @@ -266,8 +264,8 @@ :desc "Invalidate cache" :n "x" #'projectile-invalidate-cache) (:desc "quit" :prefix "q" - :desc "Quit" :n "q" #'evil-save-and-quit - :desc "Quit (forget session)" :n "Q" #'+workspace/kill-session-and-quit) + :desc "Quit" :n "q" #'evil-save-and-quit + :desc "Quit (forget session)" :n "Q" #'+workspace/kill-session-and-quit) (:desc "remote" :prefix "r" :desc "Upload local" :n "u" #'+upload/local @@ -278,10 +276,10 @@ :desc "Detect remote changes" :n ">" #'+upload/check-remote) (:desc "snippets" :prefix "s" - :desc "New snippet" :n "n" #'yas-new-snippet - :desc "Insert snippet" :nv "i" #'yas-insert-snippet - :desc "Find snippet for mode" :n "s" #'yas-visit-snippet-file - :desc "Find snippet" :n "S" #'+hlissner/find-in-snippets) + :desc "New snippet" :n "n" #'yas-new-snippet + :desc "Insert snippet" :nv "i" #'yas-insert-snippet + :desc "Find snippet for mode" :n "s" #'yas-visit-snippet-file + :desc "Find snippet" :n "S" #'+hlissner/find-in-snippets) (:desc "toggle" :prefix "t" :desc "Flyspell" :n "s" #'flyspell-mode @@ -483,13 +481,12 @@ ;; git-timemachine (:after git-timemachine (:map git-timemachine-mode-map - :nv "p" #'git-timemachine-show-previous-revision - :nv "n" #'git-timemachine-show-next-revision - :nv "g" #'git-timemachine-show-nth-revision - :nv "q" #'git-timemachine-quit - :nv "w" #'git-timemachine-kill-abbreviated-revision - :nv "W" #'git-timemachine-kill-revision - :nv "b" #'git-timemachine-blame)) + :n "C-p" #'git-timemachine-show-previous-revision + :n "C-n" #'git-timemachine-show-next-revision + :n "[[" #'git-timemachine-show-previous-revision + :n "]]" #'git-timemachine-show-next-revision + :n "q" #'git-timemachine-quit + :n "gb" #'git-timemachine-blame)) ;; gist (:after gist diff --git a/modules/private/hlissner/autoload/evil.el b/modules/private/hlissner/autoload/evil.el index 3ef44c1ad..0845af2d2 100644 --- a/modules/private/hlissner/autoload/evil.el +++ b/modules/private/hlissner/autoload/evil.el @@ -1,4 +1,5 @@ ;;; private/hlissner/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+hlissner:multi-next-line "private/hlissner/autoload/evil" nil t) (evil-define-motion +hlissner:multi-next-line (count) diff --git a/modules/private/hlissner/autoload/hlissner.el b/modules/private/hlissner/autoload/hlissner.el index 2c8c52b90..2ff00d069 100644 --- a/modules/private/hlissner/autoload/hlissner.el +++ b/modules/private/hlissner/autoload/hlissner.el @@ -22,6 +22,7 @@ private/hlissner/snippets." (defun ,(intern (format "+hlissner/find-in-%s" name)) () (interactive) (let ((default-directory ,dir) + projectile-project-name projectile-require-project-root projectile-cached-buffer-file-name projectile-cached-project-root) diff --git a/modules/tools/eshell/autoload/evil.el b/modules/tools/eshell/autoload/evil.el index 5ef5f8ee0..0f8d18316 100644 --- a/modules/tools/eshell/autoload/evil.el +++ b/modules/tools/eshell/autoload/evil.el @@ -1,4 +1,5 @@ ;;; tools/eshell/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+eshell:run "tools/eshell/autoload/evil" nil t) (evil-define-command +eshell:run (command bang) diff --git a/modules/tools/eshell/config.el b/modules/tools/eshell/config.el index 207d2f873..f2d82aa40 100644 --- a/modules/tools/eshell/config.el +++ b/modules/tools/eshell/config.el @@ -10,7 +10,7 @@ (def-package! eshell ; built-in :commands eshell-mode :init - (setq eshell-directory-name (concat doom-cache-dir "/eshell") + (setq eshell-directory-name (concat doom-etc-dir "/eshell") eshell-scroll-to-bottom-on-input 'all eshell-scroll-to-bottom-on-output 'all eshell-buffer-shorthand t diff --git a/modules/tools/gist/autoload/evil.el b/modules/tools/gist/autoload/evil.el index 2d93324b7..3633fe876 100644 --- a/modules/tools/gist/autoload/evil.el +++ b/modules/tools/gist/autoload/evil.el @@ -1,4 +1,5 @@ ;;; tools/gist/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+gist:send "tools/gist/autoload/evil" nil t) (evil-define-operator +gist:send (bang) diff --git a/modules/tools/tmux/autoload/evil.el b/modules/tools/tmux/autoload/evil.el index f01230c28..df3284290 100644 --- a/modules/tools/tmux/autoload/evil.el +++ b/modules/tools/tmux/autoload/evil.el @@ -1,4 +1,5 @@ ;;; tools/tmux/autoload/evil.el -*- lexical-binding: t; -*- +;;;###if (featurep! :feature evil) ;;;###autoload (autoload '+tmux:run "tools/tmux/autoload/evil" nil t) (evil-define-command +tmux:run (bang &optional command) diff --git a/modules/ui/doom-modeline/config.el b/modules/ui/doom-modeline/config.el index d289f5647..0bc4e9a93 100644 --- a/modules/ui/doom-modeline/config.el +++ b/modules/ui/doom-modeline/config.el @@ -111,22 +111,22 @@ file-name => comint.el") :group 'doom) (defface doom-modeline-buffer-path - '((t (:inherit mode-line-emphasis :bold t))) + '((t (:inherit (mode-line-emphasis bold)))) "Face used for the dirname part of the buffer path." :group '+doom-modeline) (defface doom-modeline-buffer-file - '((t (:inherit mode-line-buffer-id))) + '((t (:inherit (mode-line-buffer-id bold)))) "Face used for the filename part of the mode-line buffer path." :group '+doom-modeline) (defface doom-modeline-buffer-modified - '((t (:inherit error :background nil :bold t))) + '((t (:inherit (error bold) :background nil))) "Face used for the 'unsaved' symbol in the mode-line." :group '+doom-modeline) (defface doom-modeline-buffer-major-mode - '((t (:inherit mode-line-emphasis :bold t))) + '((t (:inherit (mode-line-emphasis bold)))) "Face used for the major-mode segment in the mode-line." :group '+doom-modeline) @@ -142,17 +142,17 @@ file-name => comint.el") :group '+doom-modeline) (defface doom-modeline-info - `((t (:inherit success :bold t))) + `((t (:inherit (success bold)))) "Face for info-level messages in the modeline. Used by `*vc'." :group '+doom-modeline) (defface doom-modeline-warning - `((t (:inherit warning :bold t))) + `((t (:inherit (warning bold)))) "Face for warnings in the modeline. Used by `*flycheck'" :group '+doom-modeline) (defface doom-modeline-urgent - `((t (:inherit error :bold t))) + `((t (:inherit (error bold)))) "Face for errors in the modeline. Used by `*flycheck'" :group '+doom-modeline) @@ -226,9 +226,7 @@ active." (defun +doom-modeline--buffer-file-name-truncate (&optional truncate-tail) "Propertized `buffer-file-name' that truncates every dir along path. If TRUNCATE-TAIL is t also truncate the parent directory of the file." - (let ((dirs (shrink-path-prompt (file-name-directory - (or buffer-file-truename - (file-truename buffer-file-name))))) + (let ((dirs (shrink-path-prompt (file-name-directory buffer-file-truename))) (active (active))) (if (null dirs) (propertize "%b" 'face (if active 'doom-modeline-buffer-file)) @@ -251,13 +249,13 @@ If TRUNCATE-TAIL is t also truncate the parent directory of the file." (if (null root) (propertize "%b" 'face (if active 'doom-modeline-buffer-file)) (let* ((modified-faces (if (buffer-modified-p) 'doom-modeline-buffer-modified)) - (relative-dirs (file-relative-name (file-name-directory buffer-file-name) + (relative-dirs (file-relative-name (file-name-directory buffer-file-truename) (if include-project (concat root "../") root))) (relative-faces (or modified-faces (if active 'doom-modeline-buffer-path))) (file-faces (or modified-faces (if active 'doom-modeline-buffer-file)))) (if (equal "./" relative-dirs) (setq relative-dirs "")) (concat (propertize relative-dirs 'face (if relative-faces `(:inherit ,relative-faces))) - (propertize (file-name-nondirectory buffer-file-name) + (propertize (file-name-nondirectory buffer-file-truename) 'face (if file-faces `(:inherit ,file-faces)))))))) (defun +doom-modeline--buffer-file-name (truncate-project-root-parent) @@ -269,10 +267,8 @@ Example: ~/Projects/FOSS/emacs/lisp/comint.el => ~/P/F/emacs/lisp/comint.el" (let* ((project-root (doom-project-root)) (file-name-split (shrink-path-file-mixed project-root - (file-name-directory - (or buffer-file-truename - (file-truename buffer-file-name))) - (file-truename buffer-file-name))) + (file-name-directory buffer-file-truename) + buffer-file-truename)) (active (active))) (if (null file-name-split) (propertize "%b" 'face (if active 'doom-modeline-buffer-file)) @@ -291,7 +287,7 @@ Example: (abbreviate-file-name project-root)) 'face sp-props) (propertize (concat project "/") 'face project-props) - (when relative-path (propertize relative-path 'face relative-props)) + (if relative-path (propertize relative-path 'face relative-props)) (propertize filename 'face file-props))))))))) diff --git a/modules/ui/doom/config.el b/modules/ui/doom/config.el index 75dbcc8b0..50ca45325 100644 --- a/modules/ui/doom/config.el +++ b/modules/ui/doom/config.el @@ -1,10 +1,5 @@ ;;; ui/doom/config.el -*- lexical-binding: t; -*- -(set! :font "Fira Mono" :size 12) -(set! :big-font "Fira Mono" :size 18) -(set! :variable-font "Fira Sans" :size 12) -(set! :unicode-font "DejaVu Sans Mono" :size 12) - ;; (def-package! doom-themes :demand t diff --git a/modules/ui/unicode/config.el b/modules/ui/unicode/config.el index bf9704c64..047c23ff6 100644 --- a/modules/ui/unicode/config.el +++ b/modules/ui/unicode/config.el @@ -1,10 +1,19 @@ ;;; ui/unicode/config.el -*- lexical-binding: t; -*- (def-package! unicode-fonts - :demand t :init (setq-default bidi-display-reordering t doom-unicode-font nil) - :config - ;; NOTE will impact startup time on first run - (unicode-fonts-setup)) + + (defun +unicode|init-fonts (&optional frame) + "Initialize `unicode-fonts', if in a GUI session." + (when (display-graphic-p frame) + (with-selected-frame frame + (require 'unicode-fonts) + ;; NOTE will impact startup time on first run + (unicode-fonts-setup)))) + + (add-hook! 'after-init-hook + (if initial-window-system + (+unicode|init-fonts) + (add-hook 'after-make-frame-functions #'+unicode|init-fonts))))