From e29e20cc520ed74f8c6326eb2c1d006d5a80c23a Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Fri, 1 May 2020 13:07:17 +0900 Subject: [PATCH 001/105] Fix set-formatter! documentation Remove :install from supported keywords. --- modules/editor/format/autoload/settings.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/editor/format/autoload/settings.el b/modules/editor/format/autoload/settings.el index 359480671..a98942205 100644 --- a/modules/editor/format/autoload/settings.el +++ b/modules/editor/format/autoload/settings.el @@ -91,7 +91,7 @@ (name formatter &key modes filter ok-statuses error-regexp) "Define (or modify) a formatter named NAME. -Supported keywords: :modes :install :filter :ok-statuses :error-regexp +Supported keywords: :modes :filter :ok-statuses :error-regexp NAME is a symbol that identifies this formatter. From 75a9bcf56b77149f07873c3984537849ac8a49be Mon Sep 17 00:00:00 2001 From: amatrelan Date: Mon, 4 May 2020 13:47:59 +0300 Subject: [PATCH 002/105] Added lang/nix barebone readme. I added all the things I know about this module but there might be something I don't know about so check and validate. This is related to #1166 effort. --- modules/lang/nix/README.org | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/lang/nix/README.org diff --git a/modules/lang/nix/README.org b/modules/lang/nix/README.org new file mode 100644 index 000000000..13a45eab5 --- /dev/null +++ b/modules/lang/nix/README.org @@ -0,0 +1,55 @@ +#+TITLE: lang/nix +#+DATE: May 4, 2020 +#+SINCE: v2.0.7 +#+STARTUP: inlineimages nofold + +* Table of Contents :TOC_3:noexport: +- [[#description][Description]] + - [[#maintainers][Maintainers]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] +- [[#prerequisites][Prerequisites]] +- [[#features][Features]] +- [[#configuration][Configuration]] +- [[#troubleshooting][Troubleshooting]] + +* Description +Adds many tools for [[https://nixos.org/][nix(os)]] users in nice package for Doom users. + ++ Syntax highlight ++ Completion through ~company~ / ~helm~ ++ Nix option lookup ++ Formatting (~nixfmt~) + +** Maintainers +This module has no dedicated maintainers. + +** Module Flags +This module provides no flags. + +** Plugins ++ [[https://github.com/NixOS/nix-mode][nix-mode]] ++ [[https://github.com/jwiegley/nix-update-el][nix-update]] + +* Prerequisites + +* Features ++ ~nixfmt~ is required to use formatting + + If you have nix(os) installed it can be installed trough nix configuration ~enviroment.systemPackages = with pkgs; [ nixfmt ];~ (recommended) + + Or trough nix-env ~nix-env -iA nixpkgs.nixfmt~ + + Or trough nix-shell ~nix-shell -f https://github.com/serokell/nixfmt/archive/master.tar.gz -i~ ++ ~:editor format~ ~format-all~ also supports ~nixfmt~ so you can use that also to format nix code, default bindings ~SPC c f~ in evil. + +* Configuration +| Binding | Description | +|-------------------+----------------------| +| ~ b~ | ~nix-build~ | +| ~ f~ | ~nix-update-fetch~ | +| ~ o~ | ~+nix/lookup-option~ | +| ~ p~ | ~nix-format-buffer~ | +| ~ r~ | ~nix-repl-show~ | +| ~ s~ | ~nix-repl-shell~ | +| ~ u~ | ~nix-unpack~ | + +* Troubleshooting ++ There isn't any known problems. From 53eb32ea163bd4421b222e55e09306f48ab3d116 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Wed, 6 May 2020 18:24:10 +0900 Subject: [PATCH 003/105] Fix Java file templates --- modules/editor/file-templates/templates/java-mode/__ | 4 ++-- modules/editor/file-templates/templates/java-mode/__main | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/editor/file-templates/templates/java-mode/__ b/modules/editor/file-templates/templates/java-mode/__ index 2f45b0ca0..180f0a143 100644 --- a/modules/editor/file-templates/templates/java-mode/__ +++ b/modules/editor/file-templates/templates/java-mode/__ @@ -1,9 +1,9 @@ # -*- mode: snippet -*- # name: Java file template # -- -package `(yas-java-project-package)`; +package `(+java-current-package)`; -public class `(yas-java-class-name)` $1 +public class `(+java-current-class)` $1 { $0 } diff --git a/modules/editor/file-templates/templates/java-mode/__main b/modules/editor/file-templates/templates/java-mode/__main index 20dde1223..748a9d96c 100644 --- a/modules/editor/file-templates/templates/java-mode/__main +++ b/modules/editor/file-templates/templates/java-mode/__main @@ -1,9 +1,9 @@ # -*- mode: snippet -*- # name: Java MAIN file template # -- -package `(yas-java-project-package)`; +package `(+java-current-package)`; -public class `(yas-java-class-name)` $1 +public class `(+java-current-class)` $1 { public static void main(String[] args) { $0 From 3e7624cfc0ded1aa21b1d927da9101921040ae68 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Wed, 6 May 2020 23:49:05 +0900 Subject: [PATCH 004/105] Add Groovy REPL support --- modules/lang/java/autoload.el | 6 ++++++ modules/lang/java/config.el | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/lang/java/autoload.el b/modules/lang/java/autoload.el index 86e06f26c..88b8b1d31 100644 --- a/modules/lang/java/autoload.el +++ b/modules/lang/java/autoload.el @@ -71,3 +71,9 @@ root)." (user-error "This buffer has no filepath; cannot guess its class name")) (or (file-name-sans-extension (file-name-base (buffer-file-name))) "ClassName")) + +;;;###autoload +(defun +java/groovy-open-repl () + (interactive) + (call-interactively #'run-groovy) + (pop-to-buffer groovy-buffer)) diff --git a/modules/lang/java/config.el b/modules/lang/java/config.el index 5e6dee5fd..ba5c00454 100644 --- a/modules/lang/java/config.el +++ b/modules/lang/java/config.el @@ -45,4 +45,5 @@ If the depth is 2, the first two directories are removed: net.lissner.game.") (use-package! groovy-mode :mode "\\.g\\(?:radle\\|roovy\\)$" :config - (set-eval-handler! 'groovy-mode "groovy")) + (set-eval-handler! 'groovy-mode "groovy") + (set-repl-handler! 'groovy-mode #'+java/groovy-open-repl)) From c3d22346ada7ff190fe0c32944bb8b050bdb9ca7 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Wed, 6 May 2020 23:50:45 +0900 Subject: [PATCH 005/105] Set the docsets for Groovy --- modules/lang/java/config.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/lang/java/config.el b/modules/lang/java/config.el index ba5c00454..55242c7b1 100644 --- a/modules/lang/java/config.el +++ b/modules/lang/java/config.el @@ -45,5 +45,6 @@ If the depth is 2, the first two directories are removed: net.lissner.game.") (use-package! groovy-mode :mode "\\.g\\(?:radle\\|roovy\\)$" :config + (set-docsets! 'groovy-mode "Groovy" "Groovy_SDK") (set-eval-handler! 'groovy-mode "groovy") (set-repl-handler! 'groovy-mode #'+java/groovy-open-repl)) From 0e4f2fa578ce414186411b0ff6caf14140414346 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Wed, 6 May 2020 23:53:37 +0900 Subject: [PATCH 006/105] Add doc for +java/groovy-open-repl --- modules/lang/java/autoload.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/lang/java/autoload.el b/modules/lang/java/autoload.el index 88b8b1d31..1ced3b749 100644 --- a/modules/lang/java/autoload.el +++ b/modules/lang/java/autoload.el @@ -74,6 +74,7 @@ root)." ;;;###autoload (defun +java/groovy-open-repl () + "Open a Groovy REPL." (interactive) (call-interactively #'run-groovy) (pop-to-buffer groovy-buffer)) From 174ab0303f8d8191109ffa5228b6793fc0ff8ca4 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Thu, 7 May 2020 01:05:57 +0900 Subject: [PATCH 007/105] Add Dash docsets + Xwidget integration --- modules/tools/lookup/README.org | 1 + modules/tools/lookup/config.el | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/modules/tools/lookup/README.org b/modules/tools/lookup/README.org index 5c51aeb78..b4ecf508e 100644 --- a/modules/tools/lookup/README.org +++ b/modules/tools/lookup/README.org @@ -40,6 +40,7 @@ or synonyms. + ~+dictionary~ Enable word definition and thesaurus lookup functionality. + ~+offline~ Install and prefer offline dictionary/thesaurus. + ~+docsets~ Enable integration with Dash.app docsets. + + ~+xwidget~ Enable integration with [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Embedded-WebKit-Widgets.html][Embedded Webkit Widgets]]. ** Plugins + [[https://github.com/jacktasia/dumb-jump][dumb-jump]] diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index 6381956a2..25f310e3b 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -178,6 +178,26 @@ See https://github.com/magit/ghub/issues/81" (let ((gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")) (funcall orig-fn url))) + ;; Dash docset + Xwidget integration + (when (and (featurep! :tools lookup +xwidget) (display-graphic-p)) + (setq dash-docs-browser-func #'xwidget-webkit-browse-url) + + (set-popup-rule! "^\\*xwidget" :vslot -11 :size 0.35 :select nil) + + (defun +xwidget--webkit-goto-url-a (&rest _) + (pop-to-buffer xwidget-webkit-last-session-buffer)) + (advice-add #'xwidget-webkit-goto-url :after #'+xwidget--webkit-goto-url-a) + + (defun +xwidget--webkit-new-session-a (orig-fun &rest args) + (save-window-excursion + (apply orig-fun args)) + (pop-to-buffer xwidget-webkit-last-session-buffer)) + (advice-add #'xwidget-webkit-new-session :around #'+xwidget--webkit-new-session-a) + + (when (featurep! :editor evil +everywhere) + (add-transient-hook! 'xwidget-webkit-mode-hook + (+evil-collection-init 'xwidget)))) + (cond ((featurep! :completion helm) (require 'helm-dash nil t)) ((featurep! :completion ivy) From d8ef43c5576ce41288b349ddaa71da14364f7ac4 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Thu, 7 May 2020 01:12:47 +0900 Subject: [PATCH 008/105] Add Kotlin REPL support --- modules/lang/kotlin/config.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/lang/kotlin/config.el b/modules/lang/kotlin/config.el index d5eda36af..a4ccc674f 100644 --- a/modules/lang/kotlin/config.el +++ b/modules/lang/kotlin/config.el @@ -4,6 +4,7 @@ (when (featurep! +lsp) (add-hook 'kotlin-mode-local-vars-hook #'lsp!)) (set-docsets! 'kotlin-mode "Kotlin") + (set-repl-handler! 'kotlin-mode #'kotlin-repl) (map! :map kotlin-mode-map :localleader From 849ca9b79f46f49b9e87a62198a5c75baaa4094c Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Thu, 7 May 2020 01:19:57 +0900 Subject: [PATCH 009/105] Fix typo: Groovy_SDK -> Groovy_JDK --- modules/lang/java/config.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/java/config.el b/modules/lang/java/config.el index 55242c7b1..f02a82992 100644 --- a/modules/lang/java/config.el +++ b/modules/lang/java/config.el @@ -45,6 +45,6 @@ If the depth is 2, the first two directories are removed: net.lissner.game.") (use-package! groovy-mode :mode "\\.g\\(?:radle\\|roovy\\)$" :config - (set-docsets! 'groovy-mode "Groovy" "Groovy_SDK") + (set-docsets! 'groovy-mode "Groovy" "Groovy_JDK") (set-eval-handler! 'groovy-mode "groovy") (set-repl-handler! 'groovy-mode #'+java/groovy-open-repl)) From d89e90190e451f120686a8dfad6b264f93ff6360 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Thu, 7 May 2020 01:22:26 +0900 Subject: [PATCH 010/105] Get rid of redundant pop-to-buffer --- modules/lang/java/autoload.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/java/autoload.el b/modules/lang/java/autoload.el index 1ced3b749..f95d128f2 100644 --- a/modules/lang/java/autoload.el +++ b/modules/lang/java/autoload.el @@ -77,4 +77,4 @@ root)." "Open a Groovy REPL." (interactive) (call-interactively #'run-groovy) - (pop-to-buffer groovy-buffer)) + (get-buffer groovy-buffer)) From 9219d257466140bb3dafb33205bf98bdf6a78844 Mon Sep 17 00:00:00 2001 From: Jarmo Riikonen Date: Wed, 6 May 2020 19:27:10 +0300 Subject: [PATCH 011/105] Apply suggestions from code review Co-authored-by: Oleksii Filonenko --- modules/lang/nix/README.org | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/lang/nix/README.org b/modules/lang/nix/README.org index 13a45eab5..ef3e702d5 100644 --- a/modules/lang/nix/README.org +++ b/modules/lang/nix/README.org @@ -14,9 +14,9 @@ - [[#troubleshooting][Troubleshooting]] * Description -Adds many tools for [[https://nixos.org/][nix(os)]] users in nice package for Doom users. +Adds many tools for [[https://nixos.org/][Nix(OS)]] users in nice package for Doom users. -+ Syntax highlight ++ Syntax highlighting + Completion through ~company~ / ~helm~ + Nix option lookup + Formatting (~nixfmt~) @@ -35,10 +35,10 @@ This module provides no flags. * Features + ~nixfmt~ is required to use formatting - + If you have nix(os) installed it can be installed trough nix configuration ~enviroment.systemPackages = with pkgs; [ nixfmt ];~ (recommended) - + Or trough nix-env ~nix-env -iA nixpkgs.nixfmt~ - + Or trough nix-shell ~nix-shell -f https://github.com/serokell/nixfmt/archive/master.tar.gz -i~ -+ ~:editor format~ ~format-all~ also supports ~nixfmt~ so you can use that also to format nix code, default bindings ~SPC c f~ in evil. + + If you have Nix(OS) installed it can be installed through Nix configuration ~environment.systemPackages = with pkgs; [ nixfmt ];~ (recommended) + + Or through nix-env ~nix-env -iA nixpkgs.nixfmt~ + + Or through nix-shell ~nix-shell -f https://github.com/serokell/nixfmt/archive/master.tar.gz -i~ ++ ~:editor format~ ~format-all~ also supports ~nixfmt~ so you can use that also to format Nix code, default binding is ~SPC c f~ in evil. * Configuration | Binding | Description | @@ -52,4 +52,4 @@ This module provides no flags. | ~ u~ | ~nix-unpack~ | * Troubleshooting -+ There isn't any known problems. ++ There aren't any known problems. From 8f4684a69b7ebf8bf150c224630c625246617486 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 May 2020 13:44:06 -0400 Subject: [PATCH 012/105] Add new iosevka ligatures to composition table Closes #3047 --- modules/ui/pretty-code/config.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/ui/pretty-code/config.el b/modules/ui/pretty-code/config.el index 89a1a698b..c7aa9836c 100644 --- a/modules/ui/pretty-code/config.el +++ b/modules/ui/pretty-code/config.el @@ -57,16 +57,16 @@ besides what is listed.") (?$ . ,(regexp-opt '("$>" "$>>"))) (?% . ,(regexp-opt '("%%" "%%%"))) (?& . ,(regexp-opt '("&&" "&&&"))) - (?* . ,(regexp-opt '("*" "**" "***" "**/" "*/" "*>"))) - (?+ . ,(regexp-opt '("+" "++" "+++" "+>"))) - (?- . ,(regexp-opt '("--" "---" "-->" "-<" "-<<" "->" "->>" "-}" "-~"))) - (?. . ,(regexp-opt '(".-" ".." "..." "..<" ".="))) + (?* . ,(regexp-opt '("*" "**" "***" "**/" "*/" "*>" "*)"))) + (?+ . ,(regexp-opt '("+" "++" "+++" "+>" "+:"))) + (?- . ,(regexp-opt '("--" "---" "-->" "--->" "->-" "-<" "-<-" "-<<" "->" "->>" "-}" "-~" "-:" "-|"))) + (?. . ,(regexp-opt '(".-" ".." "..." "..<" ".=" ".>"))) (?/ . ,(regexp-opt '("/*" "/**" "//" "///" "/=" "/==" "/>"))) - (?: . ,(regexp-opt '(":" "::" ":::" ":=" ":<" ":=" ":>"))) + (?: . ,(regexp-opt '(":" "::" ":::" ":=" ":<" ":=" ":>" ":+"))) (?0 . "0\\(?:\\(x[a-fA-F0-9]\\).?\\)") ; Tries to match the x in 0xDEADBEEF ;; (?x . ,(regexp-opt '("x"))) ; Also tries to match the x in 0xDEADBEEF (?\; . ,(regexp-opt '(";;"))) - (?< . ,(regexp-opt '("" "<--->" "" "<<" "<<-" "<<<" "<<=" "<=" "<=<" "<==" "<=>" "<===>" "<>" "<|" "<|>" "<~" "<~~" "<." "<.>" "<..>"))) (?= . ,(regexp-opt '("=/=" "=:=" "=<<" "==" "===" "==>" "=>" "=>>"))) (?> . ,(regexp-opt '(">-" ">->" ">:" ">=" ">=>" ">>" ">>-" ">>=" ">>>"))) (?? . ,(regexp-opt '("??" "?." "?:" "?="))) @@ -75,8 +75,9 @@ besides what is listed.") (?^ . ,(regexp-opt '("^=" "^=="))) (?w . ,(regexp-opt '("www" "wwww"))) (?{ . ,(regexp-opt '("{-" "{|" "{||" "{|}" "{||}"))) - (?| . ,(regexp-opt '("|=" "|>" "||" "||=" "|->" "|=>" "|]" "|}"))) + (?| . ,(regexp-opt '("|=" "|>" "||" "||=" "|->" "|=>" "|]" "|}" "|-"))) (?_ . ,(regexp-opt '("_|_" "__"))) + (?\( . ,(regexp-opt '("(*"))) (?~ . ,(regexp-opt '("~-" "~=" "~>" "~@" "~~" "~~>"))))) "An alist of all ligatures used by `+prog-ligatures-modes'. From bc0477c3ba5b00ecc2c503b7116462e43a532615 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 May 2020 13:53:54 -0400 Subject: [PATCH 013/105] Optimize +prog-ligatures-alist But preserve regexp-opt forms for users who want to contribute. --- modules/ui/pretty-code/config.el | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/ui/pretty-code/config.el b/modules/ui/pretty-code/config.el index c7aa9836c..bcd69562a 100644 --- a/modules/ui/pretty-code/config.el +++ b/modules/ui/pretty-code/config.el @@ -51,34 +51,34 @@ besides what is listed.") ;;; Automatic font-specific ligatures (defvar +prog-ligatures-alist - (eval-when-compile - `((?! . ,(regexp-opt '("!!" "!=" "!=="))) - (?# . ,(regexp-opt '("##" "###" "####" "#(" "#:" "#=" "#?" "#[" "#_" "#_(" "#{"))) - (?$ . ,(regexp-opt '("$>" "$>>"))) - (?% . ,(regexp-opt '("%%" "%%%"))) - (?& . ,(regexp-opt '("&&" "&&&"))) - (?* . ,(regexp-opt '("*" "**" "***" "**/" "*/" "*>" "*)"))) - (?+ . ,(regexp-opt '("+" "++" "+++" "+>" "+:"))) - (?- . ,(regexp-opt '("--" "---" "-->" "--->" "->-" "-<" "-<-" "-<<" "->" "->>" "-}" "-~" "-:" "-|"))) - (?. . ,(regexp-opt '(".-" ".." "..." "..<" ".=" ".>"))) - (?/ . ,(regexp-opt '("/*" "/**" "//" "///" "/=" "/==" "/>"))) - (?: . ,(regexp-opt '(":" "::" ":::" ":=" ":<" ":=" ":>" ":+"))) - (?0 . "0\\(?:\\(x[a-fA-F0-9]\\).?\\)") ; Tries to match the x in 0xDEADBEEF - ;; (?x . ,(regexp-opt '("x"))) ; Also tries to match the x in 0xDEADBEEF - (?\; . ,(regexp-opt '(";;"))) - (?< . ,(regexp-opt '("" "<--->" "" "<<" "<<-" "<<<" "<<=" "<=" "<=<" "<==" "<=>" "<===>" "<>" "<|" "<|>" "<~" "<~~" "<." "<.>" "<..>"))) - (?= . ,(regexp-opt '("=/=" "=:=" "=<<" "==" "===" "==>" "=>" "=>>"))) - (?> . ,(regexp-opt '(">-" ">->" ">:" ">=" ">=>" ">>" ">>-" ">>=" ">>>"))) - (?? . ,(regexp-opt '("??" "?." "?:" "?="))) - (?\[ . ,(regexp-opt '("[]" "[|]" "[|"))) - (?\\ . ,(regexp-opt '("\\\\" "\\\\\\" "\\\\n"))) - (?^ . ,(regexp-opt '("^=" "^=="))) - (?w . ,(regexp-opt '("www" "wwww"))) - (?{ . ,(regexp-opt '("{-" "{|" "{||" "{|}" "{||}"))) - (?| . ,(regexp-opt '("|=" "|>" "||" "||=" "|->" "|=>" "|]" "|}" "|-"))) - (?_ . ,(regexp-opt '("_|_" "__"))) - (?\( . ,(regexp-opt '("(*"))) - (?~ . ,(regexp-opt '("~-" "~=" "~>" "~@" "~~" "~~>"))))) + '((?! . "\\(?:!\\(?:==\\|[!=]\\)\\)") ; (regexp-opt '("!!" "!=" "!==")) + (?# . "\\(?:#\\(?:###?\\|_(\\|[#(:=?[_{]\\)\\)") ; (regexp-opt '("##" "###" "####" "#(" "#:" "#=" "#?" "#[" "#_" "#_(" "#{")) + (?$ . "\\(?:\\$>>?\\)") ; (regexp-opt '("$>" "$>>")) + (?% . "\\(?:%%%?\\)") ; (regexp-opt '("%%" "%%%")) + (?& . "\\(?:&&&?\\)") ; (regexp-opt '("&&" "&&&")) + (?* . "\\(?:\\*\\(?:\\*[*/]\\|[)*/>]\\)?\\)") ; (regexp-opt '("*" "**" "***" "**/" "*/" "*>" "*)")) + (?+ . "\\(?:\\+\\(?:\\+\\+\\|[+:>]\\)?\\)") ; (regexp-opt '("+" "++" "+++" "+>" "+:")) + (?- . "\\(?:-\\(?:-\\(?:->\\|[>-]\\)\\|<[<-]\\|>[>-]\\|[:<>|}~-]\\)\\)") ; (regexp-opt '("--" "---" "-->" "--->" "->-" "-<" "-<-" "-<<" "->" "->>" "-}" "-~" "-:" "-|")) + (?. . "\\(?:\\.\\(?:\\.[.<]\\|[.=>-]\\)\\)") ; (regexp-opt '(".-" ".." "..." "..<" ".=" ".>")) + (?/ . "\\(?:/\\(?:\\*\\*\\|//\\|==\\|[*/=>]\\)\\)") ; (regexp-opt '("/*" "/**" "//" "///" "/=" "/==" "/>")) + (?: . "\\(?::\\(?:::\\|[+:<=>]\\)?\\)") ; (regexp-opt '(":" "::" ":::" ":=" ":<" ":=" ":>" ":+")) + (?\; . ";;") ; (regexp-opt '(";;")) + (?0 . "0\\(?:\\(x[a-fA-F0-9]\\).?\\)") ; Tries to match the x in 0xDEADBEEF + ;; (?x . "x") ; Also tries to match the x in 0xDEADBEEF + ;; (regexp-opt '("" "<--->" "" "<<" "<<-" "<<<" "<<=" "<=" "<=<" "<==" "<=>" "<===>" "<>" "<|" "<|>" "<~" "<~~" "<." "<.>" "<..>")) + (?< . "\\(?:<\\(?:!--\\|\\$>\\|\\*\\(?:\\*?>\\)\\|\\+>\\|-\\(?:-\\(?:->\\|[>-]\\)\\|[>-]\\)\\|\\.\\(?:\\.?>\\)\\|/>\\|<[<=-]\\|=\\(?:==>\\|[<=>]\\)\\||>\\|~~\\|[$*+./<=>|~-]\\)\\)") + (?= . "\\(?:=\\(?:/=\\|:=\\|<<\\|=[=>]\\|>>\\|[=>]\\)\\)") ; (regexp-opt '("=/=" "=:=" "=<<" "==" "===" "==>" "=>" "=>>")) + (?> . "\\(?:>\\(?:->\\|=>\\|>[=>-]\\|[:=>-]\\)\\)") ; (regexp-opt '(">-" ">->" ">:" ">=" ">=>" ">>" ">>-" ">>=" ">>>")) + (?? . "\\(?:\\?[.:=?]\\)") ; (regexp-opt '("??" "?." "?:" "?=")) + (?\[ . "\\(?:\\[\\(?:|]\\|[]|]\\)\\)") ; (regexp-opt '("[]" "[|]" "[|")) + (?\\ . "\\(?:\\\\\\\\[\\n]?\\)") ; (regexp-opt '("\\\\" "\\\\\\" "\\\\n")) + (?^ . "\\(?:\\^==?\\)") ; (regexp-opt '("^=" "^==")) + (?w . "\\(?:wwww?\\)") ; (regexp-opt '("www" "wwww")) + (?{ . "\\(?:{\\(?:|\\(?:|}\\|[|}]\\)\\|[|-]\\)\\)") ; (regexp-opt '("{-" "{|" "{||" "{|}" "{||}")) + (?| . "\\(?:|\\(?:->\\|=>\\||=\\|[]=>|}-]\\)\\)") ; (regexp-opt '("|=" "|>" "||" "||=" "|->" "|=>" "|]" "|}" "|-")) + (?_ . "\\(?:_\\(?:|?_\\)\\)") ; (regexp-opt '("_|_" "__")) + (?\( . "\\(?:(\\*\\)") ; (regexp-opt '("(*")) + (?~ . "\\(?:~\\(?:~>\\|[=>@~-]\\)\\)")) ; (regexp-opt '("~-" "~=" "~>" "~@" "~~" "~~>")) "An alist of all ligatures used by `+prog-ligatures-modes'. The car is the character ASCII number, cdr is a regex which will call From da2247e3d69823d0f100c9a35dd90f36f685c185 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 May 2020 15:14:16 -0400 Subject: [PATCH 014/105] Remove redundant +default/lsp-format-region-or-buffer command --- modules/config/default/autoload/default.el | 11 ----------- modules/editor/format/autoload/format.el | 4 +++- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/modules/config/default/autoload/default.el b/modules/config/default/autoload/default.el index 10837d9a9..59cee2edf 100644 --- a/modules/config/default/autoload/default.el +++ b/modules/config/default/autoload/default.el @@ -36,17 +36,6 @@ If ARG (universal argument), runs `compile' from the current directory." (with-current-buffer buffer (funcall (default-value 'major-mode)))))) -;;;###autoload -(defun +default/lsp-format-region-or-buffer () - "Format the buffer (or selection) with LSP." - (interactive) - (unless (bound-and-true-p lsp-mode) - (user-error "Not in an LSP buffer")) - (call-interactively - (if (doom-region-active-p) - #'lsp-format-region - #'lsp-format-buffer))) - ;;;###autoload (defun +default/restart-server () "Restart the Emacs server." diff --git a/modules/editor/format/autoload/format.el b/modules/editor/format/autoload/format.el index 40ca96f73..9229c5a1c 100644 --- a/modules/editor/format/autoload/format.el +++ b/modules/editor/format/autoload/format.el @@ -220,7 +220,9 @@ is selected)." (interactive) (call-interactively (if (bound-and-true-p lsp-mode) - #'+default/lsp-format-region-or-buffer + (if (doom-region-active-p) + #'lsp-format-region + #'lsp-format-buffer) (if (use-region-p) #'+format/region #'+format/buffer)))) From 7dbf51f11cbc8990a7328d24bf519907a84372e8 Mon Sep 17 00:00:00 2001 From: amatrelan Date: Wed, 6 May 2020 22:14:38 +0300 Subject: [PATCH 015/105] Move nixfmt note and Keybindings to correct place --- modules/lang/nix/README.org | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/lang/nix/README.org b/modules/lang/nix/README.org index ef3e702d5..64f3d1ef3 100644 --- a/modules/lang/nix/README.org +++ b/modules/lang/nix/README.org @@ -10,6 +10,7 @@ - [[#plugins][Plugins]] - [[#prerequisites][Prerequisites]] - [[#features][Features]] + - [[#keybindings][Keybindings]] - [[#configuration][Configuration]] - [[#troubleshooting][Troubleshooting]] @@ -32,15 +33,14 @@ This module provides no flags. + [[https://github.com/jwiegley/nix-update-el][nix-update]] * Prerequisites - -* Features + ~nixfmt~ is required to use formatting + If you have Nix(OS) installed it can be installed through Nix configuration ~environment.systemPackages = with pkgs; [ nixfmt ];~ (recommended) + Or through nix-env ~nix-env -iA nixpkgs.nixfmt~ + Or through nix-shell ~nix-shell -f https://github.com/serokell/nixfmt/archive/master.tar.gz -i~ + ~:editor format~ ~format-all~ also supports ~nixfmt~ so you can use that also to format Nix code, default binding is ~SPC c f~ in evil. -* Configuration +* Features +** Keybindings | Binding | Description | |-------------------+----------------------| | ~ b~ | ~nix-build~ | @@ -51,5 +51,7 @@ This module provides no flags. | ~ s~ | ~nix-repl-shell~ | | ~ u~ | ~nix-unpack~ | +* Configuration + * Troubleshooting + There aren't any known problems. From 200ab5b9afc5cfe4ea83e5cbac4e444fd189f077 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 May 2020 16:29:32 -0400 Subject: [PATCH 016/105] Fix #3054: format with lsp only if server is capable And fall back to format-all otherwise. --- modules/editor/format/autoload/format.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/editor/format/autoload/format.el b/modules/editor/format/autoload/format.el index 9229c5a1c..bbc701ff0 100644 --- a/modules/editor/format/autoload/format.el +++ b/modules/editor/format/autoload/format.el @@ -219,13 +219,15 @@ snippets or single lines." is selected)." (interactive) (call-interactively - (if (bound-and-true-p lsp-mode) - (if (doom-region-active-p) + (if (doom-region-active-p) + (if (and (bound-and-true-p lsp-mode) + (lsp-feature? "textDocument/rangeFormatting")) #'lsp-format-region - #'lsp-format-buffer) - (if (use-region-p) - #'+format/region - #'+format/buffer)))) + #'+format/region) + (if (and (bound-and-true-p lsp-mode) + (lsp-feature? "textDocument/formatting")) + #'lsp-format-buffer + #'+format/buffer))) ;; From 9a628c7a124d05b5a177a80aaebcfc7c779af72d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 May 2020 16:43:42 -0400 Subject: [PATCH 017/105] Fix missing paren in +format/region-or-buffer #3054 Because I'm a derp --- modules/editor/format/autoload/format.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/editor/format/autoload/format.el b/modules/editor/format/autoload/format.el index bbc701ff0..3954cc652 100644 --- a/modules/editor/format/autoload/format.el +++ b/modules/editor/format/autoload/format.el @@ -227,7 +227,7 @@ is selected)." (if (and (bound-and-true-p lsp-mode) (lsp-feature? "textDocument/formatting")) #'lsp-format-buffer - #'+format/buffer))) + #'+format/buffer)))) ;; From b8e85a42c7a267891aec37ac893162d22799eb5a Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Thu, 7 May 2020 08:28:12 +0900 Subject: [PATCH 018/105] Remove .yas-setup.el for java-mode --- .../file-templates/templates/java-mode/.yas-setup.el | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 modules/editor/file-templates/templates/java-mode/.yas-setup.el diff --git a/modules/editor/file-templates/templates/java-mode/.yas-setup.el b/modules/editor/file-templates/templates/java-mode/.yas-setup.el deleted file mode 100644 index b00feed7e..000000000 --- a/modules/editor/file-templates/templates/java-mode/.yas-setup.el +++ /dev/null @@ -1,9 +0,0 @@ -(defun yas-java-project-package () - (or (and (eq major-mode 'java-mode) - (+java-current-package)) - "")) - -(defun yas-java-class-name () - (or (and (eq major-mode 'java-mode) - (+java-current-class)) - "")) From 1d0c79d63c71514f2f16b6ffe26c1a719625e90f Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Thu, 7 May 2020 09:06:36 +0900 Subject: [PATCH 019/105] Fix Dash docsets + Xwidget integration Make Xwidget popup rules and advices less general. fix --- modules/tools/lookup/config.el | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index 25f310e3b..3d1a48cde 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -96,6 +96,8 @@ Used by `+lookup/dictionary-definition' and `+lookup/synonyms'. For `+lookup/dictionary-definition', this is ignored on Mac, where Emacs users Dictionary.app behind the scenes to get definitions.") +(defvar +lookup--dash-docs-xwidget-webkit-last-session-buffer nil) + ;; ;;; dumb-jump @@ -179,24 +181,21 @@ See https://github.com/magit/ghub/issues/81" (funcall orig-fn url))) ;; Dash docset + Xwidget integration - (when (and (featurep! :tools lookup +xwidget) (display-graphic-p)) - (setq dash-docs-browser-func #'xwidget-webkit-browse-url) - - (set-popup-rule! "^\\*xwidget" :vslot -11 :size 0.35 :select nil) - - (defun +xwidget--webkit-goto-url-a (&rest _) - (pop-to-buffer xwidget-webkit-last-session-buffer)) - (advice-add #'xwidget-webkit-goto-url :after #'+xwidget--webkit-goto-url-a) - - (defun +xwidget--webkit-new-session-a (orig-fun &rest args) + (when (and (featurep! +xwidget) (display-graphic-p)) + (defun +lookup/dash-docs-xwidget-webkit-browse-url (url &optional new-session) + (setq xwidget-webkit-last-session-buffer +lookup--dash-docs-xwidget-webkit-last-session-buffer) (save-window-excursion - (apply orig-fun args)) - (pop-to-buffer xwidget-webkit-last-session-buffer)) - (advice-add #'xwidget-webkit-new-session :around #'+xwidget--webkit-new-session-a) + (xwidget-webkit-browse-url url new-session)) + (with-popup-rules! + '((set-popup-rule! "^\\*xwidget" :vslot -11 :size 0.35 :select nil)) + (pop-to-buffer xwidget-webkit-last-session-buffer)) + (setq +lookup--dash-docs-xwidget-webkit-last-session-buffer xwidget-webkit-last-session-buffer + xwidget-webkit-last-session-buffer nil)) + (setq dash-docs-browser-func #'+lookup/dash-docs-xwidget-webkit-browse-url)) - (when (featurep! :editor evil +everywhere) - (add-transient-hook! 'xwidget-webkit-mode-hook - (+evil-collection-init 'xwidget)))) + (when (featurep! :editor evil +everywhere) + (add-transient-hook! 'xwidget-webkit-mode-hook + (+evil-collection-init 'xwidget))) (cond ((featurep! :completion helm) (require 'helm-dash nil t)) From 051ea0a6027015b474e0078a2f5e3f5a97547ab2 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Thu, 7 May 2020 09:08:42 +0900 Subject: [PATCH 020/105] Remove redundant +evil-collection-init for Xwidget --- modules/tools/lookup/config.el | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index 3d1a48cde..c050b8309 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -193,10 +193,6 @@ See https://github.com/magit/ghub/issues/81" xwidget-webkit-last-session-buffer nil)) (setq dash-docs-browser-func #'+lookup/dash-docs-xwidget-webkit-browse-url)) - (when (featurep! :editor evil +everywhere) - (add-transient-hook! 'xwidget-webkit-mode-hook - (+evil-collection-init 'xwidget))) - (cond ((featurep! :completion helm) (require 'helm-dash nil t)) ((featurep! :completion ivy) From 6f8c501ce4ec32132426a5f09fdd95726c111f91 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Thu, 7 May 2020 09:19:41 +0900 Subject: [PATCH 021/105] Improve Emacs graphical mode checking --- modules/tools/lookup/config.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index c050b8309..110355317 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -181,16 +181,18 @@ See https://github.com/magit/ghub/issues/81" (funcall orig-fn url))) ;; Dash docset + Xwidget integration - (when (and (featurep! +xwidget) (display-graphic-p)) + (when (featurep! +xwidget) (defun +lookup/dash-docs-xwidget-webkit-browse-url (url &optional new-session) - (setq xwidget-webkit-last-session-buffer +lookup--dash-docs-xwidget-webkit-last-session-buffer) - (save-window-excursion - (xwidget-webkit-browse-url url new-session)) - (with-popup-rules! - '((set-popup-rule! "^\\*xwidget" :vslot -11 :size 0.35 :select nil)) - (pop-to-buffer xwidget-webkit-last-session-buffer)) - (setq +lookup--dash-docs-xwidget-webkit-last-session-buffer xwidget-webkit-last-session-buffer - xwidget-webkit-last-session-buffer nil)) + (if (not (display-graphic-p)) + (eww url new-session) + (setq xwidget-webkit-last-session-buffer +lookup--dash-docs-xwidget-webkit-last-session-buffer) + (save-window-excursion + (xwidget-webkit-browse-url url new-session)) + (with-popup-rules! + '((set-popup-rule! "^\\*xwidget" :vslot -11 :size 0.35 :select nil)) + (pop-to-buffer xwidget-webkit-last-session-buffer)) + (setq +lookup--dash-docs-xwidget-webkit-last-session-buffer xwidget-webkit-last-session-buffer + xwidget-webkit-last-session-buffer nil))) (setq dash-docs-browser-func #'+lookup/dash-docs-xwidget-webkit-browse-url)) (cond ((featurep! :completion helm) From a80ae71b05c6c8833f0668caa0cfd45a5d9b9dbb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 May 2020 21:01:04 -0400 Subject: [PATCH 022/105] Append elisp variable's value to eldoc --- modules/lang/emacs-lisp/config.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index 6f80d6cfd..b3748b337 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -84,6 +84,24 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.") ;; Recenter window after following definition (advice-add #'elisp-def :after #'doom-recenter-a) + (defadvice! +emacs-lisp-append-value-to-eldoc-a (orig-fn sym) + "Display variable value next to documentation in eldoc." + :around #'elisp-get-var-docstring + (when-let (ret (funcall orig-fn sym)) + (concat ret " " + (let* ((truncated " [...]") + (limit (- (frame-width) (length ret) (length truncated) 1)) + (str (symbol-value sym)) + (str (prin1-to-string + (if (stringp str) + (replace-regexp-in-string "\n" " " str) + str))) + (str-length (length str)) + (short (< str-length limit))) + (concat (substring (propertize str 'face 'warning) + 0 (if short str-length limit)) + (unless short truncated)))))) + (map! :localleader :map emacs-lisp-mode-map :desc "Expand macro" "m" #'macrostep-expand From 333bdd44c0c6bae3d9f8fe13590ffe1eb241eb21 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 7 May 2020 00:23:29 -0400 Subject: [PATCH 023/105] Fix "no year zero" error when starting org-journal --- modules/lang/org/contrib/journal.el | 93 +++++++++++++---------------- 1 file changed, 42 insertions(+), 51 deletions(-) diff --git a/modules/lang/org/contrib/journal.el b/modules/lang/org/contrib/journal.el index b2b551e16..d14c26f99 100644 --- a/modules/lang/org/contrib/journal.el +++ b/modules/lang/org/contrib/journal.el @@ -2,66 +2,57 @@ ;;;###if (featurep! +journal) (use-package! org-journal - :hook (org-mode . +org-journal-mode-maybe) - :init - ;; HACK org-journal does some file-path magic at load time that creates - ;; duplicate and hard-coded `auto-mode-alist' entries, so we suppress it - ;; and use the more generalize regexp (above). - (advice-add #'org-journal-update-auto-mode-alist :override #'ignore) - ;; Not using the .org file extension causes so much needless headache with - ;; file detection, and for no compelling reason, so we make it the default, so - ;; `org-journal' doesn't have to do all this silly magic. - (setq org-journal-file-format "%Y%m%d.org") + :hook (org-load . org-journal-update-auto-mode-alist) + ;; This is necessary if the user decides opens a journal file directly, via + ;; `find-file' or something, and not through org-journal's commands. + :mode ("/[0-9]\\{8\\}\\.org\\(?:\\.gpg\\)?\\'" . org-journal-mode) + :preface + ;; Not using the .org file extension causes needless headache with file + ;; detection for no compelling reason, so we make it the default, so + ;; `org-journal' doesn't have to do all its `auto-mode-alist' magic. + (defvar org-journal-file-format "%Y%m%d.org") - ;; HACK `org-journal-dir' has is surrounded by setter and `auto-mode-alist' - ;; magic which makes its needlessly difficult to create an "overrideable" - ;; default for Doom users, so we set this to an empty string (a - ;; non-string would throw an error) so we can detect changes to it later. - (setq org-journal-dir "" + ;; HACK `org-journal-dir' is surrounded with setters and `auto-mode-alist' + ;; magic which makes it difficult to create an better default for Doom + ;; users. We set this here so we can detect user-changes to it later. + (setq org-journal-dir "journal/" org-journal-cache-file (concat doom-cache-dir "org-journal") ;; Doom opts for an "open in a popup or here" strategy as a default. - ;; Open in "other window" is less consistent and harder to predict. + ;; Open in "other window" is less predictable, and can replace a window + ;; we wanted to keep visible. org-journal-find-file #'find-file) :config - ;; This is necessary if the user decides opens a journal file directly, via - ;; `find-file' or something, and not through org-journal's commands. - (defun +org-journal-mode-maybe () - "Activate `org-journal-mode', maybe." - (and (eq major-mode 'org-mode) - (stringp buffer-file-name) - (stringp org-journal-file-pattern) - (string-match-p org-journal-file-pattern buffer-file-name) - (let ((org-mode-hook (remq '+org-journal-mode-maybe org-mode-hook))) - (org-journal-mode)))) - - (when (string-empty-p org-journal-dir) - (setq org-journal-dir (expand-file-name "journal/" org-directory))) - - (advice-remove #'org-journal-update-auto-mode-alist #'ignore) - (setq! org-journal-dir org-journal-dir) + (when (or (equal org-journal-dir "journal/") + (not (equal org-journal-file-format "%Y%m%d.org"))) + ;; HACK `org-journal' does some file-path magic at load time that creates + ;; several, duplicate and hard-coded `auto-mode-alist' entries, so get + ;; rid of them all here so we can create a one-true-entry right after. + (setq auto-mode-alist (rassq-delete-all 'org-journal-mode auto-mode-alist)) + ;; ...By exploiting `org-journal-dir''s setter + (setq! org-journal-dir (expand-file-name org-journal-dir org-directory))) (map! (:map org-journal-mode-map - :n "]f" #'org-journal-open-next-entry - :n "[f" #'org-journal-open-previous-entry - :n "C-n" #'org-journal-open-next-entry - :n "C-p" #'org-journal-open-previous-entry) + :n "]f" #'org-journal-open-next-entry + :n "[f" #'org-journal-open-previous-entry + :n "C-n" #'org-journal-open-next-entry + :n "C-p" #'org-journal-open-previous-entry) (:map org-journal-search-mode-map - "C-n" #'org-journal-search-next - "C-p" #'org-journal-search-previous) + "C-n" #'org-journal-search-next + "C-p" #'org-journal-search-previous) :localleader (:map org-journal-mode-map - "c" #'org-journal-new-entry - "d" #'org-journal-new-date-entry - "n" #'org-journal-open-next-entry - "p" #'org-journal-open-previous-entry - (:prefix "s" - "s" #'org-journal-search - "f" #'org-journal-search-forever - "F" #'org-journal-search-future - "w" #'org-journal-search-calendar-week - "m" #'org-journal-search-calendar-month - "y" #'org-journal-search-calendar-year)) + "c" #'org-journal-new-entry + "d" #'org-journal-new-date-entry + "n" #'org-journal-open-next-entry + "p" #'org-journal-open-previous-entry + (:prefix "s" + "s" #'org-journal-search + "f" #'org-journal-search-forever + "F" #'org-journal-search-future + "w" #'org-journal-search-calendar-week + "m" #'org-journal-search-calendar-month + "y" #'org-journal-search-calendar-year)) (:map org-journal-search-mode-map - "n" #'org-journal-search-next - "p" #'org-journal-search-prev))) + "n" #'org-journal-search-next + "p" #'org-journal-search-prev))) From 5b23b3d4863eb0ec65c284f022ba5a7df7a69f3e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 7 May 2020 00:23:46 -0400 Subject: [PATCH 024/105] Add popup rule for org-journal search commands --- modules/lang/org/contrib/journal.el | 2 ++ modules/ui/popup/+hacks.el | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/modules/lang/org/contrib/journal.el b/modules/lang/org/contrib/journal.el index d14c26f99..1df1dde1e 100644 --- a/modules/lang/org/contrib/journal.el +++ b/modules/lang/org/contrib/journal.el @@ -32,6 +32,8 @@ ;; ...By exploiting `org-journal-dir''s setter (setq! org-journal-dir (expand-file-name org-journal-dir org-directory))) + (set-popup-rule! "^\\*Org-journal search" :select t :quit t) + (map! (:map org-journal-mode-map :n "]f" #'org-journal-open-next-entry :n "[f" #'org-journal-open-previous-entry diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index 7cc0573c7..b9af549fd 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -281,6 +281,13 @@ Ugh, such an ugly hack." (apply orig-fn args)))) +;;;###package org-journal +(defadvice! +popup--use-popup-window-a (orig-fn &rest args) + :around #'org-journal-search-by-string + (letf! ((#'switch-to-buffer #'pop-to-buffer)) + (apply orig-fn args))) + + ;;;###package persp-mode (defadvice! +popup--persp-mode-restore-popups-a (&rest _) "Restore popup windows when loading a perspective from file." From 994028b1e970115d4f2dfe194aaa4804013a9817 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 7 May 2020 00:54:41 -0400 Subject: [PATCH 025/105] Fix #3056: image previews for attachment links --- modules/lang/org/config.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 0778284ab..da6195922 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -374,7 +374,10 @@ underlying, modified buffer. This fixes that." (unless org-attach-id-dir (setq org-attach-id-dir (expand-file-name ".attach/" org-directory))) (after! projectile - (add-to-list 'projectile-globally-ignored-directories org-attach-id-dir)))) + (add-to-list 'projectile-globally-ignored-directories org-attach-id-dir))) + + ;; Add inline image previews for attachment links + (org-link-set-parameters "attachment" :image-data-fun #'+org-inline-image-data-fn)) (defun +org-init-custom-links-h () From 9e9f4a255930a863031a5c97aa54dca7a1b15524 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 7 May 2020 01:15:58 -0400 Subject: [PATCH 026/105] Bump :lang org abo-abo/org-download@48d3952 -> abo-abo/org-download@d248fcb emacs-straight/org-mode@e5eda0b -> emacs-straight/org-mode@b171ff0 jethrokuan/org-roam@e698ed7 -> jethrokuan/org-roam@689f559 --- modules/lang/org/packages.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/lang/org/packages.el b/modules/lang/org/packages.el index 64b725ff6..62af344b5 100644 --- a/modules/lang/org/packages.el +++ b/modules/lang/org/packages.el @@ -27,7 +27,7 @@ :recipe (:host github :repo "emacs-straight/org-mode" :files ("*.el" "lisp/*.el" "contrib/lisp/*.el")) - :pin "e5eda0beeb3b6b0666550091bcc0df066d52c008") + :pin "b171ff02f6e69bcce0dec56ea23e11c75e558704") ;; ...And prevent other packages from pulling org; org-plus-contrib satisfies ;; the dependency already: https://github.com/raxod502/straight.el/issues/352 (package! org :recipe (:local-repo nil)) @@ -53,7 +53,7 @@ (when (featurep! +brain) (package! org-brain :pin "ae7fe0f628bd093526786ece6917f7a4310e5e4d")) (when (featurep! +dragndrop) - (package! org-download :pin "48d3952ad8ebc5ef5a6a77b8c6a4a0da61653036")) + (package! org-download :pin "d248fcb8f2592a40507682e91eed9a31ead4e4a6")) (when (featurep! +gnuplot) (package! gnuplot :pin "f0001c30010b2899e36d7d89046322467e923088") (package! gnuplot-mode :pin "601f6392986f0cba332c87678d31ae0d0a496ce7")) @@ -74,7 +74,7 @@ (package! org-tree-slide :pin "7bf09a02bd2d8f1ccfcb5209bfb18fbe02d1f44e") (package! org-re-reveal :pin "61549f4c00284a30e34caa3d76001b233ea5d2ad")) (when (featurep! +roam) - (package! org-roam :pin "e698ed7f5378106da8a8fec4537658392157657c") + (package! org-roam :pin "689f55908048eede3cb65aa30ab990be3ac93263") (when (featurep! :completion company) (package! company-org-roam :pin "0913d86f167164e18831206e611f44bb8e7297e3"))) From 315ce7974b4f26fe4afb989eb206cefe53bf8407 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 7 May 2020 03:15:56 -0400 Subject: [PATCH 027/105] Bump :term vterm akermu/emacs-libvterm@e63bd65 -> akermu/emacs-libvterm@8f00dc9 --- modules/term/vterm/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/term/vterm/packages.el b/modules/term/vterm/packages.el index e048a3b01..9476d222f 100644 --- a/modules/term/vterm/packages.el +++ b/modules/term/vterm/packages.el @@ -3,4 +3,4 @@ (package! vterm :built-in 'prefer - :pin "e63bd65eece7c5de3a534b7e2fdbe58256ec2da0") + :pin "8f00dc90abbdb101b94bf63f9b1cb0ac9a147f40") From fd2ba11e57165bb062dc749c84537662acee3e6b Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Fri, 8 May 2020 03:13:01 +0300 Subject: [PATCH 028/105] add README for tools/rgb --- modules/tools/rgb/README.org | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 modules/tools/rgb/README.org diff --git a/modules/tools/rgb/README.org b/modules/tools/rgb/README.org new file mode 100644 index 000000000..541ef2a40 --- /dev/null +++ b/modules/tools/rgb/README.org @@ -0,0 +1,54 @@ +#+TITLE: tools/rgb +#+DATE: May 6, 2020 +#+SINCE: 3.0.0 +#+STARTUP: inlineimages nofold + +* Table of Contents :TOC_3:noexport: +- [[#description][Description]] + - [[#maintainers][Maintainers]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] +- [[#prerequisites][Prerequisites]] +- [[#features][Features]] +- [[#configuration][Configuration]] + +* Description +Highlights color hex values and names with the color itself, and provides tools +to easily modify color values or formats. + +** Maintainers +This module has no dedicated maintainers. + +** Module Flags +This module provides no flags. + +** Plugins +# A list of linked plugins ++ [[https://elpa.gnu.org/packages/rainbow-mode.html][rainbow-mode]] ++ [[https://github.com/alphapapa/kurecolor][kurecolor]] + +* Prerequisites +This module has no prerequisites. + +* Features +# An in-depth list of features, how to use them, and their dependencies. +=rainbow-mode= provides automatic highlighting to hex color codes, and in +relevant modes, color names (e.g. html color names in =css-mode= or LaTeX color +names in =latex-mode=) + +=kurecolor= provides commands to easily change the brightness, saturation, and +hue of hex colors (and a useful hydra for this, if =:ui hydra= is enabled), as +well as conversion between hex and css colors + +* Configuration +# How to configure this module, including common problems and how to address them. +=hl-line-mode= overrides the color highlighting of =rainbow-mode=, which limits +the use of that plugin and on site color changes using =kurecolor=. To +automatically disable it only when =rainbow-mode= is active, you can add the +following hook: + +#+BEGIN_SRC elisp +;; ~/.doom.d/config.el +(add-hook! 'rainbow-mode-hook + (hl-line-mode (if rainbow-mode -1 +1))) +#+END_SRC From e5d8740efb54f596e3ec4e1807e1497525a2a982 Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Fri, 8 May 2020 03:13:11 +0300 Subject: [PATCH 029/105] minor typo fix --- modules/lang/kotlin/README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/kotlin/README.org b/modules/lang/kotlin/README.org index 00f53296c..00cce96db 100644 --- a/modules/lang/kotlin/README.org +++ b/modules/lang/kotlin/README.org @@ -1,5 +1,5 @@ #+TITLE: lang/kotlin -#+DATE: March 28, @019 +#+DATE: March 28, 2019 #+SINCE: v3.0.0 #+STARTUP: inlineimages From 622e1ea06b0bb695893998387b31e3d059785a29 Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Fri, 8 May 2020 09:59:15 +0900 Subject: [PATCH 030/105] Minor refactoring --- modules/tools/lookup/config.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index 110355317..8f392cd76 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -182,7 +182,7 @@ See https://github.com/magit/ghub/issues/81" ;; Dash docset + Xwidget integration (when (featurep! +xwidget) - (defun +lookup/dash-docs-xwidget-webkit-browse-url (url &optional new-session) + (defun +lookup-dash-docs-xwidget-webkit-browse-url-fn (url &optional new-session) (if (not (display-graphic-p)) (eww url new-session) (setq xwidget-webkit-last-session-buffer +lookup--dash-docs-xwidget-webkit-last-session-buffer) @@ -193,7 +193,7 @@ See https://github.com/magit/ghub/issues/81" (pop-to-buffer xwidget-webkit-last-session-buffer)) (setq +lookup--dash-docs-xwidget-webkit-last-session-buffer xwidget-webkit-last-session-buffer xwidget-webkit-last-session-buffer nil))) - (setq dash-docs-browser-func #'+lookup/dash-docs-xwidget-webkit-browse-url)) + (setq dash-docs-browser-func #'+lookup-dash-docs-xwidget-webkit-browse-url-fn)) (cond ((featurep! :completion helm) (require 'helm-dash nil t)) From 47571446b97c2be589f19c000ee93e1bc7a9d377 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 7 May 2020 15:59:26 -0400 Subject: [PATCH 031/105] Use org-download-dnd instead of inhouse dnd handler Possibly fixes #3056 --- modules/lang/org/autoload/contrib-dragndrop.el | 12 ------------ modules/lang/org/contrib/dragndrop.el | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 modules/lang/org/autoload/contrib-dragndrop.el diff --git a/modules/lang/org/autoload/contrib-dragndrop.el b/modules/lang/org/autoload/contrib-dragndrop.el deleted file mode 100644 index 618790cee..000000000 --- a/modules/lang/org/autoload/contrib-dragndrop.el +++ /dev/null @@ -1,12 +0,0 @@ -;;; lang/org/autoload/contrib-dragndrop.el -*- lexical-binding: t; -*- -;;;###if (featurep! +dragndrop) - -;;;###autoload -(defun +org-dragndrop-download-dnd-fn (uri action) - "Handle file links and base64 data uris." - (if (eq major-mode 'org-mode) - (+org/attach-file-and-insert-link uri) - (let ((dnd-protocol-alist - (rassq-delete-all '+org-dragndrop-download-dnd-fn - (copy-alist dnd-protocol-alist)))) - (dnd-handle-one-url nil action uri)))) diff --git a/modules/lang/org/contrib/dragndrop.el b/modules/lang/org/contrib/dragndrop.el index 8d7b54699..7b932ede1 100644 --- a/modules/lang/org/contrib/dragndrop.el +++ b/modules/lang/org/contrib/dragndrop.el @@ -10,7 +10,7 @@ :init ;; HACK We add these manually so that org-download is truly lazy-loaded (pushnew! dnd-protocol-alist - '("^\\(?:https?\\|ftp\\|file\\|nfs\\):" . +org-dragndrop-download-dnd-fn) + '("^\\(?:https?\\|ftp\\|file\\|nfs\\):" . org-download-dnd) '("^data:" . org-download-dnd-base64)) (advice-add #'org-download-enable :override #'ignore) From 2db423897c745138c03b71df0f24121f35e59096 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 01:25:38 -0400 Subject: [PATCH 032/105] Fix #2539: autoload org-attach commands --- modules/lang/org/config.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index da6195922..1e556547a 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -1025,6 +1025,16 @@ compelling reason, so..." :config (setq org-archive-subtree-save-file-p t) ; save target buffer after archiving + ;; Autoload all these commands that org-attach doesn't autoload itself + (use-package! org-attach + :commands (org-attach-new + org-attach-open + org-attach-open-in-emacs + org-attach-reveal-in-emacs + org-attach-url + org-attach-set-directory + org-attach-sync)) + ;; Global ID state means we can have ID links anywhere. This is required for ;; `org-brain', however. (setq org-id-track-globally t From 8d954d4dadf4cb23c80db02d81e0f6663a50d2c3 Mon Sep 17 00:00:00 2001 From: Gerry Agbobada <10496163+gagbo@users.noreply.github.com> Date: Fri, 8 May 2020 11:18:26 +0200 Subject: [PATCH 033/105] Add link to emacs-mac-port source code Hopefully this will make it clear that emacs-mac does something special to get ligatures working with the composition-function-table method ; and it serves as an entry point for people who want to get into this kind of detail --- modules/ui/pretty-code/README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/pretty-code/README.org b/modules/ui/pretty-code/README.org index ef04c37d9..25227c9c1 100644 --- a/modules/ui/pretty-code/README.org +++ b/modules/ui/pretty-code/README.org @@ -86,7 +86,7 @@ emacs, this is implemented in two different ways : automatically depending on the capabilities of the font, and no font-specific configuration is necessary. -Emacs-mac port implements the /composition-function-table/ method in its code, +Emacs-mac port implements the /composition-function-table/ method in [[https://bitbucket.org/mituharu/emacs-mac/src/26c8fd9920db9d34ae8f78bceaec714230824dac/lisp/term/mac-win.el?at=master#lines-345:805][its code]], nothing is necessary on Doom side; otherwise, Doom implements the /composition-function-table/ for emacs 28+ built with Harfbuzz support, and the /prettify-symbols-mode/ method otherwise. From 9a7f46fff3d6d75bfb1d624949ad3446ecae859d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 05:46:19 -0400 Subject: [PATCH 034/105] Fix journal org files not opening in org-journal Should also fix any lingering "No year zero" errors. --- modules/lang/org/contrib/journal.el | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/modules/lang/org/contrib/journal.el b/modules/lang/org/contrib/journal.el index 1df1dde1e..55c5ea979 100644 --- a/modules/lang/org/contrib/journal.el +++ b/modules/lang/org/contrib/journal.el @@ -2,11 +2,10 @@ ;;;###if (featurep! +journal) (use-package! org-journal - :hook (org-load . org-journal-update-auto-mode-alist) - ;; This is necessary if the user decides opens a journal file directly, via - ;; `find-file' or something, and not through org-journal's commands. - :mode ("/[0-9]\\{8\\}\\.org\\(?:\\.gpg\\)?\\'" . org-journal-mode) - :preface + :defer t + :init + (remove-hook 'org-mode-hook #'org-journal-update-auto-mode-alist) + ;; Not using the .org file extension causes needless headache with file ;; detection for no compelling reason, so we make it the default, so ;; `org-journal' doesn't have to do all its `auto-mode-alist' magic. @@ -22,16 +21,20 @@ ;; we wanted to keep visible. org-journal-find-file #'find-file) - :config - (when (or (equal org-journal-dir "journal/") - (not (equal org-journal-file-format "%Y%m%d.org"))) - ;; HACK `org-journal' does some file-path magic at load time that creates - ;; several, duplicate and hard-coded `auto-mode-alist' entries, so get - ;; rid of them all here so we can create a one-true-entry right after. - (setq auto-mode-alist (rassq-delete-all 'org-journal-mode auto-mode-alist)) - ;; ...By exploiting `org-journal-dir''s setter + ;; HACK `org-journal' does some file-path magic at load time that creates + ;; duplicate entries in `auto-mode-alist'. We load org-journal in such a + ;; way that we can generate a final entry after the user could possibly + ;; customize `org-journal-dir'. + (after! org + (require 'org-journal) + ;; Delete duplicate entries in `auto-mode-alist' + (rassq-delete-all 'org-journal-mode auto-mode-alist) + ;; ...and exploit `org-journal-dir''s setter to set up + ;; `org-journal-file-pattern' and call `org-journal-update-auto-mode-alist' + ;; for us, to create the one-true-entry in `auto-mode-alist.' (setq! org-journal-dir (expand-file-name org-journal-dir org-directory))) + :config (set-popup-rule! "^\\*Org-journal search" :select t :quit t) (map! (:map org-journal-mode-map From 7300b0a0416b6c89d248f7be319f3afa0c805838 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 05:49:09 -0400 Subject: [PATCH 035/105] Add :tools pdf readme #1166 And document building epdfinfo on Windows. --- modules/tools/pdf/README.org | 101 +++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 modules/tools/pdf/README.org diff --git a/modules/tools/pdf/README.org b/modules/tools/pdf/README.org new file mode 100644 index 000000000..0e871370e --- /dev/null +++ b/modules/tools/pdf/README.org @@ -0,0 +1,101 @@ +#+TITLE: tools/pdf +#+DATE: February 6, 2018 +#+SINCE: v2.0 +#+STARTUP: inlineimages nofold + +* Table of Contents :TOC_3:noexport: +- [[#description][Description]] + - [[#maintainers][Maintainers]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] + - [[#hacks][Hacks]] +- [[#prerequisites][Prerequisites]] + - [[#building-epdfinfo-on-windows][Building =epdfinfo= on Windows]] +- [[#features][Features]] +- [[#configuration][Configuration]] +- [[#troubleshooting][Troubleshooting]] + +* Description +This module improves Emacs' support for reading PDF files. + +** Maintainers +This module has no dedicated maintainers. + +** Module Flags +This module provides no flags. + +** Plugins ++ [[https://github.com/politza/pdf-tools][pdf-tools]] + +** Hacks ++ Added basic support for HiDPI or Retina displays. + +* Prerequisites +This module will build the =epdfinfo= program when you first open a pdf file. +Linux and macOS don't need to do anything special. Windows users, however, must +build it themselves. + +** Building =epdfinfo= on Windows +1. [[https://www.msys2.org/][Install MSYS2]] and update the package database and core packages using the + instructions provided. + +2. Update and install dependencies, skipping any you already have + + #+BEGIN_SRC sh + pacman -Syu + pacman -S base-devel + pacman -S mingw-w64-x86_64-toolchain + pacman -S mingw-w64-x86_64-zlib + pacman -S mingw-w64-x86_64-libpng + pacman -S mingw-w64-x86_64-poppler + pacman -S mingw-w64-x86_64-imagemagick + #+END_SRC + +3. Install PDF tools in Emacs, but do not try to compile the server. Instead, get a separate copy of the source somewhere else. + + #+BEGIN_SRC sh + git clone https://github.com/politza/pdf-tools + #+END_SRC + +4. Open mingw64 shell (Note: You must use mingw64.exe and not msys2.exe) + +5. Compile pdf-tools: + #+BEGIN_SRC sh + # Cask requires python2 (important: not 3!) + pacman -S python2 + + # Make the mingw-shell aware of your python installation. Adjust the path if + # Emacs is installed elsewhere! + export PATH="/c/Program Files (x86)/Emacs/bin/:$PATH" + + # Cask needs to know where git.exe is; change this path if git is installed + # elsewhere! + export PATH="/c/Program Files/Git/bin:$PATH" + + # Install cask. Certificate errors can be ignored with (unsafe) -k option. + curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python + + # Make sure the build process can see cask + export PATH="$HOME/.cask/bin:$PATH" + + cd /path/to/pdf-tools + make -s + #+END_SRC + +6. This should produce a file =server/epdfinfo.exe=. Copy this file into the + =~/.emacs.d/.local/straight/build/pdf-tools/=. + +7. Start Emacs. + +8. Open a pdf file (or run ~M-x pdf-tools-install~) + +9. Test it out: ~M-x pdf-info-check-epdfinfo~ + +* TODO Features +# An in-depth list of features, how to use them, and their dependencies. + +* TODO Configuration +# How to configure this module, including common problems and how to address them. + +* TODO Troubleshooting +# Common issues and their solution, or places to look for help. From 79923809e8552c2c91f77731d367ed422d60b6c9 Mon Sep 17 00:00:00 2001 From: James Ravn Date: Fri, 8 May 2020 10:54:54 +0100 Subject: [PATCH 036/105] Configure java +lsp test runner via dap-mode (#3049) * Configure java +lsp test runner via dap-mode This configures dap-mode appropriately so the user can run tests directly from Doom. It adds two bindings as well which tries to mirror other major modes: * `SPC m t t` runs all the tests in the class at point. * `SPC m t s` runs a single test method at point. I also expanded the README with more details about configuring `+lsp`. * Add +java/run-test, document +lsp/uninstall-server * Add +java/debug-test * Fix localleader bindings When in `:init` they don't load in time on the initial Java buffer. --- modules/lang/java/+lsp.el | 33 +++++++++++++++++++++++++++------ modules/lang/java/README.org | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/modules/lang/java/+lsp.el b/modules/lang/java/+lsp.el index a99a9a7bb..6ccac6088 100644 --- a/modules/lang/java/+lsp.el +++ b/modules/lang/java/+lsp.el @@ -4,10 +4,31 @@ (use-package! lsp-java :after lsp-clients :preface - (setq lsp-java-server-install-dir (concat doom-etc-dir "eclipse.jdt.ls/server/") - lsp-java-workspace-dir (concat doom-etc-dir "java-workspace") - lsp-jt-root (concat doom-etc-dir "eclipse.jdt.ls/server/java-test/server/")) + (setq lsp-java-workspace-dir (concat doom-etc-dir "java-workspace")) (add-hook! java-mode-local-vars #'lsp!) - :config - ;; TODO keybinds - ) + (when (featurep! :tools debugger +lsp) + (defun +java/run-test () + "Runs test at point. If in a method, runs the test method, otherwise runs the entire test class." + (interactive) + (condition-case nil + (dap-java-run-test-method) + (user-error (dap-java-run-test-class)))) + + (defun +java/debug-test () + "Runs test at point in a debugger. If in a method, runs the test method, otherwise runs the entire test class." + (interactive) + (condition-case nil + (call-interactively #'dap-java-debug-test-method) + (user-error (call-interactively #'dap-java-debug-test-class)))) + + (map! :map java-mode-map + :localleader + (:prefix ("t" . "Test") + :desc "Run test class or method" "t" #'+java/run-test + :desc "Run all tests in class" "a" #'dap-java-run-test-class + :desc "Debug test class or method" "d" #'+java/debug-test + :desc "Debug all tests in class" "D" #'dap-java-debug-test-class))) + :init + (when (featurep! :tools debugger +lsp) + (setq lsp-jt-root (concat lsp-java-server-install-dir "java-test/server/") + dap-java-test-runner (concat lsp-java-server-install-dir "test-runner/junit-platform-console-standalone.jar")))) diff --git a/modules/lang/java/README.org b/modules/lang/java/README.org index eb4b69098..4449c18f6 100644 --- a/modules/lang/java/README.org +++ b/modules/lang/java/README.org @@ -13,10 +13,12 @@ - [[#oracle-jdk-11][Oracle JDK 11]] - [[#ubuntu-1][Ubuntu]] - [[#fedora-1][Fedora]] + - [[#multiple-java-versions][Multiple Java Versions]] - [[#features][Features]] - [[#lsp-features][=+lsp= features]] - [[#meghanada-features][=+meghanada= features]] - [[#configuration][Configuration]] + - [[#lsp][=+lsp=]] * Description This module adds [[https://www.java.com][java]] support to Doom Emacs, including =android-mode= and @@ -30,6 +32,9 @@ The =+lsp= and =+meghanada= packages are mutually exclusive and do not work together. At the time of writing the =+meghanada= is already configured whereas =+lsp= needs to manual configuring. +The =lsp= test runner requires that =:tools (debugger +lsp)= is enabled, as this +provides =dap-mode= which contains the Java test runner. + * Prerequisites This module requires the Java SDK. @@ -72,6 +77,23 @@ source /etc/profile.d/jdk11.sh java -version #+END_SRC +** Multiple Java Versions +It is common to need support for multiple Java versions. You can use a generic +tool like [[https://github.com/shyiko/jabba][jabba]] to install and manage multiple Java versions on any OS. + +To switch between Java versions in Doom, you can use [[https://github.com/direnv/direnv][direnv]] and the [[file:~/.emacs.d/modules/tools/direnv/README.org::+TITLE: tools/direnv][direnv module]]. To set a +Java version for a particular project, create a =.envrc= pointing to the Java +installation in the root of the project: + +#+BEGIN_SRC conf-unix +PATH_add ~/.jabba/jdk/adopt@1.11.0-3 +JAVA_HOME=~/.jabba/jdk/adopt@1.11.0-3 +#+END_SRC + +And then run =direnv allow .= in the project directory. If the =direnv= module +is enabled, then Doom will automatically source this environment before +executing the LSP server. + * Features ** =+lsp= features According to [[https://github.com/emacs-lsp/lsp-java]] it adds @@ -111,4 +133,16 @@ According to [[https://github.com/mopemope/meghanada-emacs/]] it adds + Search references + Full-featured text search -* TODO Configuration +* Configuration +** =+lsp= +Install the eclipse server by executing =M-x lsp-install-server= and selecting +=jdtls=. After that any newly opened =java= files should start the LSP server +automatically. + +To update the server, perform =SPC u M-x lsp-install-server=. + +Note that if you change Java version you may need to remove the LSP server and +install it again. You can do this with =M-x +lsp/uninstall-server= followed by +=M-x lsp-install-server=. + +Enable the =:tools (debugger +lsp)= module to get test runner support. From b74abebffa17a4c22abec512c78af0cf66be179c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 05:52:12 -0400 Subject: [PATCH 037/105] Update :tools lookup flags in docs/modules.org --- docs/modules.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules.org b/docs/modules.org index cd5b7e282..3957d7e30 100644 --- a/docs/modules.org +++ b/docs/modules.org @@ -164,7 +164,7 @@ Small modules that give Emacs access to external tools & services. + [[file:../modules/tools/ein/README.org][ein]] - TODO + [[file:../modules/tools/eval/README.org][eval]] =+overlay= - REPL & code evaluation support for a variety of languages + gist - TODO -+ [[file:../modules/tools/lookup/README.org][lookup]] =+dictionary +docsets= - Universal jump-to & documentation lookup ++ [[file:../modules/tools/lookup/README.org][lookup]] =+dictionary +docsets +offline +xwidget= - Universal jump-to & documentation lookup backend + [[file:../modules/tools/lsp/README.org][lsp]] =+peek= - TODO + macos - TODO From d1b30213048df2f9df9297cb7f95ced8e0a5338e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 05:58:25 -0400 Subject: [PATCH 038/105] lang/java: refactor commands out into autoloads --- modules/lang/java/+lsp.el | 28 ++++--------------- .../java/{autoload.el => autoload/java.el} | 2 +- modules/lang/java/autoload/lsp.el | 20 +++++++++++++ 3 files changed, 27 insertions(+), 23 deletions(-) rename modules/lang/java/{autoload.el => autoload/java.el} (98%) create mode 100644 modules/lang/java/autoload/lsp.el diff --git a/modules/lang/java/+lsp.el b/modules/lang/java/+lsp.el index 6ccac6088..cf41a3c3b 100644 --- a/modules/lang/java/+lsp.el +++ b/modules/lang/java/+lsp.el @@ -5,30 +5,14 @@ :after lsp-clients :preface (setq lsp-java-workspace-dir (concat doom-etc-dir "java-workspace")) - (add-hook! java-mode-local-vars #'lsp!) + (add-hook 'java-mode-local-vars-hook #'lsp!) (when (featurep! :tools debugger +lsp) - (defun +java/run-test () - "Runs test at point. If in a method, runs the test method, otherwise runs the entire test class." - (interactive) - (condition-case nil - (dap-java-run-test-method) - (user-error (dap-java-run-test-class)))) - - (defun +java/debug-test () - "Runs test at point in a debugger. If in a method, runs the test method, otherwise runs the entire test class." - (interactive) - (condition-case nil - (call-interactively #'dap-java-debug-test-method) - (user-error (call-interactively #'dap-java-debug-test-class)))) - + (setq lsp-jt-root (concat lsp-java-server-install-dir "java-test/server/") + dap-java-test-runner (concat lsp-java-server-install-dir "test-runner/junit-platform-console-standalone.jar")) (map! :map java-mode-map :localleader (:prefix ("t" . "Test") - :desc "Run test class or method" "t" #'+java/run-test - :desc "Run all tests in class" "a" #'dap-java-run-test-class + :desc "Run test class or method" "t" #'+java/run-test + :desc "Run all tests in class" "a" #'dap-java-run-test-class :desc "Debug test class or method" "d" #'+java/debug-test - :desc "Debug all tests in class" "D" #'dap-java-debug-test-class))) - :init - (when (featurep! :tools debugger +lsp) - (setq lsp-jt-root (concat lsp-java-server-install-dir "java-test/server/") - dap-java-test-runner (concat lsp-java-server-install-dir "test-runner/junit-platform-console-standalone.jar")))) + :desc "Debug all tests in class" "D" #'dap-java-debug-test-class)))) diff --git a/modules/lang/java/autoload.el b/modules/lang/java/autoload/java.el similarity index 98% rename from modules/lang/java/autoload.el rename to modules/lang/java/autoload/java.el index f95d128f2..74cd7c561 100644 --- a/modules/lang/java/autoload.el +++ b/modules/lang/java/autoload/java.el @@ -1,4 +1,4 @@ -;;; lang/java/config.el -*- lexical-binding: t; -*- +;;; lang/java/autoload/java.el -*- lexical-binding: t; -*- ;; yasnippet defuns ;;;###autoload diff --git a/modules/lang/java/autoload/lsp.el b/modules/lang/java/autoload/lsp.el new file mode 100644 index 000000000..332c371ec --- /dev/null +++ b/modules/lang/java/autoload/lsp.el @@ -0,0 +1,20 @@ +;;; lang/java/autoload/lsp.el -*- lexical-binding: t; -*- +;;;###if (featurep! :tools debugger +lsp) + +;;;###autoload +(defun +java/run-test () + "Runs test at point. +If in a method, runs the test method, otherwise runs the entire test class." + (interactive) + (condition-case nil + (dap-java-run-test-method) + (user-error (dap-java-run-test-class)))) + +;;;###autoload +(defun +java/debug-test () + "Runs test at point in a debugger. +If in a method, runs the test method, otherwise runs the entire test class." + (interactive) + (condition-case nil + (call-interactively #'dap-java-debug-test-method) + (user-error (call-interactively #'dap-java-debug-test-class)))) From ab0d37776bef0b91c83f6150cd41b56f5a3116b1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 06:22:21 -0400 Subject: [PATCH 039/105] Bind gb to sly pop commands --- modules/lang/common-lisp/config.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/lang/common-lisp/config.el b/modules/lang/common-lisp/config.el index ed980f0b5..01059888f 100644 --- a/modules/lang/common-lisp/config.el +++ b/modules/lang/common-lisp/config.el @@ -76,12 +76,15 @@ (map! (:map sly-db-mode-map :n "gr" #'sly-db-restart-frame) (:map sly-inspector-mode-map + :n "gb" #'sly-inspector-pop :n "gr" #'sly-inspector-reinspect :n "gR" #'sly-inspector-fetch-all :n "K" #'sly-inspector-describe-inspectee) (:map sly-xref-mode-map :n "gr" #'sly-recompile-xref :n "gR" #'sly-recompile-all-xrefs) + (:map lisp-mode-map + :n "gb" #'sly-pop-find-definition) (:localleader :map lisp-mode-map From 3528fe0ca9e640da36a631ff35c5936f32be0183 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 06:28:35 -0400 Subject: [PATCH 040/105] lang/latex: refactor & fix hooks --- modules/lang/latex/config.el | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/modules/lang/latex/config.el b/modules/lang/latex/config.el index 31227ae65..55abf3dab 100644 --- a/modules/lang/latex/config.el +++ b/modules/lang/latex/config.el @@ -82,7 +82,6 @@ If no viewers are found, `latex-preview-pane' is used.") :when (featurep! +fold) :hook (TeX-mode . TeX-fold-buffer) :hook (TeX-mode . TeX-fold-mode) - :config ;; Fold after all auctex macro insertions (advice-add #'TeX-insert-macro :after #'+latex-fold-last-macro-a) @@ -91,24 +90,23 @@ If no viewers are found, `latex-preview-pane' is used.") (advice-add #'cdlatex-math-modify :after #'+latex-fold-last-macro-a) ;; Fold after snippets (when (featurep! :editor snippets) - (add-hook 'TeX-fold-mode-hook - (defun +latex-fold-set-yas-hook-h () - "Set a local after-snippet-hook to fold the snippet contents." - (add-hook! 'yas-after-exit-snippet-hook :local - (TeX-fold-region yas-snippet-beg yas-snippet-end))))) + (add-hook! 'TeX-fold-mode-hook + (defun +latex-fold-snippet-contents-h () + (add-hook! 'yas-after-exit-snippet-hook :local + (TeX-fold-region yas-snippet-beg yas-snippet-end))))) - (add-hook 'mixed-pitch-mode-hook - (defun +latex-fold-set-variable-pitch-h () - "Fix folded things invariably getting fixed pitch when using mixed-pitch. -Math faces should stay fixed by the mixed-pitch blacklist, this -is mostly for \\section etc." - (when mixed-pitch-mode - ;; Adding to this list makes mixed-pitch clean the face remaps after us - (add-to-list 'mixed-pitch-fixed-cookie - (face-remap-add-relative - 'TeX-fold-folded-face - :family (face-attribute 'variable-pitch :family) - :height (face-attribute 'variable-pitch :height)))))) + (add-hook! 'mixed-pitch-mode-hook + (defun +latex-fold-set-variable-pitch-h () + "Fix folded things invariably getting fixed pitch when using mixed-pitch. +Math faces should stay fixed by the mixed-pitch blacklist, this is mostly for +\\section etc." + (when mixed-pitch-mode + ;; Adding to this list makes mixed-pitch clean the face remaps after us + (add-to-list 'mixed-pitch-fixed-cookie + (face-remap-add-relative + 'TeX-fold-folded-face + :family (face-attribute 'variable-pitch :family) + :height (face-attribute 'variable-pitch :height)))))) (map! :map TeX-fold-mode-map :localleader From 0d821f4ebd0a18dd2a022165d8b1a1f1f3df6796 Mon Sep 17 00:00:00 2001 From: yoavm448 Date: Fri, 8 May 2020 14:06:54 +0300 Subject: [PATCH 041/105] Add org-roam doctor check for the dot executable --- modules/lang/org/doctor.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/lang/org/doctor.el b/modules/lang/org/doctor.el index d5fc85e20..412afa510 100644 --- a/modules/lang/org/doctor.el +++ b/modules/lang/org/doctor.el @@ -4,3 +4,7 @@ (when (featurep! +gnuplot) (unless (executable-find "gnuplot") (warn! "Couldn't find gnuplot. org-plot/gnuplot will not work"))) + +(when (featurep! +roam) + (unless (executable-find "dot") + (warn! "Couldn't find the dot executable (from graphviz). org-roam will not be able to generate graph visuallizations."))) From fa0d88249725a884da4e95db633a828719e7d235 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 14:31:33 -0400 Subject: [PATCH 042/105] Fix #3066: void-variable lsp-java-server-install-dir --- modules/lang/java/+lsp.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/lang/java/+lsp.el b/modules/lang/java/+lsp.el index cf41a3c3b..2fbaff0b5 100644 --- a/modules/lang/java/+lsp.el +++ b/modules/lang/java/+lsp.el @@ -6,13 +6,16 @@ :preface (setq lsp-java-workspace-dir (concat doom-etc-dir "java-workspace")) (add-hook 'java-mode-local-vars-hook #'lsp!) + (map! :when (featurep! :tools debugger +lsp) + :after cc-mode ; where `java-mode' is defined + :map java-mode-map + :localleader + (:prefix ("t" . "Test") + :desc "Run test class or method" "t" #'+java/run-test + :desc "Run all tests in class" "a" #'dap-java-run-test-class + :desc "Debug test class or method" "d" #'+java/debug-test + :desc "Debug all tests in class" "D" #'dap-java-debug-test-class)) + :config (when (featurep! :tools debugger +lsp) (setq lsp-jt-root (concat lsp-java-server-install-dir "java-test/server/") - dap-java-test-runner (concat lsp-java-server-install-dir "test-runner/junit-platform-console-standalone.jar")) - (map! :map java-mode-map - :localleader - (:prefix ("t" . "Test") - :desc "Run test class or method" "t" #'+java/run-test - :desc "Run all tests in class" "a" #'dap-java-run-test-class - :desc "Debug test class or method" "d" #'+java/debug-test - :desc "Debug all tests in class" "D" #'dap-java-debug-test-class)))) + dap-java-test-runner (concat lsp-java-server-install-dir "test-runner/junit-platform-console-standalone.jar")))) From cb8b66dd36097cd88cc7d35baafa0146f2263aa4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 14:44:48 -0400 Subject: [PATCH 043/105] Remove old persisted scratch buffer file This was for backward compatibility with the old format. Removing this now after two months being deprecated. --- core/autoload/scratch.el | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/core/autoload/scratch.el b/core/autoload/scratch.el index feb6665da..49b49c794 100644 --- a/core/autoload/scratch.el +++ b/core/autoload/scratch.el @@ -34,30 +34,19 @@ the first, fresh scratch buffer you create. This accepts: doom-scratch-default-file)) (let ((smart-scratch-file (expand-file-name (concat doom-scratch-current-project ".el") - doom-scratch-dir)) - (scratch-file - (expand-file-name doom-scratch-current-project doom-scratch-dir))) (make-directory doom-scratch-dir t) - (cond ((file-readable-p smart-scratch-file) - (message "Reading %s" smart-scratch-file) - (cl-destructuring-bind (content point mode) - (with-temp-buffer - (save-excursion (insert-file-contents smart-scratch-file)) - (read (current-buffer))) - (erase-buffer) - (funcall mode) - (insert content) - (goto-char point) - t)) - ((file-readable-p scratch-file) ; DEPRECATED - (when (file-readable-p scratch-file) - (let ((pt (point))) - (erase-buffer) - (insert-file-contents scratch-file) - (set-auto-mode) - (goto-char pt)) - t))))) + (when (file-readable-p smart-scratch-file) + (message "Reading %s" smart-scratch-file) + (cl-destructuring-bind (content point mode) + (with-temp-buffer + (save-excursion (insert-file-contents smart-scratch-file)) + (read (current-buffer))) + (erase-buffer) + (funcall mode) + (insert content) + (goto-char point) + t)))) ;;;###autoload (defun doom-scratch-buffer (&optional dont-restore-p mode directory project-name) From 4f27d8e774f432915425b4bdbb99d160915feb1a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 14:49:14 -0400 Subject: [PATCH 044/105] Fix #3070: project scratch buffers not persistent --- core/autoload/scratch.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/autoload/scratch.el b/core/autoload/scratch.el index 49b49c794..31a95ec96 100644 --- a/core/autoload/scratch.el +++ b/core/autoload/scratch.el @@ -23,14 +23,15 @@ the first, fresh scratch buffer you create. This accepts: (defvar doom-scratch-current-project nil "The name of the project associated with the current scratch buffer.") +(put 'doom-scratch-current-project 'permanent-local t) (defvar doom-scratch-buffer-hook () "The hooks to run after a scratch buffer is created.") -(defun doom--load-persistent-scratch-buffer (name) +(defun doom--load-persistent-scratch-buffer (project-name) (setq-local doom-scratch-current-project - (or name + (or project-name doom-scratch-default-file)) (let ((smart-scratch-file (expand-file-name (concat doom-scratch-current-project ".el") From 7bb9a8ffa10edd295683610c885e054e1bfd7b55 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 15:05:42 -0400 Subject: [PATCH 045/105] Revise docs/faq --- docs/faq.org | 140 ++++++++++++++++++++------------------------------- 1 file changed, 55 insertions(+), 85 deletions(-) diff --git a/docs/faq.org b/docs/faq.org index fa438bc40..49046eb1a 100644 --- a/docs/faq.org +++ b/docs/faq.org @@ -64,32 +64,29 @@ - [[#an-upstream-package-was-broken-and-i-cant-update-it][An upstream package was broken and I can't update it]] - [[#why-do-i-see-ugly-indentation-highlights-for-tabs][Why do I see ugly indentation highlights for tabs?]] - [[#clipetty--emit-opening-output-file-permission-denied-devpts29-error]["clipetty--emit: Opening output file: Permission denied, /dev/pts/29" error]] -- [[#contributing][Contributing]] * General ** Why is it called Doom? -It's an homage to idsoftware's classic game, whose open sourced code was -Henrik's (Doom's maintainer) first exposure to programming. +It's an homage to idsoftware's classic game, whose source code was Henrik's +(Doom's maintainer) first exposure to programming, back in the Cretaceous period +(1999). And if you're obsessed enough with a text editor that you write a community config for it, you're doomed from the start. ** Does Doom work on Windows? -Windows support is weak and generally lags behind Linux/MacOS support, so your -mileage will vary. However, some have reported success using Doom Emacs on -Windows (using WSL, WSL2 or scoop/chocolatey). You'll find install instructions -in the [[file:getting_started.org::On Windows][Getting Starting guide]]. +Windows support is weaker and will lag behind Linux/MacOS support, but your +mileage will vary. Many have reported success using Doom Emacs on Windows (using +WSL, WSL2 or scoop/chocolatey). You'll find install instructions in the [[file:getting_started.org::On Windows][Getting +Starting guide]]. If you're a Windows user, help us improve our documentation! ** Is Doom only for vimmers? -No, but it is Doom's primary audience, because its maintainer is a -dyed-in-the-wool vimmer with almost two decades of vim muscle memory, and he -adopted Emacs in search of a better vim. - -Although Doom is less polished without evil, its growing non-evil user base is -slowly improving the situation. We welcome suggestions and PRs to help -accommodate a non-evil workflow. +No, but its maintainer /is/ a dyed-in-the-wool vimmer with almost two decades of +vim muscle memory, so the non-vim experience will be less polished. Still, Doom +has a growing user base of non-vim users, who continue to improve the situation, +and we welcome suggestions and contributions! If you'd still like a go at it, see the [[file:../modules/editor/evil/README.org::Removing evil-mode][removing evil-mode]] section in the [[file:../modules/editor/evil/README.org][:editor evil]] module's documentation. @@ -144,15 +141,17 @@ Doom had +four+ *five* goals for its package management system: superior fork, or aren't available in ELPA repos. 3. *Performance:* lazy-loading the package management system is a tremendous boon to start up speed. Initializing package.el and straight (and/or checking - that your packages are installed) each time you start up is expensive. + that your packages are installed) or loading package autoloads files each + time you start up is expensive. 4. *Organization:* an Emacs configuration grows so quickly, in complexity and size. A clear separation of concerns (configuration of packages from their - installation) is more organized. -5. *Reproducibility:* /This goal hasn't been implemented yet/, but all our work - up until now is aimed at this goal. Emacs is a tumultuous ecosystem; packages - break left and right, and we rely on hundreds of them. Eventually, we want - package versions to be locked to Doom's releases so that Doom installs are - reproducible. + installation) is easier to manage. +5. *Reproducibility:* Emacs is a tumultuous ecosystem; packages break left and + right, and we rely on hundreds of them. By pinning our packages we achieve a + degree of config reproducibility and significantly limit the damage upstream + changes can do. Better yet, we stave off having to deal with those issues + until we are ready to. Although technical limitations prevent us from + achieving true reproducibility, this is better than nothing. ** How does Doom start up so quickly? Doom employs a number of techniques to cut down startup time. Here are its most @@ -199,50 +198,25 @@ helm and ivy). Here is how Doom does it: (add-hook 'minibuffer-exit-hook #'doom-restore-garbage-collection-h) #+END_SRC -Another alternative (which is [[https://github.com/hlissner/doom-emacs/blob/develop/core/core.el#L269-L274][what Doom uses]]) is to use the [[https://gitlab.com/koral/gcmh/][gcmh]] package to -stave off the GC until you are idle or unfocus the Emacs frame. - -*** Unset ~file-name-handler-alist~ temporarily -Emacs consults this variable every time a file is read or library loaded, or -when certain functions in the file API are used (like ~expand-file-name~ or -~file-truename~). - -Emacs does to check if a special handler is needed to read that file, but none -of them are (typically) necessary at startup, so we disable them (temporarily!): - -#+BEGIN_SRC emacs-lisp -(defvar doom--file-name-handler-alist file-name-handler-alist) -(setq file-name-handler-alist nil) - -;; ... your whole emacs config here ... - -;; Then restore it later: -(setq file-name-handler-alist doom--file-name-handler-alist) - -;; Alternatively, restore it even later: -(add-hook 'emacs-startup-hook - (lambda () - (setq file-name-handler-alist doom--file-name-handler-alist))) -#+END_SRC - -Don't forget to restore ~file-name-handler-alist~, otherwise TRAMP won't work -and compressed/encrypted files won't open. +Another alternative (which is [[https://github.com/hlissner/doom-emacs/blob/develop/core/core.el#L269-L274][what Doom uses]]) is the [[https://gitlab.com/koral/gcmh/][gcmh]] package; which staves +off the GC until you are idle. Doom also triggers GC when you unfocus the Emacs +frame. *** Concatenate package autoloads When you install a package, a PACKAGE-autoloads.el file is generated. This file -contains a map of autoloaded functions and snippets declared by the package. -They tell Emacs where to find them when they are eventually called. In your -conventional Emacs config, every one of these autoloads files are loaded -immediately at startup (when ~package-initialize~ is called). +maps autoloaded functions and snippets to their containing package so Emacs will +know where to find them when they are used. In your conventional Emacs config, +every one of these autoloads files are loaded immediately at startup (when +~package-initialize~ is called). Since you'll commonly have hundreds of packages, loading hundreds of autoloads file can hurt startup times, especially without an SSD. We get around this by concatenating these files into one giant one when you run ~doom sync~. -Emacs 27+ introduces a ~package-quickstart~ command does this for you, and -=straight=, our package manager, does this for you too, but [[https://github.com/hlissner/doom-emacs/tree/develop/core/cli/autoloads.el][Doom Emacs has its -own specialized mechanism]] for this, topped off with a few Doom-specific -optimizations. +Emacs 27+ introduces a ~package-quickstart~ command that does this for you, and +=straight= (which powers our package manager) does this for you too, but [[https://github.com/hlissner/doom-emacs/tree/develop/core/cli/autoloads.el][Doom +Emacs has its own specialized mechanism]] for this, topped off with a few +Doom-specific optimizations. *** Lazy load package management system(s) Initializing package.el or straight.el at startup is expensive. We can save some @@ -437,8 +411,8 @@ summons to fight for custody of your kids. Doom invests a lot of effort to improve runtime performance as well. + Doom's package manager (powered by straight.el) is declarative, non-rolling release and (nominally) reproducible; which is unique on the Emacs distro - scene. Upstream issues won't surprise you as much, and you can roll back when - you don't have the time to deal with them. + scene. Don't let upstream issues surprise you. Roll back or re-pin packages + when you don't have the time to deal with issues. + It facilitates integration with the command line, which makes it easy to integrate external tools with Emacs via the =bin/doom= script. @@ -453,16 +427,12 @@ can also be retrieved using ~M-x doom/version~ (bound to =SPC h d v= or =C-h d v= by default) or ~bin/doom version~ on the command line. ** Is Discord the only option for interacting with your community? -Yes. I selected it for my personal convenience and have no plans to extend our -community to any other platform (like Matrix, IRC or Slack), or add bridges for -them. I already have my hands full managing the one. +Yes. Discord is already woven into my social and work life, and was selected to +maximize my availability to the community. I have no plans to extend it to other +platforms (like Matrix, IRC or Slack), or add bridges for them, even if they are +better suited to the task. I already have my hands full managing the one. -My being so active on our Discord is owed to that fact that my friends, family -and other communities were on Discord to begin with. My availability was the -most important factor in choosing a platform, even if there are other platforms -better suited to the task. - -Email is a possible alternative, but it is constantly swamped; expect a long +Email is a possible alternative, but is constantly swamped; expect a long turn-around time. * Configuration @@ -470,7 +440,7 @@ turn-around time. Yes. Your private config (normally in =~/.doom.d=) can be moved to =~/.config/doom=. -And as of Emacs 27, Emacs will recognize =~/.config/emacs=. +And as of Emacs 27, you can move =~/.emacs.d= to =~/.config/emacs=. ** How do I configure Doom Emacs? Canonically, your private config is kept in =~/.doom.d/= (or =~/.config/doom/=). @@ -840,14 +810,13 @@ Long answer: Features and performance appear to be the main talking points when comparing the two, but as far as I'm concerned they are equal in both respects (not all across the board, but on average). -Instead, what is important to me is maintainability. As someone who frequently -extends and debugs his editor (and maintains a community config), I frequently -run up against issues with ivy and helm, but spend disproportionally more time -doing so with helm than I do ivy, for little or no gain. Though both frameworks -are excellent, the difference in complexity is also reflected in their plugin -ecosystems; ivy plugins tend to be lighter, simpler, more consistent and -significantly easier to hack if I want to change something. Unless you like helm -/just/ the way it is out of the box, ivy is just the simpler choice. +Instead, maintainability is most important for someone that frequently tinkers +with their editor. When I have an issue, I spend a disproportionately more time +dealing helm than I do ivy, for little or no gain. Though both frameworks are +excellent, the difference in complexity is reflected in their plugin ecosystems; +ivy plugins tend to be lighter, simpler, more consistent and significantly +easier to hack if I want to change something. Unless you like helm /just/ the +way it is out of the box, ivy is just the simpler choice. And since I dogfood it, Ivy's integration into Doom will always be a step or three ahead of helm's. @@ -941,12 +910,13 @@ you have rambunctious colleagues peppering trailing whitespace into your project, you need to have a talk (with wiffle bats, preferably) rather than play a passive-aggressive game of whack-a-mole. -Here at Doom Inc we believe that operations that mutate entire files should not -be automated. Rather, they should be invoked deliberately, when and where it is -needed, by someone that is aware of the potential consequences. This is where -=ws-butler= comes in. It only cleans up whitespace /on the lines you've touched/ -*and* it leaves behind virtual whitespace (which is never written to the file) -so your cursor doesn't get thrown around in all that cleanup work. +Here at Doom Inc we believe that operations that mutate entire files (or worse, +projects) should not be automated. Rather, they should be invoked deliberately, +only when and where it is needed, by someone that is aware of the consequences. +This is where =ws-butler= comes in. It only cleans up whitespace /on the lines +you've touched/ *and* it leaves behind virtual whitespace (which is never +written to the file) so your cursor doesn't get thrown around in all that +cleanup work. In any case, if you had used =ws-butler= from the beginning, trailing whitespace and newlines would never be a problem! @@ -1082,6 +1052,8 @@ Here are a few common causes for random crashes: #+END_SRC Or disable the =:ui doom-dashboard= & =:tools magit= modules (see [[https://github.com/hlissner/doom-emacs/issues/1170][#1170]]). ++ Ligatures and some fonts can cause Emacs to crash. You may want to try a + different font, or disable the =:ui pretty-code= module. ** Can't load my theme; ~unable to find theme file for X~ errors This means Emacs can't find the X-theme.el file for the theme you want to load. @@ -1163,5 +1135,3 @@ There are a couple ways to address this: ** "clipetty--emit: Opening output file: Permission denied, /dev/pts/29" error This applies to tmux users, in particular. See https://github.com/spudlyo/clipetty/issues/15 for a solution. - -* TODO Contributing From 692772a9bda4dd929bea4219eaecca12d2248ff6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 15:05:57 -0400 Subject: [PATCH 046/105] Add "Why is scrolling slow in Emacs/Doom?" to FAQ --- docs/faq.org | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docs/faq.org b/docs/faq.org index 49046eb1a..84e50f95a 100644 --- a/docs/faq.org +++ b/docs/faq.org @@ -435,6 +435,51 @@ better suited to the task. I already have my hands full managing the one. Email is a possible alternative, but is constantly swamped; expect a long turn-around time. +** Why is scrolling slow in Emacs/Doom? +This comes up often. The first thing folks fresh off the boat from other editors +will notice is that Emacs has a low threshold for performance issues. It doesn't +take much to get it to scroll like molasses. + +Retina/4K/high res users have it especially hard. MacOS users too, where Emacs +seem even slower. Add to that files that are large (perhaps 1mb+) or have long +lines (200 characters+) and we've got ourselves a really poor experience. And +that's before we factor in plugins and poorly optimized major modes. + +There is an unfortunate but necessary adjustment of expectations new users must +undergo, when they adopt Emacs. Doom has inherited this curse. It's raison +d'etre is to improve the situation, but I can only go so far. You /will/ find +cases where Emacs just scrolls slowly. + +What can you do about it? + +1. Disable some of Doom's slowest modules. The biggest offenders tend to be: + =:ui tabs=, =:ui indent-guides=, =:ui pretty-code=, and =:ui word-wrap=. +2. Turn off line numbers ~(setq display-line-numbers-type nil)~. It's known to + slow down scrolling, in particular. +3. Org users can turn off ~org-superstar-mode~: ~(remove-hook 'org-mode-hook + #'org-superstar-mode)~. It's an aesthetic plugin that offers fancier bullets. + Emacs seems to struggle to display those characters with some fonts. + + Org uses can also turn off the rest of org's eye candy: + + #+BEGIN_SRC elisp + (after! org + (setq org-fontify-quote-and-verse-blocks nil + org-fontify-whole-heading-line nil + org-hide-leading-stars nil + org-hide-leading-stars-before-indent-mode nil + org-startup-indented nil)) + #+END_SRC +4. Turn on =M-x so-long-minor-mode=. This is a minor mode that disables + non-essential functionality and can be used to temporarily view files that + would be too slow otherwise. =M-x so-long-mode= is its extreme version; it + turns off /everything/, including syntax highlighting. +5. Try replacing the =:ui modeline= module with =:ui (modeline +light)=. There + are aspects of the default modeline that can be unpredictably slow. +6. Don't mash =j= (or =C-n=) to scroll. Evil users can scroll long distances + with =C-d= and =C-u=, for instance, to avoid that slowness. Otherwise, use + search mechanisms to move around, like isearch (=C-s=) or evil-search (=/=). + * Configuration ** Does Doom respect XDG conventions Yes. Your private config (normally in =~/.doom.d=) can be moved to From 022564f737461353a08e6f7385a6206a4c74c4e6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 15:21:30 -0400 Subject: [PATCH 047/105] Update ToC in FAQ --- docs/faq.org | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/faq.org b/docs/faq.org index 84e50f95a..5a0c94f76 100644 --- a/docs/faq.org +++ b/docs/faq.org @@ -16,6 +16,7 @@ - [[#what-is-the-meaning-behind-dooms-naming-convention-in-its-source-code][What is the meaning behind Doom's naming convention in its source code?]] - [[#what-version-of-doom-am-i-running][What version of Doom am I running?]] - [[#is-discord-the-only-option-for-interacting-with-your-community][Is Discord the only option for interacting with your community?]] + - [[#why-is-scrolling-slow-in-emacsdoom][Why is scrolling slow in Emacs/Doom?]] - [[#configuration][Configuration]] - [[#does-doom-respect-xdg-conventions][Does Doom respect XDG conventions]] - [[#how-do-i-configure-doom-emacs][How do I configure Doom Emacs?]] From 51cf9dcc509d867b52b9390f9914efa3af85c19a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 15:55:58 -0400 Subject: [PATCH 048/105] Bump :tools lsp emacs-lsp/lsp-mode@941e606 -> emacs-lsp/lsp-mode@11750e7 emacs-lsp/lsp-ui@43f71e3 -> emacs-lsp/lsp-ui@1288be9 --- modules/tools/lsp/packages.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tools/lsp/packages.el b/modules/tools/lsp/packages.el index 095d2c798..c9c9e43cd 100644 --- a/modules/tools/lsp/packages.el +++ b/modules/tools/lsp/packages.el @@ -1,8 +1,8 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/lsp/packages.el -(package! lsp-mode :pin "941e6062a5b407675e13ba471e9878f4a2dbd10e") -(package! lsp-ui :pin "43f71e3837b07f377444ad631b12f8198c495aa7") +(package! lsp-mode :pin "11750e7b118858b38417a538c1c6eff8759c12f3") +(package! lsp-ui :pin "1288be94b4c37f89e80a03b1cff1b81aba9560bb") (when (featurep! :completion ivy) (package! lsp-ivy :pin "81e81ced99829358674c5a6bbe2c3e15cecd4ed8")) (when (featurep! :completion helm) From 5121a7977ac5adea128245464d48bb9faf1937d7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 15:56:22 -0400 Subject: [PATCH 049/105] Bump :tools debugger emacs-lsp/dap-mode@04d7e96 -> emacs-lsp/dap-mode@cc2eb2f --- modules/tools/debugger/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/debugger/packages.el b/modules/tools/debugger/packages.el index c94117531..9c0c5e9f7 100644 --- a/modules/tools/debugger/packages.el +++ b/modules/tools/debugger/packages.el @@ -6,5 +6,5 @@ (package! realgud-trepan-ni :pin "6e9cac5e8097018aadf41c88de541168036cc227"))) (when (featurep! +lsp) - (package! dap-mode :pin "04d7e967f21a0ab1e2223e528baf55fe5b663882") + (package! dap-mode :pin "cc2eb2fc1b2958ef01dad8c004d2f3bc4dc38bc3") (package! posframe :pin "093b29a53cbeda6d637ccc9ef4dfc47123e79b9e")) From cbd4ca7b477578aa910c7334a5fd3b15feb3750d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 15:56:41 -0400 Subject: [PATCH 050/105] Bump :term vterm akermu/emacs-libvterm@8f00dc9 -> akermu/emacs-libvterm@422ffe0 --- modules/term/vterm/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/term/vterm/packages.el b/modules/term/vterm/packages.el index 9476d222f..a88b89ea9 100644 --- a/modules/term/vterm/packages.el +++ b/modules/term/vterm/packages.el @@ -3,4 +3,4 @@ (package! vterm :built-in 'prefer - :pin "8f00dc90abbdb101b94bf63f9b1cb0ac9a147f40") + :pin "422ffe029b92c47e4acf0e2ed06cbc83636d7e44") From 48221b4b864761c388ba050f39ca7669dee6e420 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 15:57:20 -0400 Subject: [PATCH 051/105] Bump :ui doom hlissner/emacs-doom-themes@254d476 -> hlissner/emacs-doom-themes@34f181c Closes #3057 --- modules/ui/doom/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/doom/packages.el b/modules/ui/doom/packages.el index b6e2ac273..679f45ce9 100644 --- a/modules/ui/doom/packages.el +++ b/modules/ui/doom/packages.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t; -*- ;;; ui/doom/packages.el -(package! doom-themes :pin "254d476dd6790eaa6b563c5a4da286321ff75d38") +(package! doom-themes :pin "34f181c290d2c9fb9628e4ec85c16e633931ede1") (package! solaire-mode :pin "adc8c0c60d914f6395eba0bee78feedda128b30b") From 42a21dffddeee57d84e82a9f0b65d1b0cba2b2af Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 16:06:55 -0400 Subject: [PATCH 052/105] Add doom-incremental-load-immediately option Closes #3063 --- core/core.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/core.el b/core/core.el index 1d768ec33..1ce4c6967 100644 --- a/core/core.el +++ b/core/core.el @@ -379,13 +379,16 @@ Set this to nil to disable incremental loading.") (defvar doom-incremental-idle-timer 0.75 "How long (in idle seconds) in between incrementally loading packages.") +(defvar doom-incremental-load-immediately (daemonp) + "If non-nil, load all incrementally deferred packages immediately at startup.") + (defun doom-load-packages-incrementally (packages &optional now) "Registers PACKAGES to be loaded incrementally. If NOW is non-nil, load PACKAGES incrementally, in `doom-incremental-idle-timer' intervals." (if (not now) - (nconc doom-incremental-packages packages) + (appendq! doom-incremental-packages packages) (while packages (let ((req (pop packages))) (unless (featurep req) @@ -415,7 +418,7 @@ intervals." "Begin incrementally loading packages in `doom-incremental-packages'. If this is a daemon session, load them all immediately instead." - (if (daemonp) + (if doom-incremental-load-immediately (mapc #'require (cdr doom-incremental-packages)) (when (numberp doom-incremental-first-idle-timer) (run-with-idle-timer doom-incremental-first-idle-timer From 29e139897762001930629b4fd808f28e571f26d0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 16:14:47 -0400 Subject: [PATCH 053/105] Recenter after project search (with counsel) --- modules/completion/ivy/config.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index bfdf62690..2df48b827 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -214,6 +214,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex." ;; Record in jumplist when opening files via counsel-{ag,rg,pt,git-grep} (add-hook 'counsel-grep-post-action-hook #'better-jumper-set-jump) + (add-hook 'counsel-grep-post-action-hook #'recenter) (ivy-add-actions 'counsel-rg ; also applies to `counsel-rg' '(("O" +ivy-git-grep-other-window-action "open in other window"))) From 0cc811750d96fde923863d350d7f53f7caed2c7a Mon Sep 17 00:00:00 2001 From: Yiming Chen Date: Sat, 9 May 2020 07:54:20 +0800 Subject: [PATCH 054/105] Bump :completion ivy abo-abo/swiper@9e0803c -> abo-abo/swiper@84efa3a fixed #3069 --- modules/completion/ivy/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/ivy/packages.el b/modules/completion/ivy/packages.el index f7f6d57ab..05a724417 100644 --- a/modules/completion/ivy/packages.el +++ b/modules/completion/ivy/packages.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t; -*- ;;; completion/ivy/packages.el -(package! swiper :pin "9e0803cdb5b47e4e1844e8281516b46589ef26c7") +(package! swiper :pin "84efa3a2cbb9c5b0bbcc8d2e90671434eed74f94") (package! ivy) (package! ivy-hydra) (package! counsel) From 7472cffadddb09cf90bf87318a320f2e14cc247b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 May 2020 16:45:58 -0400 Subject: [PATCH 055/105] Integrate LSP into +format/{buffer,region} commands Relevant to #1652 --- modules/editor/format/autoload/format.el | 30 ++++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/modules/editor/format/autoload/format.el b/modules/editor/format/autoload/format.el index 3954cc652..467976388 100644 --- a/modules/editor/format/autoload/format.el +++ b/modules/editor/format/autoload/format.el @@ -198,7 +198,14 @@ See `+format/buffer' for the interactive version of this function, and ;;; Commands ;;;###autoload -(defalias '+format/buffer #'format-all-buffer) +(defun +format/buffer () + "Reformat the current buffer using LSP or `format-all-buffer'." + (interactive) + (call-interactively + (if (and (bound-and-true-p lsp-mode) + (lsp-feature? "textDocument/formatting")) + #'lsp-format-buffer + #'format-all-buffer))) ;;;###autoload (defun +format/region (beg end) @@ -208,10 +215,13 @@ WARNING: this may not work everywhere. It will throw errors if the region contains a syntax error in isolation. It is mostly useful for formatting snippets or single lines." (interactive "rP") - (save-restriction - (narrow-to-region beg end) - (let ((+format-region-p t)) - (+format/buffer)))) + (if (and (bound-and-true-p lsp-mode) + (lsp-feature? "textDocument/rangeFormatting")) + #'lsp-format-region + (save-restriction + (narrow-to-region beg end) + (let ((+format-region-p t)) + (+format/buffer))))) ;;;###autoload (defun +format/region-or-buffer () @@ -220,14 +230,8 @@ is selected)." (interactive) (call-interactively (if (doom-region-active-p) - (if (and (bound-and-true-p lsp-mode) - (lsp-feature? "textDocument/rangeFormatting")) - #'lsp-format-region - #'+format/region) - (if (and (bound-and-true-p lsp-mode) - (lsp-feature? "textDocument/formatting")) - #'lsp-format-buffer - #'+format/buffer)))) + #'+format/region + #'+format/buffer))) ;; From 1413c02b25240cfdd37ee43880f5f93f80a5b6f2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 9 May 2020 00:30:21 -0400 Subject: [PATCH 056/105] sly-pop-find-definition -> sly-pop-find-definition-stack --- modules/lang/common-lisp/config.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/common-lisp/config.el b/modules/lang/common-lisp/config.el index 01059888f..a3600451c 100644 --- a/modules/lang/common-lisp/config.el +++ b/modules/lang/common-lisp/config.el @@ -84,7 +84,7 @@ :n "gr" #'sly-recompile-xref :n "gR" #'sly-recompile-all-xrefs) (:map lisp-mode-map - :n "gb" #'sly-pop-find-definition) + :n "gb" #'sly-pop-find-definition-stack) (:localleader :map lisp-mode-map From 6780d7c81665b35a2a02be80ab4b14df724625c0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 9 May 2020 01:13:04 -0400 Subject: [PATCH 057/105] Update python readme wrt mspyls & pyls Since lsp-python-ms changed its priority from 1 to -1 in emacs-lsp/lsp-python-ms@396c25c, it is no longer the first choice when both is available. --- modules/lang/python/README.org | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/lang/python/README.org b/modules/lang/python/README.org index ebb303ac2..3660636eb 100644 --- a/modules/lang/python/README.org +++ b/modules/lang/python/README.org @@ -79,14 +79,19 @@ This module has no direct prerequisites. Here are some of its soft dependencies. ** Language Server Protocol Support This module must be enabled with the =+lsp= flag, and the =:tools lsp= module -must be enabled. LSP will try mspyls, then pyls; whichever is available. +must be enabled. LSP will try pyls then mspyls; the first that is available. -mypyls can be installed with ~M-x lsp-install-server~ after opening a python -buffer. - -Alternatively, use the [[https://pypi.org/project/python-language-server/][Python Language Server]] instead. ~pip install +*To use [[https://pypi.org/project/python-language-server/][Python Language Server]] (pyls)* install it with ~pip install 'python-language-server[all]'~ +*To use mspyls*, install it with ~M-x lsp-install-server~ and add this to your +private config.el: + +#+BEGIN_SRC elisp +(after! lsp-python-ms + (set-lsp-priority! 'mspyls 1)) +#+END_SRC + * Features This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language Server]] or [[https://github.com/Microsoft/python-language-server][Microsoft Language Server]], see [[Language Server Protocol Support][LSP Support]]. From ba0c89288d51d8c046fa10889f6ef40855904f4e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 9 May 2020 01:20:36 -0400 Subject: [PATCH 058/105] Fix void-variable server in set-lsp-priority! --- modules/tools/lsp/autoload.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/lsp/autoload.el b/modules/tools/lsp/autoload.el index 884cda7d3..a473fe50a 100644 --- a/modules/tools/lsp/autoload.el +++ b/modules/tools/lsp/autoload.el @@ -5,7 +5,7 @@ "Change the PRIORITY of lsp CLIENT." (require 'lsp-mode) (if-let (client (gethash client lsp-clients)) - (setf (lsp--client-priority (gethash server lsp-clients)) + (setf (lsp--client-priority (gethash client lsp-clients)) priority) (error "No LSP client named %S" client))) From e2b5f50e7bed082c41530cd80b1cb296ae04c0b0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 9 May 2020 01:37:40 -0400 Subject: [PATCH 059/105] Fix wrong-type-arg lsp--client in set-lsp-priority! --- modules/tools/lsp/autoload.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/lsp/autoload.el b/modules/tools/lsp/autoload.el index a473fe50a..ec2a90355 100644 --- a/modules/tools/lsp/autoload.el +++ b/modules/tools/lsp/autoload.el @@ -5,7 +5,7 @@ "Change the PRIORITY of lsp CLIENT." (require 'lsp-mode) (if-let (client (gethash client lsp-clients)) - (setf (lsp--client-priority (gethash client lsp-clients)) + (setf (lsp--client-priority client) priority) (error "No LSP client named %S" client))) From 50bf06a57ae3b89a42b2e86a0a80fcdf827a511d Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Sat, 9 May 2020 00:23:56 -0500 Subject: [PATCH 060/105] Allow +vterm/toggle to open remotely When `default-directory` is remote, prepare the toggled vterm at remote location. --- modules/term/vterm/autoload.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/term/vterm/autoload.el b/modules/term/vterm/autoload.el index 92666272c..4e4d66609 100644 --- a/modules/term/vterm/autoload.el +++ b/modules/term/vterm/autoload.el @@ -33,7 +33,20 @@ If prefix ARG is non-nil, recreate vterm buffer in the current project's root." (let ((buffer (get-buffer-create buffer-name))) (with-current-buffer buffer (unless (eq major-mode 'vterm-mode) - (vterm-mode))) + (vterm-mode)) + (when (and (featurep 'tramp) + (tramp-tramp-file-p default-directory)) + (message "default-directory is %s" default-directory) + (with-parsed-tramp-file-name default-directory path + (let ((method (cadr (assoc `tramp-login-program + (assoc path-method tramp-methods))))) + (vterm-send-string + (concat method " " + (when path-user (concat path-user "@")) path-host)) + (vterm-send-return) + (vterm-send-string + (concat "cd " path-localname)) + (vterm-send-return))))) (pop-to-buffer buffer))))) ;;;###autoload From 39ce0c844b77910483680eec6a618a592d73d9f0 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Sat, 9 May 2020 00:53:10 -0500 Subject: [PATCH 061/105] Extract implementation to a separate function --- modules/term/vterm/autoload.el | 17 +++-------------- modules/term/vterm/config.el | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/modules/term/vterm/autoload.el b/modules/term/vterm/autoload.el index 4e4d66609..d059ae8d3 100644 --- a/modules/term/vterm/autoload.el +++ b/modules/term/vterm/autoload.el @@ -34,19 +34,7 @@ If prefix ARG is non-nil, recreate vterm buffer in the current project's root." (with-current-buffer buffer (unless (eq major-mode 'vterm-mode) (vterm-mode)) - (when (and (featurep 'tramp) - (tramp-tramp-file-p default-directory)) - (message "default-directory is %s" default-directory) - (with-parsed-tramp-file-name default-directory path - (let ((method (cadr (assoc `tramp-login-program - (assoc path-method tramp-methods))))) - (vterm-send-string - (concat method " " - (when path-user (concat path-user "@")) path-host)) - (vterm-send-return) - (vterm-send-string - (concat "cd " path-localname)) - (vterm-send-return))))) + (+vterm-open-remote-maybe)) (pop-to-buffer buffer))))) ;;;###autoload @@ -68,7 +56,8 @@ If prefix ARG is non-nil, cd into `default-directory' instead of project root." project-root)) display-buffer-alist) (setenv "PROOT" project-root) - (vterm))) + (vterm) + (+vterm-open-remote-maybe))) (defvar +vterm--insert-point nil) diff --git a/modules/term/vterm/config.el b/modules/term/vterm/config.el index e21b7a60a..48c78d262 100644 --- a/modules/term/vterm/config.el +++ b/modules/term/vterm/config.el @@ -19,6 +19,23 @@ ;; Prevent premature horizontal scrolling hscroll-margin 0) + (defun +vterm-open-remote-maybe () + "When `default-directory` is remote, use the corresponding +method to prepare vterm at the corresponding remote directory." + (when (and (featurep 'tramp) + (tramp-tramp-file-p default-directory)) + (message "default-directory is %s" default-directory) + (with-parsed-tramp-file-name default-directory path + (let ((method (cadr (assoc `tramp-login-program + (assoc path-method tramp-methods))))) + (vterm-send-string + (concat method " " + (when path-user (concat path-user "@")) path-host)) + (vterm-send-return) + (vterm-send-string + (concat "cd " path-localname)) + (vterm-send-return))))) + ;; Restore the point's location when leaving and re-entering insert mode. (when (featurep! :editor evil) (add-hook! 'vterm-mode-hook From 6c4e2d08d4fee140c624b09baf8ec8c13a59a0f6 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Sat, 9 May 2020 01:06:19 -0500 Subject: [PATCH 062/105] Move the function back and rename --- modules/term/vterm/autoload.el | 21 +++++++++++++++++++-- modules/term/vterm/config.el | 17 ----------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/term/vterm/autoload.el b/modules/term/vterm/autoload.el index d059ae8d3..8932b8c68 100644 --- a/modules/term/vterm/autoload.el +++ b/modules/term/vterm/autoload.el @@ -34,7 +34,7 @@ If prefix ARG is non-nil, recreate vterm buffer in the current project's root." (with-current-buffer buffer (unless (eq major-mode 'vterm-mode) (vterm-mode)) - (+vterm-open-remote-maybe)) + (+vterm--change-directory-if-remote)) (pop-to-buffer buffer))))) ;;;###autoload @@ -57,7 +57,24 @@ If prefix ARG is non-nil, cd into `default-directory' instead of project root." display-buffer-alist) (setenv "PROOT" project-root) (vterm) - (+vterm-open-remote-maybe))) + (+vterm--change-directory-if-remote))) + +(defun +vterm--change-directory-if-remote () + "When `default-directory` is remote, use the corresponding +method to prepare vterm at the corresponding remote directory." + (when (and (featurep 'tramp) + (tramp-tramp-file-p default-directory)) + (message "default-directory is %s" default-directory) + (with-parsed-tramp-file-name default-directory path + (let ((method (cadr (assoc `tramp-login-program + (assoc path-method tramp-methods))))) + (vterm-send-string + (concat method " " + (when path-user (concat path-user "@")) path-host)) + (vterm-send-return) + (vterm-send-string + (concat "cd " path-localname)) + (vterm-send-return))))) (defvar +vterm--insert-point nil) diff --git a/modules/term/vterm/config.el b/modules/term/vterm/config.el index 48c78d262..e21b7a60a 100644 --- a/modules/term/vterm/config.el +++ b/modules/term/vterm/config.el @@ -19,23 +19,6 @@ ;; Prevent premature horizontal scrolling hscroll-margin 0) - (defun +vterm-open-remote-maybe () - "When `default-directory` is remote, use the corresponding -method to prepare vterm at the corresponding remote directory." - (when (and (featurep 'tramp) - (tramp-tramp-file-p default-directory)) - (message "default-directory is %s" default-directory) - (with-parsed-tramp-file-name default-directory path - (let ((method (cadr (assoc `tramp-login-program - (assoc path-method tramp-methods))))) - (vterm-send-string - (concat method " " - (when path-user (concat path-user "@")) path-host)) - (vterm-send-return) - (vterm-send-string - (concat "cd " path-localname)) - (vterm-send-return))))) - ;; Restore the point's location when leaving and re-entering insert mode. (when (featurep! :editor evil) (add-hook! 'vterm-mode-hook From 3ed98a41bbe0701a8e4a2b6d1d466696afa4cda0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 9 May 2020 15:39:37 -0400 Subject: [PATCH 063/105] emacs/undo: add "disabling persistent undo history" to readme --- modules/emacs/undo/README.org | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/emacs/undo/README.org b/modules/emacs/undo/README.org index 870498c7a..c98f6e3cc 100644 --- a/modules/emacs/undo/README.org +++ b/modules/emacs/undo/README.org @@ -12,10 +12,12 @@ - [[#prerequisites][Prerequisites]] - [[#features][Features]] - [[#configuration][Configuration]] + - [[#disabling-persistent-undo-history][Disabling persistent undo history]] - [[#troubleshooting][Troubleshooting]] * Description -This module augments Emacs' built-in undo system to be more intuitive. +This module augments Emacs' built-in undo system to be more intuitive and to +persist across Emacs sessions. ** Maintainers This module has no dedicated maintainers. @@ -47,8 +49,20 @@ This module has no prereqisites. * TODO Features # An in-depth list of features, how to use them, and their dependencies. -* TODO Configuration -# How to configure this module, including common problems and how to address them. +* Configuration +** Disabling persistent undo history ++ If you are using =+tree=: + + #+BEGIN_SRC elisp + (after! undo-tree + (setq undo-tree-auto-save-history nil)) + #+END_SRC + ++ If you aren't: + + #+BEGIN_SRC elisp + (remove-hook 'undo-fu-mode-hook #'global-undo-fu-session-mode) + #+END_SRC * TODO Troubleshooting # Common issues and their solution, or places to look for help. From 4a3aacb2198056f8dc9b4c68c83ecfe3d55042e4 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Sat, 9 May 2020 20:58:15 -0500 Subject: [PATCH 064/105] Update mu4e home-manager config to permalink --- modules/email/mu4e/README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/email/mu4e/README.org b/modules/email/mu4e/README.org index 93f2ab37c..ca88d65b5 100644 --- a/modules/email/mu4e/README.org +++ b/modules/email/mu4e/README.org @@ -80,7 +80,7 @@ environment.systemPackages = with pkgs; [ ]; #+END_SRC -[[https://github.com/Emiller88/dotfiles/blob/master/modules/shell/mail.nix][An example of setting up mbsync with home-manager]] +[[https://github.com/Emiller88/dotfiles/blob/5eaabedf1b141c80a8d32e1b496055231476f65e/modules/shell/mail.nix][An example of setting up mbsync and mu with home-manager]] ** openSUSE Remove ~#~ in ~#sync_program=offlineimap~ to choose ~offlineimap~ instead of From 36ad97334eb3211a44db1c76f93910c52cd45c79 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Sat, 9 May 2020 22:30:03 -0500 Subject: [PATCH 065/105] Add initial upload README --- modules/tools/upload/README.org | 64 +++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 modules/tools/upload/README.org diff --git a/modules/tools/upload/README.org b/modules/tools/upload/README.org new file mode 100644 index 000000000..2507c2b57 --- /dev/null +++ b/modules/tools/upload/README.org @@ -0,0 +1,64 @@ +#+TITLE: tools/upload +#+DATE: Feb 19, 2020 +#+SINCE: 2.0.9 +#+STARTUP: inlineimages nofold + +* Table of Contents :TOC_3:noexport: +- [[#description][Description]] + - [[#maintainers][Maintainers]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] +- [[#prerequisites][Prerequisites]] +- [[#features][Features]] +- [[#configuration][Configuration]] +- [[#troubleshooting][Troubleshooting]] + - [[#root-local-and-root-remote-must-match][~root-local~ and ~root-remote~ must match]] + +* Description +Uses ~ssh-deploy~ to map a local folder to a remote one. + +From the [[https://github.com/cjohansson/emacs-ssh-deploy/blob/master/README.md][ssh-deploy README]]: + +#+BEGIN_QUOTE +The ssh-deploy plug-in for Emacs makes it possible to effortlessly deploy local files and directories to remote hosts via Tramp (including but not limited to SSH, SFTP, FTP). It tries to provide functions that can be easily used by custom scripts. + +The idea for this plug-in was to mimic the behavior of PhpStorm deployment functionality. +#+END_QUOTE + +** Maintainers +This module has no dedicated maintainers. + +** Module Flags +This module provides no flags. + +** Plugins ++ [[https://github.com/cjohansson/emacs-ssh-deploy][ssh-deploy]] + +* Prerequisites +This module has no prerequisites. + +* Features +Uses ~ssh-deploy~ to map a local folder to a remote one. Set +~ssh-deploy-root-remote~ and ~ssh-deploy-root-local~ in a .dir-locals.el file +to establish this mapping. + +Example: +#+BEGIN_SRC emacs-lisp +((nil . ((ssh-deploy-root-local . "/local/path/to/project") + (ssh-deploy-root-remote . "/ssh:user@server:/remote/project/") + (ssh-deploy-on-explicity-save . t)))) +#+END_SRC + +Note: ~ssh-deploy-root-local~ is optional, and will resort to +~doom-project-root~ if unspecified. + +* TODO Configuration +Check out [[https://github.com/cjohansson/emacs-ssh-deploy#deployment-configuration-examples][Deployment configuration examples]] for some ideas of what's possible. + +* Troubleshooting +** ~root-local~ and ~root-remote~ must match +The final directory names much match +#+BEGIN_SRC emacs-lisp +((nil . ((ssh-deploy-root-local . "/local/path/to/example-project") + (ssh-deploy-root-remote . "/ssh:user@server:/remote/example-project/") +#+END_SRC From c30f5cefb8e10628b3981177ae47b33ae3787f9c Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Sat, 9 May 2020 21:41:30 -0500 Subject: [PATCH 066/105] Add initial notmuch README --- modules/email/notmuch/README.org | 110 +++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 modules/email/notmuch/README.org diff --git a/modules/email/notmuch/README.org b/modules/email/notmuch/README.org new file mode 100644 index 000000000..5fe167b42 --- /dev/null +++ b/modules/email/notmuch/README.org @@ -0,0 +1,110 @@ +#+TITLE: email/notmuch +#+DATE: July 31, 2018 +#+SINCE: v2.0.9 +#+STARTUP: inlineimages + +* Table of Contents :TOC: +- [[#description][Description]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] +- [[#prerequisites][Prerequisites]] + - [[#macos][MacOS]] + - [[#arch-linux][Arch Linux]] + - [[#nixos][NixOS]] + - [[#opensuse][openSUSE]] + - [[#debianubuntu][Debian/Ubuntu]] +- [[#features][Features]] +- [[#configuration][Configuration]] + - [[#gmailier][Gmailier]] + - [[#offlineimap][offlineimap]] + - [[#mbsync][mbsync]] + - [[#notmuch][notmuch]] +- [[#troubleshooting][Troubleshooting]] + +* Description +This module makes Emacs an email client, using ~notmuch~. + +** Module Flags ++ This module install no module flags. + + +** Plugins ++ [[https://notmuchmail.org/][notmuch]] ++ [[https://github.com/org-mime/org-mime][org-mime]] + +* Prerequisites +This module requires: + ++ Either ~gmailieer~ (default), ~mbsync~ or ~offlineimap~ (to sync mail with) ++ ~notmuch~, to index and tag your downloaded messages. ++ ~afew~, optionally to initially tag your downloaded messages. + +** TODO MacOS + +** TODO Arch Linux +** NixOS +#+BEGIN_SRC nix +environment.systemPackages = with pkgs; [ + notmuch + # And one of the following + gmailieer + isync + offlineimap +]; +#+END_SRC + +[[https://github.com/Emiller88/dotfiles/blob/319841bd3b89e59b01d169137cceee3183aba4fc/modules/shell/mail.nix][An example of setting up mbsync and notmuch with home-manager]] + +** TODO openSUSE +** TODO Debian/Ubuntu +* TODO Features + +* Configuration +** TODO Gmailier +** offlineimap +This module uses =Gmailier= by default. To use =offlineimap=, change ~+notmuch-sync-backend~: + +#+BEGIN_SRC emacs-lisp +(setq +notmuch-sync-backend 'offlineimap) +#+END_SRC + +Next, you need to write a configuration file for =offlineimap=. Mine can be found +[[https://github.com/hlissner/dotfiles/tree/master/shell/mu][in my dotfiles repository]]. It is configured to download mail to ~\~/.mail~. I +use [[https://www.passwordstore.org/][unix pass]] to securely store my login credentials. You can find a *very* +detailed configuration [[https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf][here]]. + +Next you can download your email with ~offlineimap -o~. This may take a while, +especially if you have thousands of mails. + +You can now proceed with the [[*mu and mu4e][mu and mu4e]] section. + +** mbsync +This module uses =Gmailier= by default. To use =mbsync=, change ~+notmuch-sync-backend~: + +#+BEGIN_SRC emacs-lisp +(setq +notmuch-sync-backend 'mbsync) +#+END_SRC + +The steps needed to set up =mu4e= with =mbsync= are very similar to the ones for +[[*offlineimap][offlineimap]]. + +Start with writing a ~\~/.mbsyncrc~. An example for GMAIL can be found on +[[http://pragmaticemacs.com/emacs/migrating-from-offlineimap-to-mbsync-for-mu4e/][pragmaticemacs.com]]. A non-GMAIL example is available as a gist [[https://gist.github.com/agraul/60977cc497c3aec44e10591f94f49ef0][here]]. The [[http://isync.sourceforge.net/mbsync.html][manual +page]] contains all needed information to set up your own. + +Next you can download your email with ~mbsync --all~. This may take a while, but +should be quicker than =offlineimap= ;). + +You can now proceed with the [[*mu and mu4e][mu and mu4e]] section. + +** notmuch +You should have your email downloaded already. If you have not, you need to set +=Gmailier=, =offlineimap= or =mbsync= up before you proceed. + +Before you can use =notmuch=, you need to index your email initially. + +#+BEGIN_SRC sh +notmuch new +#+END_SRC + +* Troubleshooting From b24d545f5027a2a91ed0df422738e6c2d835de97 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 10 May 2020 05:11:55 -0400 Subject: [PATCH 067/105] Bump :lang clojure clojure-emacs/cider@d63e565 -> clojure-emacs/cider@3a59fe0 clojure-emacs/clojure-mode@c970c46 -> clojure-emacs/clojure-mode@da9f1ec We're also transitioning from abbreviated SHA1 hashes to full ones. See 45cdfb125 for why. --- modules/lang/clojure/packages.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/lang/clojure/packages.el b/modules/lang/clojure/packages.el index 3c143424a..32afe7388 100644 --- a/modules/lang/clojure/packages.el +++ b/modules/lang/clojure/packages.el @@ -1,9 +1,9 @@ ;; -*- no-byte-compile: t; -*- ;;; lang/clojure/packages.el -(package! clojure-mode :pin "c970c4605c") -(package! cider :pin "d63e5652fd") -(package! clj-refactor :pin "8259791e05") +(package! clojure-mode :pin "da9f1ec717dac1194404b4a4562dba6bd9a4ee3a") +(package! cider :pin "3a59fe046c9884573512dff88d140d37c0be7b2c") +(package! clj-refactor :pin "8259791e054382457b87d1f78061b5e3ce948907") (when (featurep! :checkers syntax) - (package! flycheck-clj-kondo :pin "5472c26ffd")) + (package! flycheck-clj-kondo :pin "5472c26ffdf754a0661357564874ffd4f8598805")) From 7e621e3787b2d5a9bac79fa1aa3891991ba96827 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 10 May 2020 05:22:02 -0400 Subject: [PATCH 068/105] Remove org-hide-leading-stars-before-indent-mode #3076 Org no longer uses this variable. --- docs/faq.org | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/faq.org b/docs/faq.org index 5a0c94f76..e8e632793 100644 --- a/docs/faq.org +++ b/docs/faq.org @@ -468,7 +468,6 @@ What can you do about it? (setq org-fontify-quote-and-verse-blocks nil org-fontify-whole-heading-line nil org-hide-leading-stars nil - org-hide-leading-stars-before-indent-mode nil org-startup-indented nil)) #+END_SRC 4. Turn on =M-x so-long-minor-mode=. This is a minor mode that disables From 1fccec181c4b773761a9c0a263a73604121ba0f6 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 10 May 2020 16:09:45 +0200 Subject: [PATCH 069/105] Unify org-agenda-clock bindings with org-clock Following b40d85e9b --- modules/lang/org/config.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 1e556547a..2079b5d01 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -707,12 +707,12 @@ between the two." :localleader "d" #'org-agenda-deadline (:prefix ("c" . "clock") - "c" #'org-agenda-clock-in - "C" #'org-agenda-clock-out + "c" #'org-agenda-clock-cancel "g" #'org-agenda-clock-goto + "i" #'org-agenda-clock-in + "o" #'org-agenda-clock-out "r" #'org-agenda-clockreport-mode - "s" #'org-agenda-show-clocking-issues - "x" #'org-agenda-clock-cancel) + "s" #'org-agenda-show-clocking-issues) "q" #'org-agenda-set-tags "r" #'org-agenda-refile "s" #'org-agenda-schedule From 58377e01c45b10f69508b25bb380233b83d0a45b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 10 May 2020 18:26:33 -0400 Subject: [PATCH 070/105] Correct DATE and SINCE --- modules/email/notmuch/README.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/email/notmuch/README.org b/modules/email/notmuch/README.org index 5fe167b42..9125f8dd4 100644 --- a/modules/email/notmuch/README.org +++ b/modules/email/notmuch/README.org @@ -1,6 +1,6 @@ #+TITLE: email/notmuch -#+DATE: July 31, 2018 -#+SINCE: v2.0.9 +#+DATE: May 5, 2019 +#+SINCE: v2.0 #+STARTUP: inlineimages * Table of Contents :TOC: From a634aaa4e8af510c9d9f90431d0b7c76c517d0b5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 10 May 2020 17:21:18 -0400 Subject: [PATCH 071/105] Bump :lang markdown jrblevin/markdown-mode@c927a11 -> jrblevin/markdown-mode@f47a2e9 ardumont/markdown-toc@eda9650 -> ardumont/markdown-toc@a9f13ee Somelauw/evil-markdown@46cd81b -> Somelauw/evil-markdown@685d7fb Reverts 35f18c5e74 because Somelauw/evil-markdown#1 was merged --- modules/lang/markdown/config.el | 4 ---- modules/lang/markdown/packages.el | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 448710520..d82e396db 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -92,10 +92,6 @@ capture, the end position, and the output buffer.") (use-package! evil-markdown :when (featurep! :editor evil +everywhere) :hook (markdown-mode . evil-markdown-mode) - :init - ;; REVIEW Until Somelauw/evil-markdown#1 is resolved: - (defun evil-disable-insert-state-bindings () - evil-disable-insert-state-bindings) :config (add-hook 'evil-markdown-mode-hook #'evil-normalize-keymaps) (map! :map evil-markdown-mode-map diff --git a/modules/lang/markdown/packages.el b/modules/lang/markdown/packages.el index dfe2f4572..9b7e2f921 100644 --- a/modules/lang/markdown/packages.el +++ b/modules/lang/markdown/packages.el @@ -1,8 +1,8 @@ ;; -*- no-byte-compile: t; -*- ;;; lang/markdown/packages.el -(package! markdown-mode :pin "c927a114b1b23cf7538181d62fd14679cce7fa25") -(package! markdown-toc :pin "eda9650a1bf0015e52e9678bd92b0a8beb1d7d71") +(package! markdown-mode :pin "f47a2e9796dfdde6fae7920af23647fe027dc34e") +(package! markdown-toc :pin "a9f13eecd0c7d8be960055dbc2d6f5d3fe6f40ca") (package! edit-indirect :pin "935ded353b9ed3da67bc61abf245c21b58d88864") (when (featurep! +grip) @@ -11,4 +11,4 @@ (when (featurep! :editor evil +everywhere) (package! evil-markdown :recipe (:host github :repo "Somelauw/evil-markdown") - :pin "46cd81b37991c4325fc24015a610f832b0ff995d")) + :pin "685d7fbb81bc02fa32779d2a127b99a0c8c7436b")) From e08b0d600ef18d150a020e59573064f061d6c853 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 10 May 2020 23:47:44 +0000 Subject: [PATCH 072/105] lookup: Update docs --- modules/tools/lookup/README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/lookup/README.org b/modules/tools/lookup/README.org index b4ecf508e..6ccbf35be 100644 --- a/modules/tools/lookup/README.org +++ b/modules/tools/lookup/README.org @@ -82,7 +82,7 @@ export PATH="/usr/local/opt/sqlite/bin:$PATH" ** Arch Linux #+BEGIN_SRC sh sudo pacman -S sqlite ripgrep -sudo yay -S wordnet-cli +yay -S wordnet-cli #+END_SRC ** NixOS From 9662523fba6c29d91ca35d8f22106e3e4ae07c46 Mon Sep 17 00:00:00 2001 From: John Hamelink Date: Mon, 11 May 2020 02:19:26 +0100 Subject: [PATCH 073/105] UPDATE: "Contribute" link in toc of README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 755b648e6..bdac8ddf2 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ - [Install](#install) - [Roadmap](#roadmap) - [Getting help](#getting-help) -- [Contributing](#contributing) +- [Contribute](#contribute) # Introduction From 395c4e593b085e56164564c7298a989144415b7a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 10 May 2020 18:46:44 -0400 Subject: [PATCH 074/105] Bump :lang emacs-lisp Fanael/highlight-quoted@2410347 -> Fanael/highlight-quoted@2410347 jorgenschaefer/emacs-buttercup@a91f282 -> jorgenschaefer/emacs-buttercup@532d082 xuchunyang/elisp-demos@57dd4ae -> xuchunyang/elisp-demos@4cd55a3 We're also transitioning from abbreviated SHA1 hashes to full ones. See 45cdfb125 for why. --- modules/lang/emacs-lisp/packages.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/lang/emacs-lisp/packages.el b/modules/lang/emacs-lisp/packages.el index a72ea6124..f4b918316 100644 --- a/modules/lang/emacs-lisp/packages.el +++ b/modules/lang/emacs-lisp/packages.el @@ -3,15 +3,16 @@ (package! elisp-mode :built-in t) -(package! highlight-quoted :pin "2410347815") +;; Fontification plugins +(package! highlight-quoted :pin "24103478158cd19fbcfb4339a3f1fa1f054f1469") ;; Tools -(package! macrostep :pin "424e3734a1") -(package! overseer :pin "02d49f582e") -(package! elisp-def :pin "368b04da68") -(package! elisp-demos :pin "57dd4ae3e4") +(package! macrostep :pin "424e3734a1ee526a1bd7b5c3cd1d3ef19d184267") +(package! overseer :pin "02d49f582e80e36b4334c9187801c5ecfb027789") +(package! elisp-def :pin "368b04da68783601b52e3169312183381871cf9e") +(package! elisp-demos :pin "4cd55a30d5dbd8d36a0e6f87261c4fef17fc6db0") (when (featurep! :checkers syntax) - (package! flycheck-cask :pin "3457ae553c")) + (package! flycheck-cask :pin "3457ae553c4feaf8168008f063d78fdde8fb5f94")) ;; Libraries -(package! buttercup :pin "a91f282025") +(package! buttercup :pin "532d082a363add4f6d9838ca3f924a773ce12136") From 91d7747c0bf9f60156d2f72ec3e2f079a9c16555 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 00:17:16 -0400 Subject: [PATCH 075/105] Bump :lang ruby arthurnn/minitest-emacs@97d7d17 -> arthurnn/minitest-emacs@ddd152c asok/projectile-rails@0398d94 -> asok/projectile-rails@11980b2 We're also transitioning from abbreviated SHA1 hashes to full ones. See 45cdfb125 for why. --- modules/lang/ruby/packages.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/lang/ruby/packages.el b/modules/lang/ruby/packages.el index 22060e9b3..69dd672a3 100644 --- a/modules/lang/ruby/packages.el +++ b/modules/lang/ruby/packages.el @@ -3,34 +3,34 @@ ;; Major modes (package! ruby-mode :built-in t) -(package! yard-mode :pin "ba74a47463") +(package! yard-mode :pin "ba74a47463b0320ae152bd42a7dd7aeecd7b5748") ;; REPL -(package! inf-ruby :pin "41e5ed3a88") +(package! inf-ruby :pin "41e5ed3a886fca56990486f1987bb3bae0dbd54b") (when (featurep! :completion company) - (package! company-inf-ruby :pin "fe3e4863bc")) + (package! company-inf-ruby :pin "fe3e4863bc971fbb81edad447efad5795ead1b17")) ;; Programming environment -(package! rubocop :pin "03bf15558a") -(package! robe :pin "68503b32bb") +(package! rubocop :pin "03bf15558a6eb65e4f74000cab29412efd46660e") +(package! robe :pin "68503b32bb3a005787ecb7a7fdeb3bb4a2317e2b") ;; Project tools -(package! bundler :pin "43efb6be4e") -(package! rake :pin "9c204334b0") +(package! bundler :pin "43efb6be4ed118b06d787ce7fbcffd68a31732a7") +(package! rake :pin "9c204334b03b4e899fadae6e59c20cf105404128") ;; Environment management (when (featurep! +rbenv) - (package! rbenv :pin "2ea1a5bdc1")) + (package! rbenv :pin "2ea1a5bdc1266caef1dd77700f2c8f42429b03f1")) (when (featurep! +rvm) - (package! rvm :pin "134497bc46")) + (package! rvm :pin "134497bc460990c71ab8fa75431156e62c17da2d")) (when (featurep! +chruby) - (package! chruby :pin "42bc6d521f")) + (package! chruby :pin "42bc6d521f832eca8e2ba210f30d03ad5529788f")) ;; Testing frameworks -(package! rspec-mode :pin "9a2a9d2935") -(package! minitest :pin "97d7d1760b") +(package! rspec-mode :pin "9a2a9d2935ae17b8570485bdea7c347533b464f6") +(package! minitest :pin "ddd152c990a528ad09a696bfad23afa4330ea4d7") ;; Rails (when (featurep! +rails) - (package! projectile-rails :pin "0398d940a2") - (package! inflections :pin "e4f1372cf2")) + (package! projectile-rails :pin "11980b2bcb99208888856a9b8666ff329b6f0142") + (package! inflections :pin "e4f1372cf22e811faca52fc86bdd5d817498a4d8")) From 05e1c0d782c1db40a58e88d725bf115b68538509 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 02:58:31 -0400 Subject: [PATCH 076/105] Bump :lang org Kungsgeten/org-brain@ae7fe0f -> Kungsgeten/org-brain@ed99f7e emacs-straight/org-mode@b171ff0 -> emacs-straight/org-mode@20c1322 jethrokuan/company-org-roam@0913d86 -> jethrokuan/company-org-roam@3da3821 jethrokuan/org-roam@689f559 -> jethrokuan/org-roam@ad5fca5 --- modules/lang/org/packages.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/lang/org/packages.el b/modules/lang/org/packages.el index 62af344b5..55db471a0 100644 --- a/modules/lang/org/packages.el +++ b/modules/lang/org/packages.el @@ -27,7 +27,7 @@ :recipe (:host github :repo "emacs-straight/org-mode" :files ("*.el" "lisp/*.el" "contrib/lisp/*.el")) - :pin "b171ff02f6e69bcce0dec56ea23e11c75e558704") + :pin "20c13221942183290dc440ca6ba91597f243b9e7") ;; ...And prevent other packages from pulling org; org-plus-contrib satisfies ;; the dependency already: https://github.com/raxod502/straight.el/issues/352 (package! org :recipe (:local-repo nil)) @@ -51,7 +51,7 @@ (when (featurep! :tools magit) (package! orgit :pin "e147f055772cc934fe1f1d8619059badeb647c93")) (when (featurep! +brain) - (package! org-brain :pin "ae7fe0f628bd093526786ece6917f7a4310e5e4d")) + (package! org-brain :pin "ed99f7e38dd687800fb898f8934a0da0541ebcd9")) (when (featurep! +dragndrop) (package! org-download :pin "d248fcb8f2592a40507682e91eed9a31ead4e4a6")) (when (featurep! +gnuplot) @@ -74,9 +74,9 @@ (package! org-tree-slide :pin "7bf09a02bd2d8f1ccfcb5209bfb18fbe02d1f44e") (package! org-re-reveal :pin "61549f4c00284a30e34caa3d76001b233ea5d2ad")) (when (featurep! +roam) - (package! org-roam :pin "689f55908048eede3cb65aa30ab990be3ac93263") + (package! org-roam :pin "ad5fca5440e5c8a6b8078013684df43b3e43d773") (when (featurep! :completion company) - (package! company-org-roam :pin "0913d86f167164e18831206e611f44bb8e7297e3"))) + (package! company-org-roam :pin "3da3821d1736e0d05a042bd944b74ea1da4a021b"))) ;;; Babel (package! ob-async :pin "80a30b96a007d419ece12c976a81804ede340311") From 84dce5d4ea35c70db7dffda187b82423caaf3d87 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 10 May 2020 18:44:50 -0400 Subject: [PATCH 077/105] Persist current page number for PDFs --- modules/tools/pdf/config.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/tools/pdf/config.el b/modules/tools/pdf/config.el index b1c74e782..c4bf24860 100644 --- a/modules/tools/pdf/config.el +++ b/modules/tools/pdf/config.el @@ -25,6 +25,18 @@ (setq pdf-view-use-scaling t pdf-view-use-imagemagick nil) + ;; Persist current page for PDF files viewed in Emacs + (add-hook! 'pdf-view-change-page-hook + (defun +pdf-remember-page-number-h () + (when buffer-file-name + (doom-store-put buffer-file-name (pdf-view-current-page) nil "pdf-view-page")))) + (add-hook! 'pdf-view-mode-hook + (defun +pdf-restore-page-number-h () + (when-let (page (doom-store-get buffer-file-name "pdf-view-page")) + (or (and (< page 1) + (> page (pdf-cache-number-of-pages))) + (pdf-view-goto-page page))))) + ;; Add retina support for MacOS users (when IS-MAC (advice-add #'pdf-util-frame-scale-factor :around #'+pdf--util-frame-scale-factor-a) From 037345cfd9859f6dc493d60ec00602c667f9759e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 10 May 2020 18:45:40 -0400 Subject: [PATCH 078/105] lang/emacs-lisp: reformat autoloads --- modules/lang/emacs-lisp/autoload.el | 125 ++++++++++++++-------------- 1 file changed, 61 insertions(+), 64 deletions(-) diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index 080bfbd02..2191695c2 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -67,6 +67,9 @@ library/userland functions" (byte-compile #'+emacs-lisp-highlight-vars-and-faces))) +;; +;;; Handlers + (defun +emacs-lisp--module-at-point () (let ((origin (point))) (save-excursion @@ -126,11 +129,52 @@ if it's callable, `apropos' otherwise." (thing (helpful-symbol (intern thing))) ((call-interactively #'helpful-at-point)))) -;; FIXME -;; (defun +emacs-lisp-lookup-file (thing) -;; (when-let (module (+emacs-lisp--module-at-point thing)) -;; (doom/help-modules (car module) (cadr module) 'visit-dir) -;; t)) +;;;###autoload +(defun +emacs-lisp-indent-function (indent-point state) + "A replacement for `lisp-indent-function'. + +Indents plists more sensibly. Adapted from +https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned" + (let ((normal-indent (current-column)) + (orig-point (point)) + ;; TODO Refactor `target' usage (ew!) + target) + (goto-char (1+ (elt state 1))) + (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) + (cond ((and (elt state 2) + (or (not (looking-at-p "\\sw\\|\\s_")) + (eq (char-after) ?:))) + (unless (> (save-excursion (forward-line 1) (point)) + calculate-lisp-indent-last-sexp) + (goto-char calculate-lisp-indent-last-sexp) + (beginning-of-line) + (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)) + (backward-prefix-chars) + (current-column)) + ((and (save-excursion + (goto-char indent-point) + (skip-syntax-forward " ") + (not (eq (char-after) ?:))) + (save-excursion + (goto-char orig-point) + (and (eq (char-after) ?:) + (eq (char-before) ?\() + (setq target (current-column))))) + (save-excursion + (move-to-column target t) + target)) + ((let* ((function (buffer-substring (point) (progn (forward-sexp 1) (point)))) + (method (or (function-get (intern-soft function) 'lisp-indent-function) + (get (intern-soft function) 'lisp-indent-hook)))) + (cond ((or (eq method 'defun) + (and (null method) + (> (length function) 3) + (string-match-p "\\`def" function))) + (lisp-indent-defform state indent-point)) + ((integerp method) + (lisp-indent-specform method state indent-point normal-indent)) + (method + (funcall method indent-point state)))))))) ;; @@ -170,6 +214,18 @@ if it's callable, `apropos' otherwise." load-path))) (buttercup-run-discover))) +;;;###autoload +(defun +emacs-lisp/edebug-instrument-defun-on () + "Toggle on instrumentalisation for the function under `defun'." + (interactive) + (eval-defun 'edebugit)) + +;;;###autoload +(defun +emacs-lisp/edebug-instrument-defun-off () + "Toggle off instrumentalisation for the function under `defun'." + (interactive) + (eval-defun nil)) + ;; ;;; Hooks @@ -234,62 +290,3 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'." (when (and start finish) (put-text-property start finish 'display "..."))))) nil) - -;;;###autoload -(defun +emacs-lisp-indent-function (indent-point state) - "A replacement for `lisp-indent-function'. - -Indents plists more sensibly. Adapted from -https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned" - (let ((normal-indent (current-column)) - (orig-point (point)) - ;; TODO Refactor `target' usage (ew!) - target) - (goto-char (1+ (elt state 1))) - (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) - (cond ((and (elt state 2) - (or (not (looking-at-p "\\sw\\|\\s_")) - (eq (char-after) ?:))) - (unless (> (save-excursion (forward-line 1) (point)) - calculate-lisp-indent-last-sexp) - (goto-char calculate-lisp-indent-last-sexp) - (beginning-of-line) - (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)) - (backward-prefix-chars) - (current-column)) - ((and (save-excursion - (goto-char indent-point) - (skip-syntax-forward " ") - (not (eq (char-after) ?:))) - (save-excursion - (goto-char orig-point) - (and (eq (char-after) ?:) - (eq (char-before) ?\() - (setq target (current-column))))) - (save-excursion - (move-to-column target t) - target)) - ((let* ((function (buffer-substring (point) (progn (forward-sexp 1) (point)))) - (method (or (function-get (intern-soft function) 'lisp-indent-function) - (get (intern-soft function) 'lisp-indent-hook)))) - (cond ((or (eq method 'defun) - (and (null method) - (> (length function) 3) - (string-match-p "\\`def" function))) - (lisp-indent-defform state indent-point)) - ((integerp method) - (lisp-indent-specform method state indent-point normal-indent)) - (method - (funcall method indent-point state)))))))) - -;;;###autoload -(defun +emacs-lisp/edebug-instrument-defun-on () - "Toggle on instrumentalisation for the function under `defun'." - (interactive) - (eval-defun 'edebugit)) - -;;;###autoload -(defun +emacs-lisp/edebug-instrument-defun-off () - "Toggle off instrumentalisation for the function under `defun'." - (interactive) - (eval-defun nil)) From 6c01d1a5acda57ca4ca5a96db9e3a002d9d96bf6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 00:16:17 -0400 Subject: [PATCH 079/105] Increase read-process-output-max for robe-mode It appears robe, like LSP, is very chatty, which can slow down Emacs. --- modules/lang/ruby/config.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/lang/ruby/config.el b/modules/lang/ruby/config.el index 125891497..ebd431c7f 100644 --- a/modules/lang/ruby/config.el +++ b/modules/lang/ruby/config.el @@ -50,6 +50,11 @@ (set-lookup-handlers! 'ruby-mode :definition #'robe-jump :documentation #'robe-doc) + (when (boundp 'read-process-output-max) + ;; Robe can over saturate IPC, making interacting with it slow/clobbering + ;; the GC, so increase the amount of data Emacs reads from it at a time. + (setq-hook! '(robe-mode-hook inf-ruby-mode-hook) + read-process-output-max (* 1024 1024))) (when (featurep! :editor evil) (add-hook 'robe-mode-hook #'evil-normalize-keymaps)) (map! :localleader From 31e4bfb2d4084ebcd2659472db9569b5cf8d84dd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 02:50:45 -0400 Subject: [PATCH 080/105] Don't unfold to 2nd level in org-mode by default This is too opinionated to be a default, and has thus been replaced with "unfold subtree around point when opening an org file", in case saveplace has restored the point to a folded region. --- modules/lang/org/autoload/org.el | 22 ++++++++-------------- modules/lang/org/config.el | 5 +---- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/modules/lang/org/autoload/org.el b/modules/lang/org/autoload/org.el index e66d03a09..c6266d55d 100644 --- a/modules/lang/org/autoload/org.el +++ b/modules/lang/org/autoload/org.el @@ -434,20 +434,14 @@ with `org-cycle')." t)) ;;;###autoload -(defun +org-unfold-to-2nd-level-or-point-h () - "Alters '#+STARTUP overview' to only expand first-level headings. -Expands the first level, but no further. If a different startup option was -provided, do that instead." - (unless org-agenda-inhibit-startup - ;; TODO Implement a custom #+STARTUP option? - (when (eq org-startup-folded t) - (outline-hide-sublevels +org-initial-fold-level)) - ;; If point was left somewhere deeper, unfold to point on startup. - (when (outline-invisible-p) - (ignore-errors - (save-excursion - (outline-previous-visible-heading 1) - (org-show-subtree)))))) +(defun +org-make-last-point-visible-h () + "Unfold subtree around point if saveplace places it to a folded region." + (and (not org-agenda-inhibit-startup) + (outline-invisible-p) + (ignore-errors + (save-excursion + (outline-previous-visible-heading 1) + (org-show-subtree))))) ;;;###autoload (defun +org-remove-occur-highlights-h () diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 2079b5d01..f358a39c7 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -50,9 +50,6 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default (defvar +org-capture-projects-file "projects.org" "Default, centralized target for org-capture templates.") -(defvar +org-initial-fold-level 2 - "The initial fold level of org files when no #+STARTUP options for it.") - (defvar +org-habit-graph-padding 2 "The padding added to the end of the consistency graph") @@ -991,7 +988,7 @@ compelling reason, so..." #'doom-disable-show-trailing-whitespace-h #'+org-enable-auto-reformat-tables-h #'+org-enable-auto-update-cookies-h - #'+org-unfold-to-2nd-level-or-point-h) + #'+org-make-last-point-visible-h) (add-hook! 'org-load-hook #'+org-init-org-directory-h From 23b5a6c1421bc4dd200d9b53c6ec3152733867b9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 02:53:18 -0400 Subject: [PATCH 081/105] lang/org: refactor how module loads flag features --- modules/lang/org/config.el | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index f358a39c7..78121f800 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -968,15 +968,8 @@ compelling reason, so..." )) ;;; Custom org modules - (if (featurep! +brain) (load! "contrib/brain")) - (if (featurep! +dragndrop) (load! "contrib/dragndrop")) - (if (featurep! +ipython) (load! "contrib/ipython")) - (if (featurep! +journal) (load! "contrib/journal")) - (if (featurep! +jupyter) (load! "contrib/jupyter")) - (if (featurep! +pomodoro) (load! "contrib/pomodoro")) - (if (featurep! +present) (load! "contrib/present")) - (if (featurep! +roam) (load! "contrib/roam")) - (if (featurep! +noter) (load! "contrib/noter")) + (dolist (flag doom--current-flags) + (load! (concat "contrib/" (substring (symbol-name flag) 1)))) ;; Add our general hooks after the submodules, so that any hooks the ;; submodules add run after them, and can overwrite any defaults if necessary. From bae9f916364128a4522329294a9e8ac3ab2bf863 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 02:57:45 -0400 Subject: [PATCH 082/105] Speed up +default/{find-in,browse}-notes This removes the 2-3s wait when using these two commands when the user has defined `org-directory` early. --- modules/config/default/autoload/files.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/config/default/autoload/files.el b/modules/config/default/autoload/files.el index e49e8255f..c672b69cb 100644 --- a/modules/config/default/autoload/files.el +++ b/modules/config/default/autoload/files.el @@ -28,13 +28,15 @@ (defun +default/browse-notes () "Browse files from `org-directory'." (interactive) - (require 'org) + (unless (boundp 'org-directory) + (require 'org)) (doom-project-browse org-directory)) ;;;###autoload (defun +default/find-in-notes () "Find a file under `org-directory', recursively." (interactive) - (require 'org) + (unless (boundp 'org-directory) + (require 'org)) (doom-project-find-file org-directory)) ;;;###autoload From 129eebcf2afa8132c843e047cf86450d362f6c62 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 03:03:41 -0400 Subject: [PATCH 083/105] Only configure org-habit if in org-modules Rather than force org-habit even on folks that don't use it. --- modules/lang/org/config.el | 40 +++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 78121f800..8e37a6116 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -436,27 +436,6 @@ underlying, modified buffer. This fixes that." (variable . "revealjs-url=https://revealjs.com"))))) -(defun +org-init-habit-h () - "TODO" - (add-hook! 'org-agenda-mode-hook - (defun +org-habit-resize-graph-h () - "Right align and resize the consistency graphs based on -`+org-habit-graph-window-ratio'" - (require 'org-habit) - (let* ((total-days (float (+ org-habit-preceding-days org-habit-following-days))) - (preceding-days-ratio (/ org-habit-preceding-days total-days)) - (graph-width (floor (* (window-width) +org-habit-graph-window-ratio))) - (preceding-days (floor (* graph-width preceding-days-ratio))) - (following-days (- graph-width preceding-days)) - (graph-column (- (window-width) (+ preceding-days following-days))) - (graph-column-adjusted (if (> graph-column +org-habit-min-width) - (- graph-column +org-habit-graph-padding) - nil))) - (setq-local org-habit-preceding-days preceding-days) - (setq-local org-habit-following-days following-days) - (setq-local org-habit-graph-column graph-column-adjusted))))) - - (defun +org-init-hacks-h () "Getting org to behave." ;; Open file links in current window, rather than new ones @@ -994,7 +973,6 @@ compelling reason, so..." #'+org-init-capture-frame-h #'+org-init-custom-links-h #'+org-init-export-h - #'+org-init-habit-h #'+org-init-hacks-h #'+org-init-keybinds-h #'+org-init-popup-rules-h @@ -1030,6 +1008,24 @@ compelling reason, so..." (setq org-id-track-globally t org-id-locations-file-relative t) + (add-hook! 'org-agenda-mode-hook + (defun +org-habit-resize-graph-h () + "Right align and resize the consistency graphs based on +`+org-habit-graph-window-ratio'" + (when (featurep 'org-habit) + (let* ((total-days (float (+ org-habit-preceding-days org-habit-following-days))) + (preceding-days-ratio (/ org-habit-preceding-days total-days)) + (graph-width (floor (* (window-width) +org-habit-graph-window-ratio))) + (preceding-days (floor (* graph-width preceding-days-ratio))) + (following-days (- graph-width preceding-days)) + (graph-column (- (window-width) (+ preceding-days following-days))) + (graph-column-adjusted (if (> graph-column +org-habit-min-width) + (- graph-column +org-habit-graph-padding) + nil))) + (setq-local org-habit-preceding-days preceding-days) + (setq-local org-habit-following-days following-days) + (setq-local org-habit-graph-column graph-column-adjusted))))) + ;; HACK `org-id' doesn't check if `org-id-locations-file' exists or is ;; writeable before trying to read/write to it. (defadvice! +org--fail-gracefully-a (&rest _) From f9a677427e480be5b89ea5072ee1148ee1f6ba1f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 03:08:37 -0400 Subject: [PATCH 084/105] Replace save-after-refile advice with hook A hook is better than an advice, which could break with an update. Also, reformat org-mks advice. --- modules/lang/org/config.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 8e37a6116..be195e05f 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -319,11 +319,17 @@ I like: (after! org-capture (org-capture-put :kill-buffer t)) + ;; Fix #462: when refiling from org-capture, Emacs prompts to kill the + ;; underlying, modified buffer. This fixes that. + (add-hook 'org-after-refile-insert-hook #'save-buffer) + ;; HACK Doom doesn't support `customize'. Best not to advertise it as an ;; option in `org-capture's menu. (defadvice! +org--remove-customize-option-a (orig-fn table title &optional prompt specials) :around #'org-mks - (funcall orig-fn table title prompt (remove '("C" "Customize org-capture-templates") specials))) + (funcall orig-fn table title prompt + (remove '("C" "Customize org-capture-templates") + specials))) (defadvice! +org--capture-expand-variable-file-a (file) "If a variable is used for a file path in `org-capture-template', it is used @@ -334,13 +340,6 @@ relative to `org-directory', unless it is an absolute path." (expand-file-name (symbol-value file) org-directory) file)) - (defadvice! +org--prevent-save-prompts-when-refiling-a (&rest _) - "Fix #462: when refiling from org-capture, Emacs prompts to kill the -underlying, modified buffer. This fixes that." - :after #'org-refile - (when (bound-and-true-p org-capture-is-refiling) - (org-save-all-org-buffers))) - (add-hook! 'org-capture-mode-hook (defun +org-show-target-in-capture-header-h () (setq header-line-format From 7cf2109b1a0ca43f2a8567db1da0c426477c6cab Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 04:53:39 -0400 Subject: [PATCH 085/105] Don't error on missing org contrib feature --- modules/lang/org/config.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index be195e05f..88f43cf32 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -947,7 +947,7 @@ compelling reason, so..." ;;; Custom org modules (dolist (flag doom--current-flags) - (load! (concat "contrib/" (substring (symbol-name flag) 1)))) + (load! (concat "contrib/" (substring (symbol-name flag) 1)) nil t)) ;; Add our general hooks after the submodules, so that any hooks the ;; submodules add run after them, and can overwrite any defaults if necessary. From 1529dcaaf57fc8a7ba3681931bb03cfad222fac6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 05:32:51 -0400 Subject: [PATCH 086/105] Fix #3007: wrong-type-arg stringp on eshell completion --- modules/term/eshell/config.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index 217fa6ff4..595b17248 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -181,5 +181,5 @@ You should use `set-eshell-alias!' to change this.") ;; installed for bash completion to work. How frustrating. This way we ;; can at least get bash completion whether or not fish is present. (defadvice! +eshell--fallback-to-bash-a (&rest _) - :before-while #'fish-completion--list-completions-with-desc - (executable-find "fish"))) + :before-until #'fish-completion--list-completions-with-desc + (unless (executable-find "fish") ""))) From f586ae76631203b8ccc63e2d67d19f6bd965e358 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Mon, 11 May 2020 11:20:09 -0500 Subject: [PATCH 087/105] Add open email bindings --- modules/config/default/+emacs-bindings.el | 9 ++++++++- modules/config/default/+evil-bindings.el | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index ac6310c75..f85c6850b 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -202,7 +202,14 @@ :desc "Send to Launchbar" "l" #'+macos/send-to-launchbar :desc "Send project to Launchbar" "L" #'+macos/send-project-to-launchbar) (:when (featurep! :tools docker) - :desc "Docker" "D" #'docker)) + :desc "Docker" "D" #'docker) + (:when (featurep! :email mu4e) + :desc "mu4e" "m" #'=mu4e) + (:when (featurep! :email notmuch) + :desc "notmuch" "m" #'=notmuch) + (:when (featurep! :email wanderlust) + :desc "wanderlust" "m" #'=wanderlust)) + ;;; p --- project (:prefix ("p" . "project") diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 2cc5d3f40..5b7834829 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -549,7 +549,13 @@ :desc "Send to Launchbar" "l" #'+macos/send-to-launchbar :desc "Send project to Launchbar" "L" #'+macos/send-project-to-launchbar) (:when (featurep! :tools docker) - :desc "Docker" "D" #'docker)) + :desc "Docker" "D" #'docker) + (:when (featurep! :email mu4e) + :desc "mu4e" "m" #'=mu4e) + (:when (featurep! :email notmuch) + :desc "notmuch" "m" #'=notmuch) + (:when (featurep! :email wanderlust) + :desc "wanderlust" "m" #'=wanderlust)) ;;; p --- project (:prefix-map ("p" . "project") From f8eb30653417919898da730c4852f3f8ecb6d967 Mon Sep 17 00:00:00 2001 From: Justin Smestad Date: Mon, 11 May 2020 11:17:23 -0600 Subject: [PATCH 088/105] Update README to point to new elixir-ls org Now that the JakeBecker project has been [moved](https://github.com/JakeBecker/elixir-ls/commit/9d4c1485e951b7ebdc0ed5b4f521451c5c99ad68), update the README. --- modules/lang/elixir/README.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/lang/elixir/README.org b/modules/lang/elixir/README.org index 1ae98cf91..b1a703e2f 100644 --- a/modules/lang/elixir/README.org +++ b/modules/lang/elixir/README.org @@ -16,10 +16,10 @@ * Description This module provides support for [[https://elixir-lang.org/][Elixir programming language]] via [[https://github.com/tonini/alchemist.el][alchemist.el]] -or [[https://github.com/JakeBecker/elixir-ls/][elixir-ls]]. +or [[https://github.com/elixir-lsp/elixir-ls/][elixir-ls]]. ** Module flags -+ ~+lsp~ Enable LSP support. Requires [[https://github.com/JakeBecker/elixir-ls/][elixir-ls]]. ++ ~+lsp~ Enable LSP support. Requires [[https://github.com/elixir-lsp/elixir-ls/][elixir-ls]]. ** Plugins + [[https://github.com/elixir-editors/emacs-elixir][elixir-mode]] From 5e7d6849273079c39030c3a00f86c511ef70e0d6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 15:31:16 -0400 Subject: [PATCH 089/105] Fix #3089: undo-fu-mode not enabled early enough --- modules/emacs/undo/config.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/emacs/undo/config.el b/modules/emacs/undo/config.el index 9a289f922..f66e89153 100644 --- a/modules/emacs/undo/config.el +++ b/modules/emacs/undo/config.el @@ -2,7 +2,7 @@ (use-package! undo-fu :unless (featurep! +tree) - :after-call doom-switch-buffer after-find-file + :after-call doom-switch-buffer-hook after-find-file :init (after! undo-tree (global-undo-tree-mode -1)) From 24164f48692f25edd2d607c5f7917d58318898ab Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 16:16:58 -0400 Subject: [PATCH 090/105] Disable use-package's :ensure t property by default Many packages recommend setting up their packages with something like: (use-package PACKAGE :ensure t ...) New users will frequently copy these into their config, then experience long startup times or a cryptic error about the package failing to install. This is because `:ensure t`, by default, uses package.el (Emacs' built-in package manager) to check for and install packages, but Doom doesn't use package.el, it uses straight.el. So we disable `:ensure`. On the other hand, if the user has loaded `package` by hand, then we should assume that they know what they're doing, and restore the old behavior. --- core/core-modules.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/core-modules.el b/core/core-modules.el index c866e1289..b50fdd33c 100644 --- a/core/core-modules.el +++ b/core/core-modules.el @@ -254,6 +254,17 @@ This value is cached. If REFRESH-P, then don't use the cached value." ;; Macros are already fontified, no need for this (font-lock-remove-keywords 'emacs-lisp-mode use-package-font-lock-keywords) + ;; A common mistake for new users is that they inadvertantly try to install + ;; their packages with package.el, by copying over old `use-package' + ;; declarations with an :ensure t property. Doom doesn't use package.el, so + ;; this will throw an error that will confuse beginners. + (setq use-package-ensure-function #'ignore) + ;; ...On the other hand, if the user has loaded `package', then we should + ;; assume they know what they're doing and restore the old behavior: + (add-transient-hook! 'package-initialize + (when (eq use-package-ensure-function #'ignore) + (setq use-package-ensure-function #'use-package-ensure-elpa))) + ;; We define :minor and :magic-minor from the `auto-minor-mode' package here ;; so we don't have to load `auto-minor-mode' so early. (dolist (keyword '(:minor :magic-minor)) From 63ab88105f7c64b9b3e59546906ec5fe5857303a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 16:22:15 -0400 Subject: [PATCH 091/105] Fix #3090: distinguish C-i from TAB --- core/core-keybinds.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/core-keybinds.el b/core/core-keybinds.el index 0e89a270c..634493c30 100644 --- a/core/core-keybinds.el +++ b/core/core-keybinds.el @@ -30,6 +30,14 @@ and Emacs states, and for non-evil users.") (setq mac-command-modifier 'super mac-option-modifier 'meta)) +;; HACK Emacs cannot distinguish C-i from TAB, which is disturbing. Instead, +;; let's at least make GUI Emacs aware of this distinction: +(define-key key-translation-map [?\C-i] + (λ! (if (and (not (cl-position 'tab (this-single-command-raw-keys))) + (not (cl-position 'kp-tab (this-single-command-raw-keys))) + (display-graphic-p)) + [C-i] [?\C-i]))) + ;; ;;; Universal, non-nuclear escape From 487b1927e207750580363b0a0ef963cd8d16238f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 17:11:36 -0400 Subject: [PATCH 092/105] Bump :lang go dominikh/go-mode.el@10d6ab4 -> dominikh/go-mode.el@734d523 We're also transitioning from abbreviated SHA1 hashes to full ones. See 45cdfb125 for why. --- modules/lang/go/packages.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/lang/go/packages.el b/modules/lang/go/packages.el index fe58f0329..2008ca56c 100644 --- a/modules/lang/go/packages.el +++ b/modules/lang/go/packages.el @@ -1,15 +1,15 @@ ;; -*- no-byte-compile: t; -*- ;;; lang/go/packages.el -(package! go-eldoc :pin "cbbd2ea1e9") -(package! go-guru :pin "10d6ab43d9") -(package! go-mode :pin "10d6ab43d9") -(package! gorepl-mode :pin "6a73bf352e") -(package! go-tag :pin "59b243f2fa") -(package! go-gen-test :pin "44c202ac97") +(package! go-eldoc :pin "cbbd2ea1e94a36004432a9ac61414cb5a95a39bd") +(package! go-guru :pin "734d5232455ffde088021ea5908849ac570e890f") +(package! go-mode :pin "734d5232455ffde088021ea5908849ac570e890f") +(package! gorepl-mode :pin "6a73bf352e8d893f89cad36c958c4db2b5e35e07") +(package! go-tag :pin "59b243f2fa079d9de9d56f6e2d94397e9560310a") +(package! go-gen-test :pin "44c202ac97e728e93a35cee028a0ea8dd6e4292c") (when (featurep! :completion company) - (package! company-go :pin "4acdcbdea7")) + (package! company-go :pin "4acdcbdea79de6b3dee1c637eca5cbea0fdbe37c")) (when (featurep! :checkers syntax) - (package! flycheck-golangci-lint :pin "8e446c6831")) + (package! flycheck-golangci-lint :pin "8e446c68311048f0b87febf8ef0379e29d358851")) From 24aabfc8e025f1c51e9b6f5907288b6a40d2d33d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 19:43:52 -0400 Subject: [PATCH 093/105] Fix #3098: wrong-number-of-args on some interactive closures It appears key-translation-map keybinds are passed an argument, but `lambda!` and `lambda!!` produce 0-arity closures. Closes #3099 --- core/core-lib.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index 0dd055f72..85146ea4c 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -157,7 +157,7 @@ at the values with which this function was called." A factory for quickly producing interaction commands, particularly for keybinds or aliases." (declare (doc-string 1) (pure t) (side-effect-free t)) - `(lambda () (interactive) ,@body)) + `(lambda (&rest _) (interactive) ,@body)) (defalias 'lambda! 'λ!) (defun λ!! (command &optional arg) @@ -165,7 +165,7 @@ or aliases." A factory for quickly producing interactive, prefixed commands for keybinds or aliases." (declare (doc-string 1) (pure t) (side-effect-free t)) - (lambda () (interactive) + (lambda (&rest _) (interactive) (let ((current-prefix-arg arg)) (call-interactively command)))) (defalias 'lambda!! 'λ!!) From de27b2c041db991401677b82d3b1515027ca6c3f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 22:09:17 -0400 Subject: [PATCH 094/105] Preserve current directory when splitting eshell Fixes #3091 --- modules/term/eshell/autoload/eshell.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/term/eshell/autoload/eshell.el b/modules/term/eshell/autoload/eshell.el index 2468012e9..0a4604a0b 100644 --- a/modules/term/eshell/autoload/eshell.el +++ b/modules/term/eshell/autoload/eshell.el @@ -21,13 +21,15 @@ t)) (defun +eshell--bury-buffer (&optional dedicated-p) - (unless (switch-to-prev-buffer nil 'bury) - (switch-to-buffer (doom-fallback-buffer))) - (when (eq major-mode 'eshell-mode) - (switch-to-buffer (doom-fallback-buffer))) - (when +eshell-enable-new-shell-on-split - (when-let (win (get-buffer-window (+eshell/here))) - (set-window-dedicated-p win dedicated-p)))) + (let ((directory default-directory)) + (unless (switch-to-prev-buffer nil 'bury) + (switch-to-buffer (doom-fallback-buffer))) + (when (eq major-mode 'eshell-mode) + (switch-to-buffer (doom-fallback-buffer))) + (when +eshell-enable-new-shell-on-split + (let ((default-directory directory)) + (when-let (win (get-buffer-window (+eshell/here t))) + (set-window-dedicated-p win dedicated-p)))))) (defun +eshell--setup-window (window &optional flag) (when (window-live-p window) From 272d8867af02c57967abdfc3b1838c45f6a1913c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 May 2020 22:11:33 -0400 Subject: [PATCH 095/105] Rename file to store last pdf page Creating a new convention for Doom modules: values stored with the `doom-store` library should be kept in a file named after the package that uses it. --- modules/tools/pdf/config.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tools/pdf/config.el b/modules/tools/pdf/config.el index c4bf24860..f18e86f31 100644 --- a/modules/tools/pdf/config.el +++ b/modules/tools/pdf/config.el @@ -29,10 +29,10 @@ (add-hook! 'pdf-view-change-page-hook (defun +pdf-remember-page-number-h () (when buffer-file-name - (doom-store-put buffer-file-name (pdf-view-current-page) nil "pdf-view-page")))) + (doom-store-put buffer-file-name (pdf-view-current-page) nil "pdf-view")))) (add-hook! 'pdf-view-mode-hook (defun +pdf-restore-page-number-h () - (when-let (page (doom-store-get buffer-file-name "pdf-view-page")) + (when-let (page (doom-store-get buffer-file-name "pdf-view")) (or (and (< page 1) (> page (pdf-cache-number-of-pages))) (pdf-view-goto-page page))))) From 066119849d69c7edbc3150cb6d6ee4d647009439 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 04:53:27 -0400 Subject: [PATCH 096/105] Speed up IPC for windows users --- core/core.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/core.el b/core/core.el index 1ce4c6967..68422c0fe 100644 --- a/core/core.el +++ b/core/core.el @@ -291,7 +291,9 @@ users).") ;; Performance on Windows is considerably worse than elsewhere, especially if ;; WSL is involved. We'll need everything we can get. (when IS-WINDOWS - (setq w32-get-true-file-attributes nil)) ; slightly faster IO + (setq w32-get-true-file-attributes nil ; slightly faster IO + w32-pipe-read-delay 0 ; faster ipc + w32-pipe-buffer-size (* 64 1024))) ; read more at a time (was 4K) ;; Remove command line options that aren't relevant to our current OS; means ;; slightly less to process at startup. From bc5bbb177065fa9ea6968c0f6200295b5660f976 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 05:15:55 -0400 Subject: [PATCH 097/105] Fix #3102: move org-habit init back into hook --- modules/lang/org/config.el | 39 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 88f43cf32..44482e8f5 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -435,6 +435,26 @@ relative to `org-directory', unless it is an absolute path." (variable . "revealjs-url=https://revealjs.com"))))) +(defun +org-init-habit-h () + (add-hook! 'org-agenda-mode-hook + (defun +org-habit-resize-graph-h () + "Right align and resize the consistency graphs based on +`+org-habit-graph-window-ratio'" + (when (featurep 'org-habit) + (let* ((total-days (float (+ org-habit-preceding-days org-habit-following-days))) + (preceding-days-ratio (/ org-habit-preceding-days total-days)) + (graph-width (floor (* (window-width) +org-habit-graph-window-ratio))) + (preceding-days (floor (* graph-width preceding-days-ratio))) + (following-days (- graph-width preceding-days)) + (graph-column (- (window-width) (+ preceding-days following-days))) + (graph-column-adjusted (if (> graph-column +org-habit-min-width) + (- graph-column +org-habit-graph-padding) + nil))) + (setq-local org-habit-preceding-days preceding-days) + (setq-local org-habit-following-days following-days) + (setq-local org-habit-graph-column graph-column-adjusted)))))) + + (defun +org-init-hacks-h () "Getting org to behave." ;; Open file links in current window, rather than new ones @@ -972,6 +992,7 @@ compelling reason, so..." #'+org-init-capture-frame-h #'+org-init-custom-links-h #'+org-init-export-h + #'+org-init-habit-h #'+org-init-hacks-h #'+org-init-keybinds-h #'+org-init-popup-rules-h @@ -1007,24 +1028,6 @@ compelling reason, so..." (setq org-id-track-globally t org-id-locations-file-relative t) - (add-hook! 'org-agenda-mode-hook - (defun +org-habit-resize-graph-h () - "Right align and resize the consistency graphs based on -`+org-habit-graph-window-ratio'" - (when (featurep 'org-habit) - (let* ((total-days (float (+ org-habit-preceding-days org-habit-following-days))) - (preceding-days-ratio (/ org-habit-preceding-days total-days)) - (graph-width (floor (* (window-width) +org-habit-graph-window-ratio))) - (preceding-days (floor (* graph-width preceding-days-ratio))) - (following-days (- graph-width preceding-days)) - (graph-column (- (window-width) (+ preceding-days following-days))) - (graph-column-adjusted (if (> graph-column +org-habit-min-width) - (- graph-column +org-habit-graph-padding) - nil))) - (setq-local org-habit-preceding-days preceding-days) - (setq-local org-habit-following-days following-days) - (setq-local org-habit-graph-column graph-column-adjusted))))) - ;; HACK `org-id' doesn't check if `org-id-locations-file' exists or is ;; writeable before trying to read/write to it. (defadvice! +org--fail-gracefully-a (&rest _) From 82ddc863353294e5ce7f6ff21ec80238ed0cc534 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 19:38:56 -0400 Subject: [PATCH 098/105] Move RET & backspace fixes out of +smartparens feature Neither of these are tied to smartparens, and should be available to folks that have disabled +smartparens. --- modules/config/default/autoload/text.el | 24 ++++---- modules/config/default/config.el | 82 ++++++++++++------------- 2 files changed, 54 insertions(+), 52 deletions(-) diff --git a/modules/config/default/autoload/text.el b/modules/config/default/autoload/text.el index 01141cc6e..6d28f224b 100644 --- a/modules/config/default/autoload/text.el +++ b/modules/config/default/autoload/text.el @@ -50,8 +50,8 @@ If `buffer-file-name' isn't set, uses `default-directory'." (abbreviate-file-name path) (file-name-nondirectory path))))) - -(defun doom--backward-delete-whitespace-to-column () +;;;###autoload +(defun doom/backward-delete-whitespace-to-column () "Delete back to the previous column of whitespace, or as much whitespace as possible, or just one char if that's not possible." (interactive) @@ -74,7 +74,7 @@ possible, or just one char if that's not possible." ;; point and bol. ((and (not indent-tabs-mode) (not (bolp)) - (not (sp-point-in-string)) + (not (doom-point-in-string-p)) (save-excursion (>= (- (skip-chars-backward " \t")) tab-width))) (let ((movement (% (current-column) tab-width))) (when (= movement 0) @@ -97,7 +97,7 @@ possible, or just one char if that's not possible." { | } => {|} -+ Otherwise, resort to `doom--backward-delete-whitespace-to-column'. ++ Otherwise, resort to `doom/backward-delete-whitespace-to-column'. + Resorts to `delete-char' if n > 1" (interactive "p\nP") (or (integerp n) @@ -120,12 +120,14 @@ possible, or just one char if that's not possible." (save-excursion (insert-char ?\s (- ocol (current-column)) nil)))) ;; - ((and (= n 1) (bound-and-true-p smartparens-mode)) - (cond ((and (memq (char-before) (list ?\ ?\t)) - (save-excursion - (and (/= (skip-chars-backward " \t" (line-beginning-position)) 0) - (bolp)))) - (doom--backward-delete-whitespace-to-column)) + ((= n 1) + (cond ((or (not (featurep! +smartparens)) + (not (bound-and-true-p smartparens-mode)) + (and (memq (char-before) (list ?\ ?\t)) + (save-excursion + (and (/= (skip-chars-backward " \t" (line-beginning-position)) 0) + (bolp))))) + (doom/backward-delete-whitespace-to-column)) ((let* ((pair (ignore-errors (sp-get-thing))) (op (plist-get pair :op)) (cl (plist-get pair :cl)) @@ -144,6 +146,6 @@ possible, or just one char if that's not possible." (sp-insert-pair op) t) ((run-hook-with-args-until-success 'doom-delete-backward-functions)) - ((doom--backward-delete-whitespace-to-column))))))) + ((doom/backward-delete-whitespace-to-column))))))) ;; Otherwise, do simple deletion. ((delete-char (- n) killflag)))) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index bbfc1ade7..d941890ee 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -204,52 +204,52 @@ ;; This keybind allows * to skip over **. (map! :map markdown-mode-map - :ig "*" (λ! (if (looking-at-p "\\*\\* *$") - (forward-char 2) - (call-interactively 'self-insert-command))))) - - ;; Highjacks backspace to: - ;; a) balance spaces inside brackets/parentheses ( | ) -> (|) - ;; b) delete up to nearest column multiple of `tab-width' at a time - ;; c) close empty multiline brace blocks in one step: - ;; { - ;; | - ;; } - ;; becomes {|} - ;; d) refresh smartparens' :post-handlers, so SPC and RET expansions work - ;; even after a backspace. - ;; e) properly delete smartparen pairs when they are encountered, without - ;; the need for strict mode. - ;; f) do none of this when inside a string - (advice-add #'delete-backward-char :override #'+default--delete-backward-char-a)) - - ;; HACK Makes `newline-and-indent' continue comments (and more reliably). - ;; Consults `doom-point-in-comment-functions' to detect a commented - ;; region and uses that mode's `comment-line-break-function' to continue - ;; comments. If neither exists, it will fall back to the normal behavior - ;; of `newline-and-indent'. - ;; - ;; We use an advice here instead of a remapping because many modes define - ;; and remap to their own newline-and-indent commands, and tackling all - ;; those cases was judged to be more work than dealing with the edge - ;; cases on a case by case basis. - (defadvice! +default--newline-indent-and-continue-comments-a (&rest _) - "A replacement for `newline-and-indent'. - -Continues comments if executed from a commented line. Consults -`doom-point-in-comment-functions' to determine if in a comment." - :before-until #'newline-and-indent - (interactive "*") - (when (and +default-want-RET-continue-comments - (doom-point-in-comment-p) - (fboundp comment-line-break-function)) - (funcall comment-line-break-function nil) - t))) + :ig "*" (general-predicate-dispatch nil + (looking-at-p "\\*\\* *") + (λ! (forward-char 2))))))) ;; ;;; Keybinding fixes +;; Highjacks backspace to delete up to nearest column multiple of `tab-width' at +;; a time. If you have smartparens enabled, it will also: +;; a) balance spaces inside brackets/parentheses ( | ) -> (|) +;; b) close empty multiline brace blocks in one step: +;; { +;; | +;; } +;; becomes {|} +;; c) refresh smartparens' :post-handlers, so SPC and RET expansions work even +;; after a backspace. +;; d) properly delete smartparen pairs when they are encountered, without the +;; need for strict mode. +;; e) do none of this when inside a string +(advice-add #'delete-backward-char :override #'doom/backward-delete-whitespace-to-column) + +;; HACK Makes `newline-and-indent' continue comments (and more reliably). +;; Consults `doom-point-in-comment-functions' to detect a commented region +;; and uses that mode's `comment-line-break-function' to continue comments. +;; If neither exists, it will fall back to the normal behavior of +;; `newline-and-indent'. +;; +;; We use an advice here instead of a remapping because many modes define +;; and remap to their own newline-and-indent commands, and tackling all +;; those cases was judged to be more work than dealing with the edge cases +;; on a case by case basis. +(defadvice! +default--newline-indent-and-continue-comments-a (&rest _) + "A replacement for `newline-and-indent'. + +Continues comments if executed from a commented line. Consults +`doom-point-in-comment-functions' to determine if in a comment." + :before-until #'newline-and-indent + (interactive "*") + (when (and +default-want-RET-continue-comments + (doom-point-in-comment-p) + (fboundp comment-line-break-function)) + (funcall comment-line-break-function nil) + t)) + ;; This section is dedicated to "fixing" certain keys so that they behave ;; sensibly (and consistently with similar contexts). From 717d53c6665229a731c55b23f9786c86111b3474 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 19:59:14 -0400 Subject: [PATCH 099/105] Tweak GC settings, particularly for org & lsp These two modes are particularly expensive. This needs more testing. --- core/core.el | 12 ++++++------ modules/lang/org/config.el | 6 ++++++ modules/tools/lsp/config.el | 4 ++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/core/core.el b/core/core.el index 68422c0fe..bddab71ce 100644 --- a/core/core.el +++ b/core/core.el @@ -307,14 +307,14 @@ users).") ;; Adopt a sneaky garbage collection strategy of waiting until idle time to ;; collect; staving off the collector while the user is working. (when doom-interactive-mode - (setq gc-cons-percentage 0.6) + (setq gcmh-idle-delay 5 + gcmh-high-cons-threshold 16777216 ; 16mb + gcmh-verbose doom-debug-mode + gc-cons-percentage 0.6) (add-transient-hook! 'pre-command-hook (gcmh-mode +1)) (with-eval-after-load 'gcmh - (setq gcmh-idle-delay 10 - gcmh-high-cons-threshold 16777216 - gcmh-verbose doom-debug-mode ; 16mb - gc-cons-percentage 0.1) - (add-hook 'focus-out-hook #'gcmh-idle-garbage-collect))) + (setq gc-cons-percentage 0.1) + (add-hook 'focus-out-hook #'gcmh-idle-garbage-collect)) ;; HACK `tty-run-terminal-initialization' is *tremendously* slow for some ;; reason. Disabling it completely could have many side-effects, so we diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 44482e8f5..e685b74bb 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -462,6 +462,12 @@ relative to `org-directory', unless it is an absolute path." ;; Open directory links in dired (add-to-list 'org-file-apps '(directory . emacs)) + ;; HACK Org is known to use a lot of unicode symbols (and large org files tend + ;; to be especially memory hungry). Compounded with + ;; `inhibit-compacting-font-caches' being non-nil, org needs more memory + ;; to be performant. + (setq-hook! 'org-mode-hook gcmh-high-cons-threshold (* 2 gcmh-high-cons-threshold)) + ;; When you create a sparse tree and `org-indent-mode' is enabled, the ;; highlighting destroys the invisibility added by `org-indent-mode'. ;; Therefore, don't highlight when creating a sparse tree. diff --git a/modules/tools/lsp/config.el b/modules/tools/lsp/config.el index 51f18346e..d6a432146 100644 --- a/modules/tools/lsp/config.el +++ b/modules/tools/lsp/config.el @@ -91,6 +91,10 @@ This also logs the resolved project root, if found, so we know where we are." ;; development builds of Emacs 27 and above (or (not (boundp 'read-process-output-max)) (setq-local read-process-output-max (* 1024 1024))) + ;; REVIEW LSP causes a lot of allocations, with or without Emacs 27+'s + ;; native JSON library, so we up the GC threshold to stave off + ;; GC-induced slowdowns/freezes. + (setq-local gcmh-high-cons-threshold (* 2 gcmh-high-cons-threshold)) (prog1 (lsp-mode 1) (setq-local lsp-buffer-uri (lsp--buffer-uri)) ;; Announce what project root we're using, for diagnostic purposes From d7061c86630d82b34323a19d1bd00097c120d3dd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 20:07:11 -0400 Subject: [PATCH 100/105] Remap haskell-mode-jump-to-def-or-tag to +lookup/definition --- modules/lang/haskell/config.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/lang/haskell/config.el b/modules/lang/haskell/config.el index eab9a2adf..a65ce74fb 100644 --- a/modules/lang/haskell/config.el +++ b/modules/lang/haskell/config.el @@ -31,7 +31,9 @@ (map! :map haskell-mode-map :n "o" #'+haskell/evil-open-below - :n "O" #'+haskell/evil-open-above) + :n "O" #'+haskell/evil-open-above + (:when (featurep! :tools lookup) + [remap haskell-mode-jump-to-def-or-tag] #'+lookup/definition)) (map! :localleader :map haskell-mode-map From 2419990caadf707a89418892d22da3dbf3d5a32e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 20:19:41 -0400 Subject: [PATCH 101/105] s/doom-store-set/doom-store-put This was renamed in 4b28e9ce8 --- docs/api.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.org b/docs/api.org index 9c3f8e1c5..350249303 100644 --- a/docs/api.org +++ b/docs/api.org @@ -546,7 +546,7 @@ These are side-by-side comparisons, showing how to bind keys with and without (fullscreen . ,fullscreen)))))) (defun save-frame-dimensions () - (doom-store-set 'last-frame-size + (doom-store-put 'last-frame-size (list (frame-position) (frame-width) (frame-height) From 6d52baeb57c624db2d5724b9b4c83da1fd5c0b55 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 21:33:13 -0400 Subject: [PATCH 102/105] Fix end-of-file error Because I was a derp lord in 717d53c66, and always will be. --- core/core.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.el b/core/core.el index bddab71ce..f4d5aa9c6 100644 --- a/core/core.el +++ b/core/core.el @@ -314,7 +314,7 @@ users).") (add-transient-hook! 'pre-command-hook (gcmh-mode +1)) (with-eval-after-load 'gcmh (setq gc-cons-percentage 0.1) - (add-hook 'focus-out-hook #'gcmh-idle-garbage-collect)) + (add-hook 'focus-out-hook #'gcmh-idle-garbage-collect))) ;; HACK `tty-run-terminal-initialization' is *tremendously* slow for some ;; reason. Disabling it completely could have many side-effects, so we From cbd05afcc8810a7de0147f65fcf1ee3ed42fa909 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 21:39:00 -0400 Subject: [PATCH 103/105] Bump :emacs undo ideasman42/emacs-undo-fu-session@b808ef0 -> ideasman42/emacs-undo-fu-session@0400f15 ideasman42/emacs-undo-fu@0ce9ac3 -> ideasman42/emacs-undo-fu@2b1e532 --- modules/emacs/undo/packages.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/emacs/undo/packages.el b/modules/emacs/undo/packages.el index 8c21f4904..b40326f1e 100644 --- a/modules/emacs/undo/packages.el +++ b/modules/emacs/undo/packages.el @@ -3,5 +3,5 @@ (if (featurep! +tree) (package! undo-tree :pin "5b6df03781495d8a25695d846b0cce496d3d3058") - (package! undo-fu :pin "0ce9ac36144e80316fff50bfe1bc5dd7e5e7ded6") - (package! undo-fu-session :pin "b808ef0cdcdd2eef221c67eda567eed7fcb3d4af")) + (package! undo-fu :pin "2b1e53285a55ce50ca6fd60b050f2171e235d8f9") + (package! undo-fu-session :pin "0400f15f2a0cfcedb69c06c3ff62f3f8814b62fb")) From a63ee13f01480668233c3a2d39370ef957fb8f82 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 21:41:05 -0400 Subject: [PATCH 104/105] Bump :core Wilfred/helpful@c54e9dd -> Wilfred/helpful@c0662aa bbatsov/projectile@5cd261d -> bbatsov/projectile@768f057 domtronn/all-the-icons.el@0b74fc3 -> domtronn/all-the-icons.el@d6cb6d4 jscheid/dtrt-indent@9163cd9 -> jscheid/dtrt-indent@50c440c --- core/packages.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/packages.el b/core/packages.el index 4d6494314..986d1459a 100644 --- a/core/packages.el +++ b/core/packages.el @@ -6,7 +6,7 @@ (package! gcmh :pin "b1bde5089169a74f62033d027e06e98cbeedd43f") ;; core-ui.el -(package! all-the-icons :pin "0b74fc361817e885580c3f3408079f949f5830e1") +(package! all-the-icons :pin "d6cb6d4a779eaa3570d8e451fd4d38b2b4554860") (package! hide-mode-line :pin "88888825b5b27b300683e662fa3be88d954b1cea") (package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307") (package! rainbow-delimiters :pin "5125f4e47604ad36c3eb4706310fcafac729ca8c") @@ -14,8 +14,8 @@ ;; core-editor.el (package! better-jumper :pin "6d240032ca213ccb3347e25f26c29b6822bf03a7") -(package! dtrt-indent :pin "9163cd990fb1f43dafed3948c6e406c13a45a6be") -(package! helpful :pin "c54e9ddbd6a77858048c1a4c4b549de98af8f88e") +(package! dtrt-indent :pin "50c440c80e0d15303d8ab543bce4c56e9c2bf407") +(package! helpful :pin "c0662aa07266fe204f4e6d72ccaa6af089400556") (when IS-MAC (package! ns-auto-titlebar :pin "1efc30d38509647b417f05587fd7003457719256")) (package! pcre2el :pin "0b5b2a2c173aab3fd14aac6cf5e90ad3bf58fa7d") @@ -38,7 +38,7 @@ :pin "01b39044b9b65fa4ea7d3166f8b1ffab6f740362")) ;; core-projects.el -(package! projectile :pin "5cd261dd75f4d711c0016617621349e2a98b43aa") +(package! projectile :pin "768f0570cad57b6885c4472df803906d097cbc1a") ;; core-keybinds.el (package! general :pin "42e38034cd2305fa7432866323c923979d8f9b06") From a7c2cbab9042d0f19ff88efbdcf5a50e8a317035 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 May 2020 22:40:07 -0400 Subject: [PATCH 105/105] Fix #3110: wrong-number-of-args on backspace Due to a regression in 82ddc8633. --- modules/config/default/config.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index d941890ee..bb6c3a70d 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -225,7 +225,7 @@ ;; d) properly delete smartparen pairs when they are encountered, without the ;; need for strict mode. ;; e) do none of this when inside a string -(advice-add #'delete-backward-char :override #'doom/backward-delete-whitespace-to-column) +(advice-add #'delete-backward-char :override #'+default--delete-backward-char-a) ;; HACK Makes `newline-and-indent' continue comments (and more reliably). ;; Consults `doom-point-in-comment-functions' to detect a commented region