From 5346670ab089e1b9d7c86164f5c3341d2fe787a0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 19 Jul 2017 14:09:29 +0200 Subject: [PATCH 01/64] Add doom/recompile-packages (make compile:elpa) If you upgrade (or downgrade) Emacs, there may be byte-compilation errors. This works around that. --- Makefile | 3 +++ core/core-packages.el | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 2869cd93e..a8925cd12 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,9 @@ compile: init.el clean compile\:core: init.el clean @$(EMACS) -f doom/compile -- init.el core +compile\:elpa: init.el + @$(EMACS) -f doom/recompile-packages + $(patsubst %, compile\:%, $(MODULES)): init.el .local/autoloads.el @rm -fv $(shell find $(patsubst compile:%, modules/%, $@) -type f -name '*.elc') @$(EMACS) -f doom/compile -- $(patsubst compile:%, modules/%, $@) diff --git a/core/core-packages.el b/core/core-packages.el index fdf44c02d..312cd1163 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -632,6 +632,12 @@ If ONLY-RECOMPILE-P is non-nil, only recompile out-of-date files." ;; Forcibly recompile core.el in case `load-path' has changed (byte-recompile-file (expand-file-name "core.el" doom-core-dir) t)) +(defun doom/recompile-packages () + "Recompile all installed elpa packages. If you're getting odd errors after +upgrading Emacs, this may fix it." + (interactive) + (byte-recompile-directory package-user-dir 0 t)) + (defun doom/reset () "Clear the local cache completely (in `doom-cache-dir'). From 7e4a0dbe95613d321bd756c6a538d3cdc50f008b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 28 Jul 2017 19:54:23 +0200 Subject: [PATCH 02/64] Try to prevent wrong-type-argument font-spec error Addresses #164, #165 --- core/core-ui.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index 5b4d8e031..f076766cc 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -193,16 +193,21 @@ local value, whether or not it's permanent-local. Therefore, we cycle "Set the theme and load the font, in that order." (when doom-theme (load-theme doom-theme t)) - (when (display-graphic-p) - (with-demoted-errors "FONT ERROR: %s" - (when (fontp doom-font) - (set-frame-font doom-font nil (if frame (list frame) t))) - ;; Fallback to `doom-unicode-font' for Unicode characters - (when (fontp doom-unicode-font) - (set-fontset-font t 'unicode doom-unicode-font frame)) - ;; ...and for variable-pitch-mode: - (when (fontp doom-variable-pitch-font) - (set-face-attribute 'variable-pitch frame :font doom-variable-pitch-font)))) + (condition-case-unless-debug ex + (when (display-graphic-p) + (when (fontp doom-font) + (set-frame-font doom-font nil (if frame (list frame) t)) + (set-face-attribute 'fixed-pitch frame :font doom-font)) + ;; Fallback to `doom-unicode-font' for Unicode characters + (when (fontp doom-unicode-font) + (set-fontset-font t 'unicode doom-unicode-font frame)) + ;; ...and for variable-pitch-mode: + (when (fontp doom-variable-pitch-font) + (set-face-attribute 'variable-pitch frame :font doom-variable-pitch-font))) + ('error + (lwarn 'doom-ui :error + "Failed to set fonts because %s" + (error-message-string ex)))) (run-hooks 'doom-init-ui-hook)) (defun doom|reload-ui-in-daemon (frame) From ff9965e039bad886ec499c134a2145e195798a44 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 28 Jul 2017 23:59:27 +0200 Subject: [PATCH 03/64] Disable +pass-get-field in noninteractive session Otherwise you'll get pass pinentry prompts in while byte compiling. --- modules/tools/password-store/autoload.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/tools/password-store/autoload.el b/modules/tools/password-store/autoload.el index 0aa8e8657..9317b2310 100644 --- a/modules/tools/password-store/autoload.el +++ b/modules/tools/password-store/autoload.el @@ -12,11 +12,12 @@ ;;;###autoload (defun +pass-get-field (entry fields) - (if-let (data (if (listp entry) entry (auth-pass-parse-entry entry))) - (cl-loop for key in (doom-enlist fields) - when (assoc key data) - return (cdr it)) - (error "Couldn't find entry: %s" entry))) + (unless noninteractive + (if-let (data (if (listp entry) entry (auth-pass-parse-entry entry))) + (cl-loop for key in (doom-enlist fields) + when (assoc key data) + return (cdr it)) + (error "Couldn't find entry: %s" entry)))) ;;;###autoload (defun +pass-get-user (entry) From 9506cc9902e2fa72ec7542fb181f5449f29d05f9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 29 Jul 2017 00:00:19 +0200 Subject: [PATCH 04/64] Take 2 on auth-store-pass detection in Emacs 26+ --- modules/tools/password-store/config.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/tools/password-store/config.el b/modules/tools/password-store/config.el index 934862678..9782e7dd0 100644 --- a/modules/tools/password-store/config.el +++ b/modules/tools/password-store/config.el @@ -29,11 +29,14 @@ "C-k" #'pass-next-directory)) -(def-package! auth-password-store - :demand t - :config (auth-pass-enable)) - - (def-package! helm-pass :when (featurep! :completion helm) :commands helm-pass) + + +;; Is built into Emacs 26+ +(if (require 'auth-store-pass nil t) + (auth-source-pass-enable) + (def-package! auth-password-store + :demand t + :config (auth-pass-enable))) From 19dfb22fe0a2c02eb4b7c9e0191421ab346d016b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 29 Jul 2017 00:04:46 +0200 Subject: [PATCH 05/64] private/hlissner: wrap circe/mu4e configs in after! Not strictly necessary, but is more readable. --- modules/private/hlissner/config.el | 60 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/modules/private/hlissner/config.el b/modules/private/hlissner/config.el index ada99cd91..b6ea7b4cc 100644 --- a/modules/private/hlissner/config.el +++ b/modules/private/hlissner/config.el @@ -45,38 +45,40 @@ ;; app/irc -(setq +irc-notifications-watch-strings '("v0" "vnought" "hlissner")) +(after! circe + (setq +irc-notifications-watch-strings '("v0" "vnought" "hlissner")) -(set! :irc "irc.snoonet.org" - `(:tls t - :nick "v0" - :port 6697 - :sasl-username ,(+pass-get-user "irc/snoonet.org") - :sasl-password ,(+pass-get-secret "irc/snoonet.org") - :channels (:after-auth "#ynought"))) + (set! :irc "irc.snoonet.org" + `(:tls t + :nick "v0" + :port 6697 + :sasl-username ,(+pass-get-user "irc/snoonet.org") + :sasl-password ,(+pass-get-secret "irc/snoonet.org") + :channels (:after-auth "#ynought")))) ;; app/email -(setq smtpmail-stream-type 'starttls - smtpmail-default-smtp-server "smtp.gmail.com" - smtpmail-smtp-server "smtp.gmail.com" - smtpmail-smtp-service 587) +(after! mu4e + (setq smtpmail-stream-type 'starttls + smtpmail-default-smtp-server "smtp.gmail.com" + smtpmail-smtp-server "smtp.gmail.com" + smtpmail-smtp-service 587) -(set! :email "gmail.com" - '((mu4e-sent-folder . "/gmail.com/Sent Mail") - (mu4e-drafts-folder . "/gmail.com/Drafts") - (mu4e-trash-folder . "/gmail.com/Trash") - (mu4e-refile-folder . "/gmail.com/All Mail") - (smtpmail-smtp-user . "hlissner") - (user-mail-address . "hlissner@gmail.com") - (mu4e-compose-signature . "---\nHenrik"))) + (set! :email "gmail.com" + '((mu4e-sent-folder . "/gmail.com/Sent Mail") + (mu4e-drafts-folder . "/gmail.com/Drafts") + (mu4e-trash-folder . "/gmail.com/Trash") + (mu4e-refile-folder . "/gmail.com/All Mail") + (smtpmail-smtp-user . "hlissner") + (user-mail-address . "hlissner@gmail.com") + (mu4e-compose-signature . "---\nHenrik"))) -(set! :email "lissner.net" - '((mu4e-sent-folder . "/lissner.net/Sent Mail") - (mu4e-drafts-folder . "/lissner.net/Drafts") - (mu4e-trash-folder . "/lissner.net/Trash") - (mu4e-refile-folder . "/lissner.net/All Mail") - (smtpmail-smtp-user . "henrik@lissner.net") - (user-mail-address . "henrik@lissner.net") - (mu4e-compose-signature . "---\nHenrik Lissner")) - t) + (set! :email "lissner.net" + '((mu4e-sent-folder . "/lissner.net/Sent Mail") + (mu4e-drafts-folder . "/lissner.net/Drafts") + (mu4e-trash-folder . "/lissner.net/Trash") + (mu4e-refile-folder . "/lissner.net/All Mail") + (smtpmail-smtp-user . "henrik@lissner.net") + (user-mail-address . "henrik@lissner.net") + (mu4e-compose-signature . "---\nHenrik Lissner")) + t)) From a63640b120a2ebed3ffac536446dee4f737e51d0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 29 Jul 2017 00:30:42 +0200 Subject: [PATCH 06/64] Force interactive when running tests --- core/autoload/test.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/autoload/test.el b/core/autoload/test.el index e4c5d352b..2f226cd7f 100644 --- a/core/autoload/test.el +++ b/core/autoload/test.el @@ -77,7 +77,8 @@ If neither is available, run all tests in all enabled modules." finally do (quiet! (mapc #'load-file items))) ;; run all loaded tests (when noninteractive - (ert-run-tests-batch-and-exit))) + (let (noninteractive) + (ert-run-tests-batch-and-exit)))) ('error (lwarn 'doom-test :error "%s -> %s" From 749553993d4eb97f47ccb47ca99040c291b3adfa Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 3 Aug 2017 21:24:03 +0200 Subject: [PATCH 07/64] Remove org-mode custom fontification This has been merged into doom-themes. --- modules/org/org/config.el | 46 +-------------------------------------- modules/ui/doom/config.el | 3 +++ 2 files changed, 4 insertions(+), 45 deletions(-) diff --git a/modules/org/org/config.el b/modules/org/org/config.el index 80092d0f1..57b76421f 100644 --- a/modules/org/org/config.el +++ b/modules/org/org/config.el @@ -132,51 +132,7 @@ (when (or (featurep! :completion ivy) (featurep! :completion helm)) (setq-default org-completion-use-ido nil - org-outline-path-complete-in-steps nil)) - - ;; Custom fontification - (defsubst +org--tag-face (n) - (let ((kwd (match-string n))) - (or (and (equal kwd "#") 'org-tag) - (and (equal kwd "@") 'org-special-keyword)))) - - (defun +org|init-custom-fontification () - "Correct (and improve) org-mode's font-lock keywords. - - 1. Re-set `org-todo' & `org-headline-done' faces, to make them respect - underlying faces. - 2. Fontify item bullets - 3. Fontify item checkboxes (and when they're marked done) - 4. Fontify dividers/separators (5+ dashes) - 5. Fontify #hashtags and @at-tags, for personal convenience" - (let ((org-todo (format org-heading-keyword-regexp-format - org-todo-regexp)) - (org-done (format org-heading-keyword-regexp-format - (concat "\\(?:" (mapconcat #'regexp-quote org-done-keywords "\\|") "\\)")))) - (setq - org-font-lock-extra-keywords - (append (org-delete-all - `(("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]" - (0 (org-get-checkbox-statistics-face) t)) - (,org-todo (2 (org-get-todo-face 2) t)) - (,org-done (2 'org-headline-done t))) - org-font-lock-extra-keywords) - `((,org-todo (2 (org-get-todo-face 2) prepend)) - (,org-done (2 'org-headline-done prepend)) - ;; Make checkbox statistic cookies respect underlying faces - ("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]" - (0 (org-get-checkbox-statistics-face) prepend)) - ;; I like how org-mode fontifies checked TODOs and want this to extend to - ;; checked checkbox items: - ("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)" - 1 'org-headline-done prepend) - ;; make plain list bullets stand out - ("^ *\\([-+]\\|[0-9]+[).]\\) " 1 'org-list-dt append) - ;; and separators/dividers - ("^ *\\(-----+\\)$" 1 'org-meta-line) - ;; custom #hashtags & @at-tags for another level of organization - ("\\s-\\(\\([#@]\\)[^ \n.,]+\\)" 1 (+org--tag-face 2))))))) - (add-hook 'org-font-lock-set-keywords-hook #'+org|init-custom-fontification)) + org-outline-path-complete-in-steps nil))) (defun +org-init-keybinds () "Sets up org-mode and evil keybindings. Tries to fix the idiosyncrasies diff --git a/modules/ui/doom/config.el b/modules/ui/doom/config.el index 289606db2..e10082d58 100644 --- a/modules/ui/doom/config.el +++ b/modules/ui/doom/config.el @@ -16,6 +16,9 @@ (load "doom-themes-common.el" nil t)) (add-hook 'doom-pre-reload-theme-hook #'+doom|reload-theme) + ;; improve integration with org-mode + (add-hook 'doom-init-ui-hook #'doom-themes-org-config) + ;; blink mode-line on errors (add-hook 'doom-init-ui-hook #'doom-themes-visual-bell-config) From 0ad96a4100f417fea903d22150e1ec4839813052 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 4 Aug 2017 22:36:01 +0200 Subject: [PATCH 08/64] Switch to fallback buffer on kill-all-buffers --- core/autoload/buffers.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/autoload/buffers.el b/core/autoload/buffers.el index b5cf4846a..270953133 100644 --- a/core/autoload/buffers.el +++ b/core/autoload/buffers.el @@ -257,6 +257,8 @@ If PROJECT-P, kill all buffers that belong to the current project." (let ((buffers (if project-p (doom-project-buffer-list) (doom-buffer-list)))) (mapc #'doom-kill-buffer-and-windows buffers) (when (called-interactively-p 'interactive) + (unless (doom-real-buffer-p) + (switch-to-buffer (doom-fallback-buffer))) (message "Killed %s buffers" (length buffers))))) ;;;###autoload From ad516141d8474885b759ab90d844e751e2b144f1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 4 Aug 2017 22:36:36 +0200 Subject: [PATCH 09/64] Add r and d bindings for neotree --- modules/private/hlissner/+bindings.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/private/hlissner/+bindings.el b/modules/private/hlissner/+bindings.el index c9869a676..f5b12ca2c 100644 --- a/modules/private/hlissner/+bindings.el +++ b/modules/private/hlissner/+bindings.el @@ -552,6 +552,8 @@ :n "RET" #'neotree-enter :n [backspace] #'evil-window-prev :n "c" #'neotree-create-node + :n "r" #'neotree-rename-node + :n "d" #'neotree-delete-node :n "j" #'neotree-next-line :n "k" #'neotree-previous-line :n "n" #'neotree-next-line From 52d0dffba435bd1bc72562dfd45ea1b5a689e55b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 4 Aug 2017 22:48:06 +0200 Subject: [PATCH 10/64] Restore missing c++ lineup-arglist advice --- modules/lang/cc/autoload.el | 13 +++++++++++++ modules/lang/cc/config.el | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/lang/cc/autoload.el b/modules/lang/cc/autoload.el index 4b45f8a78..a6fd1c5ec 100644 --- a/modules/lang/cc/autoload.el +++ b/modules/lang/cc/autoload.el @@ -1,5 +1,18 @@ ;;; lang/cc/autoload.el -*- lexical-binding: t; -*- +;;;###autoload +(defun +cc*lineup-arglist (orig-fun &rest args) + "Improve indentation of continued C++11 lambda function opened as argument." + (if (and (eq major-mode 'c++-mode) + (ignore-errors + (save-excursion + (goto-char (c-langelem-pos langelem)) + ;; Detect "[...](" or "[...]{". preceded by "," or "(", + ;; and with unclosed brace. + (looking-at-p ".*[(,][ \t]*\\[[^]]*\\][ \t]*[({][^}]*$")))) + 0 ; no additional indent + (apply orig-fun args))) + ;;;###autoload (defun +cc/autoclose->-maybe () "For some reason smartparens won't autoskip >'s, this hack does." diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index 100993217..01a466a68 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -49,7 +49,7 @@ (sp-local-pair "/*!" "*/" :post-handlers '(("||\n[i]" "RET") ("[d-1]< | " "SPC")))) ;; Improve indentation of inline lambdas in C++11 - (advice-add #'c-lineup-arglist :around #'+c-lineup-arglist) + (advice-add #'c-lineup-arglist :around #'+cc*lineup-arglist) ;; C/C++ style settings (c-toggle-electric-state -1) From 7233d6f19ac9f984b8af0f0531fb45b16f30dc98 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 5 Aug 2017 13:17:48 +0200 Subject: [PATCH 11/64] bin/doom-doctor: load doom more comprehensively --- bin/doom-doctor | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/doom-doctor b/bin/doom-doctor index 2e05683b6..e8c3d44bf 100755 --- a/bin/doom-doctor +++ b/bin/doom-doctor @@ -100,8 +100,9 @@ (let (doom-core-packages doom-debug-mode) (condition-case ex (progn - (let ((inhibit-message t)) - (load "~/.emacs.d/core/core.el" nil t)) + (let ((inhibit-message t) + noninteractive) + (load "~/.emacs.d/init.el" nil t)) (doom-initialize-packages) (doom|finalize) (success! "Attempt to load DOOM: success! Loaded v%s" doom-version) From b65718691f667217c91fabc5a4ee42295975f270 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 5 Aug 2017 13:18:43 +0200 Subject: [PATCH 12/64] Improve font detection (+ all-the-icons fonts) #167 make doctor will now complain if it can't find any of the fonts that Doom uses, and offer help on how to install them. --- bin/doom-doctor | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/bin/doom-doctor b/bin/doom-doctor index e8c3d44bf..20ce2a469 100755 --- a/bin/doom-doctor +++ b/bin/doom-doctor @@ -130,14 +130,39 @@ ;; --- is the environment set up properly? -------------------- -(when (boundp 'doom-font) - (cond ((fboundp 'find-font) - (unless (find-font doom-font) - (warn! "Warning: couldn't find %s font" (font-get doom-font :family)) - (explain! "If you use a different font, you may ignore this warning."))) - (t - (warn! "Couldn't detect font!") - (explain! "This could indicate the incorrect version of Emacs is being used!")))) +;; are all default fonts present +(log! "test-fonts") +(if (not (fboundp 'find-font)) + (progn + (warn! "Warning: unable to detect font") + (explain! "The `find-font' function is missing. This could indicate the incorrect " + "version of Emacs is being used!")) + (defun -find-font (family) + (when (fontp family) + (setq family (symbol-name (font-get doom-font :family)))) + (let ((inhibit-message t)) + (shell-command (format "fc-list | grep %s" (shell-quote-argument family))))) + + (when (boundp 'doom-font) + (if (-find-font doom-font) + (success! "Found font %s" (font-get doom-font :family)) + (warn! "Warning: couldn't find %s font (default) (%s)" + (font-get doom-font :family)))) + ;; all-the-icons fonts + (let ((font-dest (pcase system-type + ('gnu/linux (concat (or (getenv "XDG_DATA_HOME") + (concat (getenv "HOME") "/.local/share")) + "/fonts/")) + ('darwin (concat (getenv "HOME") "/Library/Fonts/"))))) + (when (and font-dest (require 'all-the-icons nil t)) + (dolist (font all-the-icons-font-names) + (if (file-exists-p (expand-file-name font font-dest)) + (success! "Found font %s" font) + (warn! "Warning: couldn't find %s font in %s" + font font-dest) + (explain! "You can install it by running `M-x all-the-icons-install-fonts' within Emacs.\n\n" + "This could also mean you've installed them in non-standard locations, in which " + "case, ignore this warning.")))))) ;; gnutls-cli & openssl (cond ((executable-find "gnutls-cli")) From 6cb14cd9612c41318aba1865ea2c4fd0bca237e1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 5 Aug 2017 13:19:51 +0200 Subject: [PATCH 13/64] bin/doom-doctor: refactor + speed up tls checks --- bin/doom-doctor | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/bin/doom-doctor b/bin/doom-doctor index 20ce2a469..2172dd3dd 100755 --- a/bin/doom-doctor +++ b/bin/doom-doctor @@ -75,6 +75,7 @@ (defmacro error! (&rest args) `(message (color 1 (color 31 ,@args)))) (defmacro warn! (&rest args) `(message (color 1 (color 33 ,@args)))) (defmacro success! (&rest args) `(message (color 1 (color 32 ,@args)))) +(defmacro log! (&rest args) `(if doom-debug-mode (message (color 34 ,@args)))) (defmacro explain! (&rest args) `(message (indented 2 (autofill ,@args)))) ;;; Polyfills @@ -119,6 +120,7 @@ ;; --- is emacs set up properly? ------------------------------ +(log! "test-emacs") (check! (version< emacs-version "25.1") (error! "Important: Emacs %s detected [%s]" emacs-version (executable-find "emacs")) (explain! @@ -130,6 +132,12 @@ ;; --- is the environment set up properly? -------------------- +;; windows? windows +(log! "test-windows") +(check! (memq system-type '(windows-nt ms-dos cygwin)) + (warn! "Warning: Windows detected") + (explain! "DOOM was designed for MacOS and Linux. Expect a bumpy ride!")) + ;; are all default fonts present (log! "test-fonts") (if (not (fboundp 'find-font)) @@ -165,6 +173,7 @@ "case, ignore this warning.")))))) ;; gnutls-cli & openssl +(log! "test-gnutls") (cond ((executable-find "gnutls-cli")) ((executable-find "openssl") (let* ((output (shell-command-to-string "openssl ciphers -v")) @@ -200,12 +209,13 @@ "network, provider, government, neckbearded mother-in-laws, geeky roommates, " "or just about anyone who knows more about computers than you do!")))) +(log! "test-tls") (cond ((or (executable-find "gnutls-cli") (executable-find "openssl")) (let ((tls-checktrust t) (gnutls-verify-error t)) - (dolist (url '("https://elpa.gnu.org/packages/archive-contents" - "https://melpa.org/packages/archive-contents")) + (dolist (url '("https://elpa.gnu.org" + "https://melpa.org")) (condition-case-unless-debug ex (let (result) (let ((inhibit-message t)) @@ -240,12 +250,8 @@ (t (error! "Nope!"))) -;; windows? windows -(check! (memq system-type '(windows-nt ms-dos cygwin)) - (warn! "Warning: Windows detected") - (explain! "DOOM was designed for MacOS and Linux. Expect a bumpy ride!")) - ;; bsd vs gnu tar +(log! "test-tar") (let ((tar-bin (or (executable-find "gtar") (executable-find "tar")))) (if tar-bin From a76693c7e29fc5ae03370e952a3e4d332b574f0d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 6 Aug 2017 16:29:33 +0200 Subject: [PATCH 14/64] private/hlissner: general update --- modules/private/hlissner/+bindings.el | 1 + modules/private/hlissner/init.el | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/private/hlissner/+bindings.el b/modules/private/hlissner/+bindings.el index f5b12ca2c..ed485abe7 100644 --- a/modules/private/hlissner/+bindings.el +++ b/modules/private/hlissner/+bindings.el @@ -65,6 +65,7 @@ "C-M-f" #'doom/toggle-fullscreen :m "A-j" #'+hlissner:multi-next-line :m "A-k" #'+hlissner:multi-previous-line + :nv "C-SPC" #'+evil:fold-toggle (:prefix "C-x" "p" #'doom/other-popup) diff --git a/modules/private/hlissner/init.el b/modules/private/hlissner/init.el index e002097e8..caf5a33fc 100644 --- a/modules/private/hlissner/init.el +++ b/modules/private/hlissner/init.el @@ -7,16 +7,19 @@ user-mail-address "henrik@lissner.net" user-full-name "Henrik Lissner") +;; An extra measure to prevent the flash of unstyled mode-line while Emacs is +;; booting up (when Doom is byte-compiled). +(setq-default mode-line-format nil) + ;; host-specific settings (pcase (system-name) - ("proteus" - (setq +doom-modeline-height 25 - doom-font (font-spec :family "Fira Mono" :size 10) - doom-variable-pitch-font (font-spec :family "Fira Sans" :size 10) - doom-unicode-font (font-spec :family "DejaVu Sans Mono" :size 10) - doom-line-number-lpad 3)) - ("halimede" - (setq +doom-modeline-height 27)) + ;; ("triton") + ((or "proteus" "halimede") + ;; smaller screen, smaller fonts + (set! :font "Fira Mono" :size 10) + (set! :variable-font "Fira Sans" :size 10) + (set! :unicode-font "DejaVu Sans Mono" :size 10) + (setq +doom-modeline-height 25)) ;; ("nereid") ;; ("io") ;; ("sao") From 85c28444b37bbe2bdd5bf81c834aa640d1765b26 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 6 Aug 2017 16:30:53 +0200 Subject: [PATCH 15/64] General cleanup & refactor --- core/autoload/packages.el | 4 ++-- core/core-ui.el | 4 ++-- core/test/autoload-buffers.el | 2 +- modules/feature/workspaces/config.el | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/autoload/packages.el b/core/autoload/packages.el index 57594771e..aaf2cd3cd 100644 --- a/core/autoload/packages.el +++ b/core/autoload/packages.el @@ -51,8 +51,8 @@ list, whose car is NAME, and cdr the current version list and latest version list of the package." (cl-assert (symbolp name) t) (doom-initialize-packages) - (when-let (pkg (assq name package-alist)) - (let* ((old-version (package-desc-version (cadr pkg))) + (when-let (desc (cadr (assq name package-alist))) + (let* ((old-version (package-desc-version desc)) (new-version (pcase (doom-package-backend name) ('quelpa diff --git a/core/core-ui.el b/core/core-ui.el index f076766cc..8772d2da8 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -148,7 +148,7 @@ local value, whether or not it's permanent-local. Therefore, we cycle ;; undo/redo changes to Emacs' window layout (defvar winner-dont-bind-my-keys t) ; I'll bind keys myself (autoload 'winner-mode "winner" nil t) -(add-hook 'doom-init-hook #'winner-mode) +(add-hook 'doom-init-ui-hook #'winner-mode) ;; highlight matching delimiters (setq show-paren-delay 0.1 @@ -185,7 +185,7 @@ local value, whether or not it's permanent-local. Therefore, we cycle ;; Getting themes to remain consistent across GUI Emacs, terminal Emacs and ;; daemon Emacs is hairy. ;; -;; + Running `+doom|init-ui' directly sorts out the initial GUI frame. +;; + Running `doom|init-ui' directly sorts out the initial GUI frame. ;; + Attaching it to `after-make-frame-functions' sorts out daemon Emacs. ;; + Waiting for 0.1s in `doom|reload-ui-in-daemon' fixes daemon Emacs started ;; with `server-start' in an interactive session of Emacs AND in tty Emacs. diff --git a/core/test/autoload-buffers.el b/core/test/autoload-buffers.el index 3f94dad35..b4ba44aa6 100644 --- a/core/test/autoload-buffers.el +++ b/core/test/autoload-buffers.el @@ -64,7 +64,7 @@ (switch-to-buffer a) (should (eq (current-buffer) a)) (should (eq (selected-window) (get-buffer-window a))) - (split-window) + (split-window nil 1) (switch-to-buffer b) (should (eq (current-buffer) b)) (should (eq (selected-window) (get-buffer-window b))) diff --git a/modules/feature/workspaces/config.el b/modules/feature/workspaces/config.el index 3744e0e47..808e9ac95 100644 --- a/modules/feature/workspaces/config.el +++ b/modules/feature/workspaces/config.el @@ -41,7 +41,7 @@ renamed.") persp-auto-save-opt (if noninteractive 0 1)) ;; Bootstrap - (add-hook 'doom-init-hook #'+workspaces|init) + (add-hook 'doom-post-init-hook #'+workspaces|init) (add-hook 'after-make-frame-functions #'+workspaces|init) (define-key persp-mode-map [remap delete-window] #'+workspace/close-window-or-workspace) From 6d44cec66619595412285dc89679c18f7ca4ad6b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 6 Aug 2017 18:38:19 +0200 Subject: [PATCH 16/64] Fix new workspace & file prompt on project switch Properly initialize a new workspace, switch to the fallback buffer (scratch/dash), update its default-directory to the project root, and fuzzy-prompt for a file to open. --- .../feature/workspaces/autoload/workspaces.el | 18 ++++++++++++------ modules/feature/workspaces/config.el | 7 ++++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/modules/feature/workspaces/autoload/workspaces.el b/modules/feature/workspaces/autoload/workspaces.el index ce70c67f6..f87cd6d5a 100644 --- a/modules/feature/workspaces/autoload/workspaces.el +++ b/modules/feature/workspaces/autoload/workspaces.el @@ -459,12 +459,6 @@ the workspace and move to the next." (+workspace/new) (set-frame-parameter frame 'assoc-persp (+workspace-current-name))) -;;;###autoload -(defun +workspaces|create-project-workspace () - "Create a new workspace when switching project with `projectile'." - (when persp-mode - (+workspace-switch (projectile-project-name) t))) - ;;;###autoload (defun +workspaces|delete-associated-workspace-maybe (frame) "Delete workspace associated with current frame IF it has no real buffers." @@ -480,3 +474,15 @@ the workspace and move to the next." (when (doom-real-buffer-list) (apply orig-fn args)) t) + +;;;###autoload +(defun +workspaces*switch-project-by-name (orig-fn &rest args) + "Switch to a project and prompt for a file to open. + +Ensures the scratch (or dashboard) buffers are CDed into the project's root." + (when persp-mode + (+workspace-switch (car args) t) + (with-current-buffer (switch-to-buffer (doom-fallback-buffer)) + (setq default-directory (car args)))) + (apply orig-fn args)) + diff --git a/modules/feature/workspaces/config.el b/modules/feature/workspaces/config.el index 808e9ac95..bbf78bd3a 100644 --- a/modules/feature/workspaces/config.el +++ b/modules/feature/workspaces/config.el @@ -46,11 +46,12 @@ renamed.") (define-key persp-mode-map [remap delete-window] #'+workspace/close-window-or-workspace) - ;; per-frame workspaces + ;; per-frame and per-project workspaces (setq persp-init-new-frame-behaviour-override nil - persp-interactive-init-frame-behaviour-override #'+workspace-on-new-frame) - (add-hook 'projectile-before-switch-project-hook #'+workspaces|create-project-workspace) + persp-interactive-init-frame-behaviour-override #'+workspace-on-new-frame + projectile-switch-project-action #'projectile-find-file) (add-hook 'delete-frame-functions #'+workspaces|delete-associated-workspace-maybe) + (advice-add #'projectile-switch-project-by-name :around #'+workspaces*switch-project-by-name) ;; only auto-save when real buffers are present (advice-add #'persp-asave-on-exit :around #'+workspaces*autosave-real-buffers) From 382f4c12563a2cd888b6111363cc812305a8c4fb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 6 Aug 2017 20:48:51 +0200 Subject: [PATCH 17/64] private/hlissner: refactor window navigation keys --- modules/private/hlissner/+bindings.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/private/hlissner/+bindings.el b/modules/private/hlissner/+bindings.el index ed485abe7..4eb02f8c9 100644 --- a/modules/private/hlissner/+bindings.el +++ b/modules/private/hlissner/+bindings.el @@ -47,11 +47,6 @@ "M-8" (λ! (+workspace/switch-to 7)) "M-9" (λ! (+workspace/switch-to 8)) "M-0" #'+workspace/switch-to-last - ;; Basic escape keys for emacs mode - "C-h" #'evil-window-left - "C-j" #'evil-window-down - "C-k" #'evil-window-up - "C-l" #'evil-window-right ;; Other sensible, textmate-esque global bindings "M-r" #'+eval/buffer "M-R" #'+eval/region-and-replace @@ -66,6 +61,11 @@ :m "A-j" #'+hlissner:multi-next-line :m "A-k" #'+hlissner:multi-previous-line :nv "C-SPC" #'+evil:fold-toggle + ;; Easier window navigation + :en "C-h" #'evil-window-left + :en "C-j" #'evil-window-down + :en "C-k" #'evil-window-up + :en "C-l" #'evil-window-right (:prefix "C-x" "p" #'doom/other-popup) From 7af0dd854539997f2cf1c95a19865180afd2601f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 6 Aug 2017 20:49:11 +0200 Subject: [PATCH 18/64] org/org: refactor table navigation keys Fixes a conflict with the C-[hjkl] window navigation keys. --- modules/org/org/config.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/org/org/config.el b/modules/org/org/config.el index 57b76421f..620f3efb2 100644 --- a/modules/org/org/config.el +++ b/modules/org/org/config.el @@ -137,16 +137,17 @@ (defun +org-init-keybinds () "Sets up org-mode and evil keybindings. Tries to fix the idiosyncrasies between the two." - (map! (:map org-mode-map "RET" #'org-return-indent) + (map! (:map org-mode-map + "RET" #'org-return-indent) (:map +org-evil-mode-map - :n "RET" #'+org/dwim-at-point + :n "RET" #'+org/dwim-at-point ;; Navigate table cells (from insert-mode) - :i "C-L" #'+org/table-next-field - :i "C-H" #'+org/table-previous-field - :i "C-K" #'+org/table-previous-row - :i "C-J" #'+org/table-next-row + :i "C-l" #'+org/table-next-field + :i "C-h" #'+org/table-previous-field + :i "C-k" #'+org/table-previous-row + :i "C-j" #'+org/table-next-row ;; Expand tables (or shiftmeta move) :ni "C-S-l" #'+org/table-append-field-or-shift-right :ni "C-S-h" #'+org/table-prepend-field-or-shift-left From 5e1ece42910bfab80538d1ac5ac1d940e4fbb631 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 8 Aug 2017 14:09:49 +0200 Subject: [PATCH 19/64] test/autoload/buffers: fix dead buffers in buffer-list --- core/test/autoload-buffers.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/test/autoload-buffers.el b/core/test/autoload-buffers.el index b4ba44aa6..abf5c4245 100644 --- a/core/test/autoload-buffers.el +++ b/core/test/autoload-buffers.el @@ -8,7 +8,9 @@ (push `(,bsym (get-buffer-create ,(symbol-name bsym))) buffers)) `(save-window-excursion - (cl-flet ((buffer-list (lambda () (list ,@(reverse (mapcar #'car buffers)))))) + (cl-flet ((buffer-list + (lambda () + (cl-remove-if-not #'buffer-live-p (list ,@(reverse (mapcar #'car buffers))))))) (let* (persp-mode ,@buffers) ,@body From 7409890e78c7daa8a4abd9ec7786f66966142e7e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 8 Aug 2017 14:24:48 +0200 Subject: [PATCH 20/64] Refactor lang/python (use :jump instead of keybinds) --- modules/lang/python/config.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index c78a76476..3b624da8a 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -12,7 +12,6 @@ (set! :repl 'python-mode #'+python/repl) (set! :electric 'python-mode :chars '(?:)) - (define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens (when (executable-find "ipython") (setq python-shell-interpreter "ipython" @@ -25,6 +24,7 @@ python-shell-completion-string-code "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")) + (define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens (sp-with-modes 'python-mode (sp-local-pair "'" nil :unless '(sp-point-before-word-p sp-point-after-word-p sp-point-before-same-p)))) @@ -50,9 +50,11 @@ :after anaconda-mode :config (set! :company-backend 'python-mode '(company-anaconda)) + (set! :jump 'python-mode + :definition #'anaconda-mode-find-definitions + :references #'anaconda-mode-find-referenences + :documentation #'anaconda-mode-show-doc) (map! :map python-mode-map - :m "gd" #'anaconda-mode-find-definitions - :m "gD" #'anaconda-mode-find-references :localleader :prefix "f" :nv "d" #'anaconda-mode-find-definitions From 65748c580944db860f9bc9a05da47e1d8e04cf50 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 8 Aug 2017 14:25:36 +0200 Subject: [PATCH 21/64] Simplify core loading process --- core/autoload/test.el | 4 +--- core/core-packages.el | 6 ------ core/core.el | 8 +++++++- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/autoload/test.el b/core/autoload/test.el index 2f226cd7f..83c3f5c61 100644 --- a/core/autoload/test.el +++ b/core/autoload/test.el @@ -26,9 +26,7 @@ If neither is available, run all tests in all enabled modules." (condition-case-unless-debug ex (let (targets) ;; ensure DOOM is initialized - (let (noninteractive) - (load (expand-file-name "init.el" user-emacs-directory) nil t)) - (remove-hook 'doom-init-hook #'doom--display-benchmark) + (load (expand-file-name "core/core.el" user-emacs-directory) nil t) ;; collect targets (cond ((and command-line-args-left (equal (car command-line-args-left) "--")) diff --git a/core/core-packages.el b/core/core-packages.el index 312cd1163..89601ab0e 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -312,12 +312,6 @@ MODULES is an malformed plist of modules to load." (setq doom-modules ',doom-modules) (unless noninteractive - (require 'core-ui) ; draw me like one of your French editors - (require 'core-popups) ; taming sudden yet inevitable windows - (require 'core-editor) ; baseline configuration for text editing - (require 'core-projects) ; making Emacs project-aware - (require 'core-keybinds) ; centralized keybind system + which-key - (load ,(doom-module-path :private user-login-name "init") t t) ,@(cl-loop for (module . submodule) in (doom--module-pairs) collect `(require! ,module ,submodule t)) diff --git a/core/core.el b/core/core.el index 810ac63dd..2754c5fc5 100644 --- a/core/core.el +++ b/core/core.el @@ -185,7 +185,13 @@ ability to invoke the debugger in debug mode." ('error (lwarn 'doom-autoloads :warning "%s in autoloads.el -> %s" - (car ex) (error-message-string ex))))) + (car ex) (error-message-string ex)))) + + (load! core-ui) ; draw me like one of your French editors + (load! core-popups) ; taming sudden yet inevitable windows + (load! core-editor) ; baseline configuration for text editing + (load! core-projects) ; making Emacs project-aware + (load! core-keybinds)) ; centralized keybind system + which-key (add-hook! '(emacs-startup-hook doom-reload-hook) #'doom|finalize) From 6e8726a62408c622edce7d416a3d014e376d3565 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 8 Aug 2017 16:31:48 +0200 Subject: [PATCH 22/64] Simplify core loading process (part 2) --- core/autoload/test.el | 3 ++- core/core.el | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/autoload/test.el b/core/autoload/test.el index 83c3f5c61..27cde0c07 100644 --- a/core/autoload/test.el +++ b/core/autoload/test.el @@ -26,7 +26,8 @@ If neither is available, run all tests in all enabled modules." (condition-case-unless-debug ex (let (targets) ;; ensure DOOM is initialized - (load (expand-file-name "core/core.el" user-emacs-directory) nil t) + (let (noninteractive) + (load (expand-file-name "core/core.el" user-emacs-directory) nil t)) ;; collect targets (cond ((and command-line-args-left (equal (car command-line-args-left) "--")) diff --git a/core/core.el b/core/core.el index 2754c5fc5..7df4199bf 100644 --- a/core/core.el +++ b/core/core.el @@ -149,7 +149,7 @@ ability to invoke the debugger in debug mode." nil) (defun doom|finalize () - (unless doom-init-p + (unless (or doom-init-p noninteractive) (dolist (hook '(doom-init-hook doom-post-init-hook)) (run-hook-wrapped hook #'doom-try-run-hook hook)) (setq doom-init-p t)) @@ -187,11 +187,12 @@ ability to invoke the debugger in debug mode." "%s in autoloads.el -> %s" (car ex) (error-message-string ex)))) - (load! core-ui) ; draw me like one of your French editors - (load! core-popups) ; taming sudden yet inevitable windows - (load! core-editor) ; baseline configuration for text editing - (load! core-projects) ; making Emacs project-aware - (load! core-keybinds)) ; centralized keybind system + which-key + (unless noninteractive + (load! core-ui) ; draw me like one of your French editors + (load! core-popups) ; taming sudden yet inevitable windows + (load! core-editor) ; baseline configuration for text editing + (load! core-projects) ; making Emacs project-aware + (load! core-keybinds))) ; centralized keybind system + which-key (add-hook! '(emacs-startup-hook doom-reload-hook) #'doom|finalize) From 0b7b8800a2478588bde408c92fcdfa0e43a5baf0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 29 Jul 2017 00:11:07 +0200 Subject: [PATCH 23/64] Add support for module flags in doom! macro #158 For example: (doom! :feature (version-control +git)) I leave it to modules to interpret these flags, and they can be detected through one of the following: + (featurep! :feature version-control +git) + (featurep! +git) -- syntactic sugar, only available from within modules. + (doom-module-flags :feature version-control) -- returns a list of flags for this module. Flags are also available from packages.el files. --- core/core-packages.el | 108 ++++++++++++++++++++++++++++++------------ 1 file changed, 78 insertions(+), 30 deletions(-) diff --git a/core/core-packages.el b/core/core-packages.el index 89601ab0e..6ed46a678 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -90,6 +90,7 @@ missing) and shouldn't be deleted.") "A backup of `load-path' before it was altered by `doom-initialize'. Used as a base by `doom!' and for calculating how many packages exist.") +(defvar doom--module nil) (defvar doom--refresh-p nil) (setq load-prefer-newer (or noninteractive doom-debug-mode) @@ -206,20 +207,20 @@ This aggressively reloads core autoload files." :error)))))) (when (or force-p (not doom-modules)) (setq doom-modules nil) - (funcall load-fn (expand-file-name "init.el" doom-emacs-dir)) - (funcall load-fn (doom-module-path :private user-login-name "init.el") t) + (let (noninteractive) + (funcall load-fn (expand-file-name "init.el" doom-emacs-dir)) + (funcall load-fn (doom-module-path :private user-login-name "init.el") t)) (when load-p - (cl-loop for file - in (append (nreverse (file-expand-wildcards (expand-file-name "core*.el" doom-core-dir))) - (file-expand-wildcards (expand-file-name "autoload/*.el" doom-core-dir)) - (doom--module-paths "config.el")) - do (funcall load-fn file t))) + (mapc load-fn (file-expand-wildcards (expand-file-name "autoload/*.el" doom-core-dir)))) (doom|finalize)) (when (or force-p (not doom-packages)) (setq doom-packages nil) (funcall load-fn (expand-file-name "packages.el" doom-core-dir)) - (dolist (file (doom--module-paths "packages.el")) - (funcall load-fn file t))))) + (cl-loop for (module . submodule) in (doom--module-pairs) + for path = (doom-module-path module submodule "packages.el") + do + (let ((doom--module (cons module submodule))) + (funcall load-fn path t)))))) (defun doom-initialize-modules (modules) "Adds MODULES to `doom-modules'. MODULES must be in mplist format. @@ -240,8 +241,10 @@ This aggressively reloads core autoload files." if (file-directory-p path) collect (intern (file-name-nondirectory path)) into paths finally return (cons mode paths)))) + ((listp m) + (doom-module-enable mode (car m) (cdr m))) (t - (doom--enable-module mode m)))))) + (doom-module-enable mode m)))))) (defun doom-module-path (module submodule &optional file) "Get the full path to a module: e.g. :lang emacs-lisp maps to @@ -253,10 +256,24 @@ This aggressively reloads core autoload files." (expand-file-name (concat module "/" submodule "/" file) doom-modules-dir)) +(defun doom-module-flags (module submodule) + "Returns a list of flags provided for MODULE SUBMODULE." + (and (hash-table-p doom-modules) + (gethash (cons module submodule) doom-modules))) + (defun doom-module-loaded-p (module submodule) "Returns t if MODULE->SUBMODULE is present in `doom-modules'." - (and doom-modules - (gethash (cons module submodule) doom-modules))) + (and (doom-module-flags module submodule) t)) + +(defun doom-module-enable (module submodule &optional flags) + "Adds MODULE and SUBMODULE to `doom-modules', overwriting it if it exists. + +MODULE is a keyword, SUBMODULE is a symbol. e.g. :lang 'emacs-lisp. + +Used by `require!' and `depends-on!'." + (puthash (cons module submodule) + (doom-enlist (or flags t)) + doom-modules)) (defun doom--module-pairs () "Returns `doom-modules' as a list of (MODULE . SUBMODULE) cons cells. The list @@ -276,14 +293,7 @@ added, if the file exists." (when (file-exists-p path) (push path paths)))))) -(defun doom--enable-module (module submodule &optional force-p) - "Adds MODULE and SUBMODULE to `doom-modules', if it isn't already there (or if -FORCE-P is non-nil). MODULE is a keyword, SUBMODULE is a symbol. e.g. :lang -'emacs-lisp. -Used by `require!' and `depends-on!'." - (unless (or force-p (doom-module-loaded-p module submodule)) - (puthash (cons module submodule) t doom-modules))) (defun doom--display-benchmark () (message "Loaded %s packages in %.03fs" @@ -307,14 +317,14 @@ MODULES is an malformed plist of modules to load." (doom-initialize-modules modules) (when (and user-login-name (not (doom-module-loaded-p :private (intern user-login-name)))) - (doom--enable-module :private user-login-name)) + (doom-module-enable :private user-login-name)) `(let (file-name-handler-alist) (setq doom-modules ',doom-modules) (unless noninteractive (load ,(doom-module-path :private user-login-name "init") t t) ,@(cl-loop for (module . submodule) in (doom--module-pairs) - collect `(require! ,module ,submodule t)) + collect `(require! ,module ,submodule nil t)) (when (display-graphic-p) (require 'server) @@ -362,6 +372,32 @@ to have them return non-nil (or exploit that to overwrite Doom's config)." (t (error "'%s' isn't a valid hook for def-package-hook!" when)))) +(defmacro def-feature! (feature) + "Defines (and conditionally loads) FEATURE. + +FEATURE is a symbol representing a file in the current module, denoted by a '+' +prefix. e.g. +git. Flags are set in `doom!'. + +For example: + + ;; init.el + (doom! :lang (haskell +intero)) + + ;; modules/lang/haskell/config.el + (def-feature! +intero) ;; + (def-feature! +dante) + +lang/haskell/+intero.el will be loaded. + +Flags can be detected with `featurep!'. e.g. '(featurep! :lang haskell +intero)' +Or more concisely (if from inside a module) '(featurep! +intero)'." + `(cond ((featurep! ,(car doom--module) ,(cdr doom--module) ,feature) + (load! ,feature)) + (doom-debug-mode + (lwarn 'doom-module-feature :warning + "Feature %s in '%s %s' is not enabled" + ',feature ,(car doom--module) ',(cdr doom--module))))) + (defmacro load! (filesym &optional path noerror) "Load a file relative to the current executing file (`load-file-name'). @@ -386,28 +422,40 @@ If NOERROR is non-nil, don't throw an error if the file doesn't exist." (error "Could not find %s" filename)) (let ((file (expand-file-name (concat filename ".el") path))) (if (file-exists-p file) - `(load ,(file-name-sans-extension file) ,noerror ,(not doom-debug-mode)) + `(load ,(file-name-sans-extension file) ,noerror + ,(not doom-debug-mode)) (unless noerror (error "Could not load! file %s" file)))))) -(defmacro require! (module submodule &optional reload-p) +(defmacro require! (module submodule &optional flags reload-p) "Loads the module specified by MODULE (a property) and SUBMODULE (a symbol). The module is only loaded once. If RELOAD-P is non-nil, load it again." (let ((loaded-p (doom-module-loaded-p module submodule))) (when (or reload-p (not loaded-p)) (unless loaded-p - (doom--enable-module module submodule t)) + (doom-module-enable module submodule flags)) `(condition-case-unless-debug ex - (load! config ,(doom-module-path module submodule) t) + (let ((doom--module ',(cons module submodule))) + (load! config ,(doom-module-path module submodule) t)) ('error (lwarn 'doom-modules :error "%s in '%s %s' -> %s" - (car ex) ,module ',submodule (error-message-string ex))))))) + (car ex) ,module ',submodule + (error-message-string ex))))))) -(defmacro featurep! (module submodule) - "Convenience macro wrapper for `doom-module-loaded-p'." - (doom-module-loaded-p module submodule)) +(defmacro featurep! (module &optional submodule flag) + "A convenience macro wrapper for `doom-module-loaded-p'. It is evaluated at +compile-time/macro-expansion time." + (unless submodule + (unless doom--module + (error "featurep! was used incorrectly (doom--module wasn't unset)")) + (setq flag module + module (car doom--module) + submodule (cdr doom--module))) + (if flag + (and (memq flag (doom-module-flags module submodule)) t) + (doom-module-loaded-p module submodule))) ;; @@ -461,7 +509,7 @@ Only use this macro in a module's packages.el file. MODULE is a keyword, and SUBMODULE is a symbol. Under the hood, this simply loads MODULE SUBMODULE's packages.el file." - (doom--enable-module module submodule) + (doom-module-enable module submodule) `(load! packages ,(doom-module-path module submodule) t)) From ac05f9a7630031a7d76f480e32e4907adb436bac Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 29 Jul 2017 00:14:44 +0200 Subject: [PATCH 24/64] Remove wildcard support from doom! macro "Explicit is better than implicit." --- core/core-packages.el | 7 ------- 1 file changed, 7 deletions(-) diff --git a/core/core-packages.el b/core/core-packages.el index 6ed46a678..aad5ddaec 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -234,13 +234,6 @@ This aggressively reloads core autoload files." (setq mode m)) ((not mode) (error "No namespace specified on `doom!' for %s" m)) - ((eq m '*) - (doom-initialize-modules - (cl-loop with modpath = (expand-file-name (substring (symbol-name mode) 1) doom-modules-dir) - for path in (directory-files modpath t "^\\w") - if (file-directory-p path) - collect (intern (file-name-nondirectory path)) into paths - finally return (cons mode paths)))) ((listp m) (doom-module-enable mode (car m) (cdr m))) (t From 87ee1a06e3aeefb2d112775aceaa813b6ade37fc Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 29 Jul 2017 00:25:54 +0200 Subject: [PATCH 25/64] Remove def-feature! (keep things simple!) Removed syntactic sugar macro because it just hides obvious functionality behind magic. --- core/core-packages.el | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/core/core-packages.el b/core/core-packages.el index aad5ddaec..a7efe5f14 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -365,32 +365,6 @@ to have them return non-nil (or exploit that to overwrite Doom's config)." (t (error "'%s' isn't a valid hook for def-package-hook!" when)))) -(defmacro def-feature! (feature) - "Defines (and conditionally loads) FEATURE. - -FEATURE is a symbol representing a file in the current module, denoted by a '+' -prefix. e.g. +git. Flags are set in `doom!'. - -For example: - - ;; init.el - (doom! :lang (haskell +intero)) - - ;; modules/lang/haskell/config.el - (def-feature! +intero) ;; - (def-feature! +dante) - -lang/haskell/+intero.el will be loaded. - -Flags can be detected with `featurep!'. e.g. '(featurep! :lang haskell +intero)' -Or more concisely (if from inside a module) '(featurep! +intero)'." - `(cond ((featurep! ,(car doom--module) ,(cdr doom--module) ,feature) - (load! ,feature)) - (doom-debug-mode - (lwarn 'doom-module-feature :warning - "Feature %s in '%s %s' is not enabled" - ',feature ,(car doom--module) ',(cdr doom--module))))) - (defmacro load! (filesym &optional path noerror) "Load a file relative to the current executing file (`load-file-name'). From 5849a1fe38ad38d97f843a8389c7beb9474c6262 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 29 Jul 2017 00:27:20 +0200 Subject: [PATCH 26/64] Update :feature version-control to support module flags --- modules/feature/version-control/config.el | 9 +++++++-- modules/feature/version-control/packages.el | 13 +++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/feature/version-control/config.el b/modules/feature/version-control/config.el index 98db7e1b3..7d9339355 100644 --- a/modules/feature/version-control/config.el +++ b/modules/feature/version-control/config.el @@ -1,12 +1,17 @@ ;;; feature/version-control/config.el -*- lexical-binding: t; -*- +(unless (featurep! -git) + (load! +git)) +;; TODO hg support +;; (unless (featurep! -hg) +;; (load! +hg)) + +;; (setq vc-make-backup-files nil) (defvar +vcs-auto-hydra-smerge t "When entering `smerge-mode' automatically open associated hydra.") -(load! +git) -;; (load! +hg) (after! vc-annotate (set! :popup diff --git a/modules/feature/version-control/packages.el b/modules/feature/version-control/packages.el index 43dfb68fe..25c162e88 100644 --- a/modules/feature/version-control/packages.el +++ b/modules/feature/version-control/packages.el @@ -5,11 +5,12 @@ ;; n/a ;;; +git -(package! git-gutter-fringe) -(package! git-link) -(package! git-timemachine) -(package! gitconfig-mode) -(package! gitignore-mode) -(package! magit) +(when (featurep! +git) + (package! git-gutter-fringe) + (package! git-link) + (package! git-timemachine) + (package! gitconfig-mode) + (package! gitignore-mode) + (package! magit)) ;;; TODO +hg From c021d347d31fa0337c05698513672fda9843b498 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 29 Jul 2017 00:30:13 +0200 Subject: [PATCH 27/64] Refactor module pairs and paths helpers --- core/core-packages.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/core-packages.el b/core/core-packages.el index a7efe5f14..8d07bab58 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -272,19 +272,18 @@ Used by `require!' and `depends-on!'." "Returns `doom-modules' as a list of (MODULE . SUBMODULE) cons cells. The list is sorted by order of insertion unless ALL-P is non-nil. If ALL-P is non-nil, include all modules, enabled or otherwise." - (if (hash-table-p doom-modules) - (cl-loop for key being the hash-keys of doom-modules - collect (cons (car key) (cdr key))) - (error "doom-modules is uninitialized"))) + (unless (hash-table-p doom-modules) + (error "doom-modules is uninitialized")) + (cl-loop for key being the hash-keys of doom-modules + collect key)) (defun doom--module-paths (&optional append-file) "Returns a list of absolute file paths to activated modules, with APPEND-FILE added, if the file exists." - (let (paths) - (dolist (pair (doom--module-pairs) (nreverse paths)) - (let ((path (doom-module-path (car pair) (cdr pair) append-file))) - (when (file-exists-p path) - (push path paths)))))) + (cl-loop for (module . submodule) in (doom--module-pairs) + for path = (doom-module-path module submodule append-file) + if (file-exists-p path) + collect path)) @@ -380,7 +379,8 @@ If NOERROR is non-nil, don't throw an error if the file doesn't exist." (and load-file-name (file-name-directory load-file-name)) (and (bound-and-true-p byte-compile-current-file) (file-name-directory byte-compile-current-file)) - (and buffer-file-name (file-name-directory buffer-file-name)))) + (and buffer-file-name + (file-name-directory buffer-file-name)))) (filename (cond ((stringp filesym) filesym) ((symbolp filesym) (symbol-name filesym)) (t (error "load! expected a string or symbol, got %s (a %s)" From 4addd92c3087622767e28a3f6eb6b995df974d79 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 8 Aug 2017 19:14:10 +0200 Subject: [PATCH 28/64] Simplify core loading process (part 3) --- core/core-packages.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/core-packages.el b/core/core-packages.el index 8d07bab58..53645f5b9 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -207,10 +207,11 @@ This aggressively reloads core autoload files." :error)))))) (when (or force-p (not doom-modules)) (setq doom-modules nil) - (let (noninteractive) - (funcall load-fn (expand-file-name "init.el" doom-emacs-dir)) - (funcall load-fn (doom-module-path :private user-login-name "init.el") t)) + (funcall load-fn (expand-file-name "init.el" doom-emacs-dir)) (when load-p + (let (noninteractive) + (funcall load-fn (doom-module-path :private user-login-name "init.el") t) + (funcall load-fn (expand-file-name "core.el" doom-core-dir))) (mapc load-fn (file-expand-wildcards (expand-file-name "autoload/*.el" doom-core-dir)))) (doom|finalize)) (when (or force-p (not doom-packages)) From d173ae1ed8d34b4f726e6fcb547e096e46b9c8e5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 8 Aug 2017 19:14:33 +0200 Subject: [PATCH 29/64] Add module flag support to :feature version-control --- modules/feature/version-control/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/feature/version-control/packages.el b/modules/feature/version-control/packages.el index 25c162e88..05623f80b 100644 --- a/modules/feature/version-control/packages.el +++ b/modules/feature/version-control/packages.el @@ -5,7 +5,7 @@ ;; n/a ;;; +git -(when (featurep! +git) +(unless (featurep! -git) (package! git-gutter-fringe) (package! git-link) (package! git-timemachine) From 56382f1215d15071862facf3eb0eaebe213bb840 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 8 Aug 2017 19:14:58 +0200 Subject: [PATCH 30/64] lang/haskell: add intero support #158 To use dante instead, change `haskell` to `(haskell +dante)` in ~/.emacs.d/init.el. --- modules/lang/haskell/+dante.el | 13 +++++++++++++ modules/lang/haskell/+intero.el | 21 +++++++++++++++++++++ modules/lang/haskell/config.el | 26 +++++++++++++------------- modules/lang/haskell/packages.el | 10 ++++++++-- 4 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 modules/lang/haskell/+dante.el create mode 100644 modules/lang/haskell/+intero.el diff --git a/modules/lang/haskell/+dante.el b/modules/lang/haskell/+dante.el new file mode 100644 index 000000000..45ca105ab --- /dev/null +++ b/modules/lang/haskell/+dante.el @@ -0,0 +1,13 @@ +;;; lang/haskell/+dante.el -*- lexical-binding: t; -*- + +(def-package! dante + :after haskell-mode + :init + (add-hook! 'haskell-mode-hook #'(dante-mode interactive-haskell-mode)) + :config + (unless (executable-find "cabal") + (warn "haskell-mode: couldn't find cabal") + (remove-hook 'haskell-mode-hook #'dante-mode)) + + (add-hook 'dante-mode-hook #'flycheck-mode)) + diff --git a/modules/lang/haskell/+intero.el b/modules/lang/haskell/+intero.el new file mode 100644 index 000000000..a27ab768c --- /dev/null +++ b/modules/lang/haskell/+intero.el @@ -0,0 +1,21 @@ +;;; lang/haskell/+intero.el -*- lexical-binding: t; -*- + +(def-package! intero + :commands intero-mode + :init + (add-hook 'haskell-mode-hook #'intero-mode) + :config + (unless (executable-find "stack") + (warn "haskell-mode: couldn't find stack, disabling intero") + (remove-hook 'haskell-mode-hook #'intero-mode)) + + (add-hook! 'intero-mode-hook #'(flycheck-mode eldoc-mode)) + + (set! :popup "^intero:backend:" :regex t :size 12) + (set! :jump :definition #'intero-goto-definition)) + + +(def-package! hindent + :commands hindent-mode + :init + (add-hook 'haskell-mode-hook #'hindent-mode)) diff --git a/modules/lang/haskell/config.el b/modules/lang/haskell/config.el index 17e344f65..b634ecc82 100644 --- a/modules/lang/haskell/config.el +++ b/modules/lang/haskell/config.el @@ -17,21 +17,21 @@ (map! :map inf-haskell-mode-map "ESC ESC" #'doom/popup-close))) -(def-package! dante - :after haskell-mode - :config - (if (executable-find "cabal") - (add-hook! 'haskell-mode-hook - #'(flycheck-mode dante-mode interactive-haskell-mode)) - (warn "haskell-mode: couldn't find cabal"))) - - (def-package! company-ghc :when (featurep! :completion company) :after haskell-mode + :init + (add-hook 'haskell-mode-hook #'ghc-comp-init) :config - (set! :company-backend 'haskell-mode #'company-ghc) - (setq company-ghc-show-info 'oneline) (if (executable-find "ghc-mod") - (add-hook 'haskell-mode-hook #'ghc-comp-init) - (warn "haskell-mode: couldn't find ghc-mode"))) + (set! :company-backend 'haskell-mode #'company-ghc) + (warn "haskell-mode: couldn't find ghc-mode") + (remove-hook 'haskell-mode-hook #'ghc-comp-init)) + + (setq company-ghc-show-info 'oneline)) + + +;; +(if (featurep! +dante) + (load! +dante) + (load! +intero)) diff --git a/modules/lang/haskell/packages.el b/modules/lang/haskell/packages.el index 666cd7127..981d218f8 100644 --- a/modules/lang/haskell/packages.el +++ b/modules/lang/haskell/packages.el @@ -2,7 +2,13 @@ ;;; lang/haskell/packages.el (package! haskell-mode) -(package! dante) - (when (featurep! :completion company) (package! company-ghc)) + +;; +(cond ((featurep! +dante) + (package! dante)) + (t + (package! intero) + (package! hindent))) + From c3275a7809c504dee000bc680e5bab8a90e02af2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 9 Aug 2017 13:04:51 +0200 Subject: [PATCH 31/64] rainbow-mode: don't activate on prog-mode-hook That is too aggressive. Not sure what a more reasonable default should be though. --- modules/tools/rgb/config.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/tools/rgb/config.el b/modules/tools/rgb/config.el index 6beedb8f9..427811f85 100644 --- a/modules/tools/rgb/config.el +++ b/modules/tools/rgb/config.el @@ -4,9 +4,8 @@ ;; Plugins ;; -(def-package! rainbow-mode - :init - (add-hook 'prog-mode-hook #'rainbow-mode)) +(def-package! rainbow-mode) + (def-package! kurecolor :after rainbow-mode From 7b9a2c850def4dafb2ea0be0d2a149c842206cce Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 9 Aug 2017 13:05:39 +0200 Subject: [PATCH 32/64] Remove unnecessary require 'hydra --- modules/tools/rgb/config.el | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/tools/rgb/config.el b/modules/tools/rgb/config.el index 427811f85..70132f8e3 100644 --- a/modules/tools/rgb/config.el +++ b/modules/tools/rgb/config.el @@ -11,7 +11,6 @@ :after rainbow-mode :config (when (featurep! :feature hydra) - (require 'hydra) (defhydra hydra-kurecolor (:color pink :hint nil) " From 5e393b323386368deb7bdd289f43f3f6ad04a39a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 9 Aug 2017 15:30:42 +0200 Subject: [PATCH 33/64] Ensure module state is initialized on make test --- core/autoload/test.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/autoload/test.el b/core/autoload/test.el index 27cde0c07..c926163bf 100644 --- a/core/autoload/test.el +++ b/core/autoload/test.el @@ -27,7 +27,8 @@ If neither is available, run all tests in all enabled modules." (let (targets) ;; ensure DOOM is initialized (let (noninteractive) - (load (expand-file-name "core/core.el" user-emacs-directory) nil t)) + (load (expand-file-name "core/core.el" user-emacs-directory) nil t) + (doom-initialize-modules nil)) ;; collect targets (cond ((and command-line-args-left (equal (car command-line-args-left) "--")) From ab5c87bae9e8aa2e0fdc61d8e3bf8d4da0a5a00b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 9 Aug 2017 21:22:00 +0200 Subject: [PATCH 34/64] Add solaire-mode-swap-bg --- modules/ui/doom/config.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ui/doom/config.el b/modules/ui/doom/config.el index e10082d58..ec5575bfe 100644 --- a/modules/ui/doom/config.el +++ b/modules/ui/doom/config.el @@ -43,6 +43,7 @@ (add-hook 'doom-popup-mode-hook #'turn-off-solaire-mode) :config (setq solaire-mode-real-buffer-fn #'doom-real-buffer-p) + (add-hook 'doom-init-ui-hook #'solaire-mode-swap-bg t) ;; Prevent color glitches when reloading either DOOM or the theme (defun +doom|reset-solaire-mode (&rest _) (solaire-mode-reset)) From c962e1a47c8f0a2a6fb193dd1108f6f1ee818551 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 11 Aug 2017 19:57:57 +0200 Subject: [PATCH 35/64] Update changelog --- CHANGELOG.org | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 38e09bd88..359e44ee0 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -61,13 +61,29 @@ + =tools/upload= Add ~+upload/open-remote-file~ command to open current file on the remote (with TRAMP). + Add =bin/org-alert= script -- a cron script that scans TODOs in org files and dispatches system alerts. + =feature/workspaces= Add a bookmarks feature, but for wconfs, that can revive file buffers. Also needs an interface. -+ Add README.org's with working babel blocks to modules. -+ Document best practices for customizing DOOM emacs. + =ui/doom-modeline= fix hardcoded spacing in between segments. -+ Rewrite main README.md to include more information about setting up, customizing, and troubleshooting DOOM Emacs. + Update =bin/org-capture= to read from stdin in the absence of arguments. ++ Add README.org's with working babel blocks to modules. ++ Rewrite and expand documentation to include more information about setting up, customizing, and troubleshooting DOOM Emacs, including best practices. ++ =core-popups= Add support for moving popup windows to the ~+evil/window-move-*~ commands #171 * Unreleased (master) ++ =doom= + + Added new module: ~lang/ocaml~, offering OCaml support (thanks to ptival) + + Added new module: ~tools/rgb~, with tools for dealing with colors (thanks to bandresen) + + Added new module: ~tools/prodigy~, with tools for managing external services (thanks to bandresen) + + Added new module: ~feature/hydra~, offers an extra and customizable layer of modal keybinds (thanks to bandresen) + + Switch to ~doom-fallback-buffer~ after using ~doom/kill-all-buffers~ (or ~:killall!~). + + ~make doctor~ now does font detection and will complain when fonts are missing. + + When switching to a new project, a new workspace is spawned and a fuzzy find-file prompt is opened. However, a buffer from the previous workspace would linger on screen *and* the scratch buffer would CD to HOME, rather than the project root. This is fixed now. + + Added module flags to the ~doom!~ macro in init.el, and modified the ~featurep!~ macro so that it can be used to detect these flags from within modules. It is up to modules how to interpret them. More information in [[https://github.com/hlissner/.emacs.d/commit/0b7b8800a2478588bde408c92fcdfa0e43a5baf0][0b7b880]]. + + Fix projectile-find-file not respecting ~default-directory~ (caused by changes upstream). ++ =lang= + + =C/C++= The advise function ~c-lineup-arglist~ was missing, and has now be reimplemented. + + =Haskell= With module flags implemented, Intero support is now available to lang/haskell and is now the default. Dante support is still available with the ~+dante~ flag. ++ =org= + + Fix vanilla C-j/C-k bindings overshadowing custom window navigation bindings. + + rainbow-mode is no longer activated on ~prog-mode-hook~. * 2.0.4 (Jul 14, 2017) + *Module changes:* From 68e973451df30d19976d727c5bc837eaedee47d9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 29 Jul 2017 00:54:08 +0200 Subject: [PATCH 36/64] Rewrite README --- README.md | 248 ++++++++++++++++++++++-------------------------------- 1 file changed, 102 insertions(+), 146 deletions(-) diff --git a/README.md b/README.md index c4a9aa17f..d82549c71 100644 --- a/README.md +++ b/README.md @@ -3,178 +3,134 @@ [![Develop Build Status](https://img.shields.io/travis/hlissner/.emacs.d/develop.svg?label=develop&style=flat-square)](https://travis-ci.org/hlissner/.emacs.d) [![MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](./LICENSE) -[![Main screenshot](/../screenshots/main.png?raw=true)][sc] +[![Main screenshot](/../screenshots/main.png)](/../screenshots) + +- - - + +

+ Documentation | + Screenshots | + Troubleshooting | + FAQ | + Changelog +

+ +- - - - + -This is an Emacs configuration for a stubborn, shell-dwelling and melodramatic -vimmer disappointed with the text-editor status quo. +It is a story as old as time. A stubborn, shell-dwelling, and melodramatic +vimmer -- envious of the features of modern text editors -- spirals into despair +before he finally succumbs to the [dark side][evil-mode]. This is his config. -Doom tries to: look and act like modern editors (whatever that means to me on -any given day), espouse vim's modal philosophy as best it can and strive to -surpass vim in any way possible. It fits my needs as a software developer, indie -game developer, scientist and doom enthusiast. +DOOM's philosophy is simple: be **fast**, be **pretty**, and be **vim** (or +better). It is tailored for neckbeards with a blue-belt or better in +command-line-fu who don't shy away from dabbling with Elisp. -It was written for **Emacs 25.1+** on **MacOS 10.11+** and **Arch Linux 4.7+**. -I use [vim] everywhere else. +Rip and tear. Until it is done. -## Installation +> **Important:** Doom only supports Emacs >= 25.1, and is tailored for Arch +> Linux 4.7+ and Mac OS 10.11+. + +- - - + +## Quick start ```bash git clone https://github.com/hlissner/.emacs.d ~/.emacs.d cd ~/.emacs.d cp init.example.el init.el # maybe edit init.el make install - -# Have problems? Run this to check for common issues with your setup -make doctor ``` -Once you've tweaked the config to your liking, you may optionally byte-compile -it. DOOM is designed to benefit from this. It will boost startup times and make -Emacs feel a bit snappier in general. +Visit the wiki for [a more detailed guide on installing, customizing and +grokking Doom][wiki]. -```bash -make compile # may take a while -# or -make core # faster alternative; only compiles init.el & core files +## Feature highlights -# If you byte-compile, changes to the config won't take effect until you -# recompile or delete the byte-compiled files with: -make clean -``` - -## Package Management - -Plugins can be managed from the command line with `make`: - -```bash -make install # install missing plugins -make update # update installed plugins -make autoremove # remove unused plugins -# be sure to run install and autoremove after modifying init.el - -# run this if you change autoload files -make autoloads - -# this is the equivalent of running all four of the above commands -make - -# you can run any make command with DEBUG=1 for extra logging, and YES=1 to -# auto-accept confirmation prompts: -DEBUG=1 make install -YES=1 make update -``` - -These commands are also available from within Emacs: - -+ `doom/packages-install` -+ `doom/packages-update` -+ `doom/packages-autoremove` -+ `doom/reload-autoloads` - -## Deciphering my emacs.d - -So you want to grok this madness. Here are a few suggestions: - -* **[init.example.el](init.example.el)**: a birds eye view of available modules -* **[modules/README.org](modules/README.org)**: a primer into module structure -* **[modules/private/hlissner/+bindings.el](modules/private/hlissner/+bindings.el)**: - my custom keybinds. -* **[modules/private/hlissner/+commands.el](modules/private/hlissner/+commands.el)**: - my custom ex-commands (for [evil-mode]). -* **[modules/ui](modules/ui)**: the modules that makes my Emacs look the way it - does, including [my theme][doom-theme], modeline, dashboard and more. -* Find screenshots in the [screenshots branch][sc]. - -### Highlights - -* A [popup management system](core/core-popups.el) using **[shackle]** to - minimize mental context switching while dealing with temporary or disposable - buffers. -* Per-project code-style settings with **[editorconfig]**. Let someone else - argue about tabs versus spaces (spaces, of course). -* Workspaces & session persistence with **[persp-mode]**. Provides tab emulation - that vaguely resembles vim's tabs. -* Project & workspace-restricted buffer navigation and functions. -* A vim-centric environment with **[evil-mode]** - * 2-character motions (ala vim-seek/vim-sneak) with **[evil-snipe]** - * Sublime Text-esque [multiple cursors][sc-multiedit] with - **[evil-mc]** and **[evil-multiedit]** - * C-x omnicompletion in insert mode - * A better `:global` with buffer highlighting - * A slew of [custom ex commands](modules/private/hlissner/+commands.el) -* Fast search utilities: - * Project and buffer navigation with **[ivy]** - * File browser sidebar with **[neotree]** - * Project text search powered by [the silver searcher][ag] and [ripgrep][rg] - (see `:ag` and `:rg`) - * Project search & replace with **[wgrep]** - * Interactive buffer search with **[swiper]** -* Inline/live code evaluation (using **[quickrun]**) and REPLs for a variety of - languages, including Ruby, Python, PHP, JS, Elisp, Haskell, Lua and more. -* [Minimalistic diffs in the fringe][sc-diffs] with **[git-gutter-fringe]**. -* A do-what-I-mean jump-to-definition implementation that tries its darnest to - find the definition of what you're looking at. It tries major-mode commands, - xref (experimental Emacs library), **[dumb-jump]**, ctags (WIP), then - **[ripgrep][rg]** or **[the_silver_searcher][ag]**. -* Snippets and file-templates with **[yasnippet]** & **[auto-yasnippet]**. -* A smarter, perdier, Atom-inspired mode-line that adds: - * evil-search/iedit/evil-substitute mode-line integration - * Macro-recording indicator - * Python/ruby version in mode-line (for rbenv/pyenv) -* Emacs as an: - * Email client (using mu4e & offlineimap) - * Presentation app (using org-tree-slides, ox-reveal, +present/big-mode - & impatient-mode) - * RSS feed reader (using elfeed) - * Word Processor (using LaTeX, Org and Markdown) ++ A fast, organized and opinionated Emacs configuration with a command line + interface. ++ A custom, declarative [package management system][doom-packages] that combines + package.el, [use-package] and [quelpa]. This lets you install packages from + sources other than ELPA, as well as manage packages from the command line. ++ A [popup management system][doom-popups] (powered by [shackle]) that minimizes + the presence and footprint of temporary and/or disposable buffers. ++ A vim-like experience with [evil-mode], including ports for several vim + plugins, C-x omnicompletion and a slew of [custom ex commands][doom-my-commands]. ++ Integration with [editorconfig]. Let someone else argue about tabs and spaces + (spaces, duh). ++ Code completion for a variety of languages, powered by [company-mode] (there + may be other dependencies for certain languages). ++ Project-awareness powered by [projectile], with tools to navigate and manage + projects and project files. ++ Fast project search (and replace) utilities, powered by [the_silver_searcher], + [ripgrep] and [wgrep], with [ivy] (the default), [helm] and ido integration. ++ Isolated and persistent workspaces powered by [persp-mode]. This can + substitute for vim tabs. ++ Inline/live code evaluation (using [quickrun]), including REPLs for a variety + of languages. ## Troubleshooting -My config wasn't intended for public use, but I'm happy to help you use or crib -from it. +Found a problem? Here are some things to try: -+ If you have questions, drop me a line at henrik@lissner.net. -+ If you have issues running or setting up DOOM, use `make doctor` to diagnose - any common problems. -+ If you still can't make sense of it, run `DEBUG=1 make doctor` and include - it [with your bug report][new-issue]. ++ Make sure all plugins are installed with `make install`. ++ A `void-function` or `void-variable` might signal an out-of-date autoloads + file. Update it with `make autoloads`. ++ Diagnose common OS/environment issues that could interfere with Emacs with + `make doctor`. ++ If you byte-compiled Doom, run `make clean` or `M-x doom/clean-compiled-files` + and restart Emacs. Never debug byte-compiled code, it will interfere with your + efforts in subtle (and not-so-subtle) ways. -**And please include steps to reproduce your issue, if possible.** +If all else fails, [file a bug report][doom-new-issue]. -## Contributing +## Contribute -I welcome contributions of any kind: documentation, bug fixes/reports, extra -modules, even elisp tips. Really, -[don't hesitate to tell me my Elisp-fu sucks][new-issue]! I'm eager to learn. +Doom (and my Emacs work in general) is a labor of love and incurable madness, +done on my free time. It wasn't intended for public use, but I enjoy making Doom +a resource for others. + +If you'd like to support my efforts, I welcome contributions of any kind: + ++ I love pull requests and bug reports (read the [contribution + guidelines][wiki-contribute] first though!), and elisp pointers are especially + welcome. Seriously, don't hesitate to [tell me my Elisp-fu + sucks][doom-new-issue]! ++ I'm happy to discuss Emacs workflow, ideas or tooling. If you think I, Doom or + other Emacs users could benefit from them (or you just want to chat), drop me + a line at henrik@lissner.net. I'm eager to learn. -[ag]: https://github.com/ggreer/the_silver_searcher -[auto-yasnippet]: https://melpa.org/#/auto-yasnippet -[company-mode]: https://melpa.org/#/company +[wiki]: /wiki +[wiki-contribute]: /wiki/Contribute +[wiki-conventions]: /wiki/Conventions +[wiki-modules]: /wiki/Modules +[wiki-customization]: /wiki/Customization + +[doom-my-bindings]: modules/private/hlissner/+bindings.el +[doom-my-commands]: modules/private/hlissner/+commands.el +[doom-new-issue]: https://github.com/hlissner/.emacs.d/issues/new +[doom-packages]: core/autoload/packages.el +[doom-popups]: core/core-popups.el [doom-theme]: https://github.com/hlissner/emacs-doom-theme -[dumb-jump]: https://melpa.org/#/dumb-jump + +[company-mode]: https://github.com/company-mode/company-mode [editorconfig]: http://editorconfig.org/ -[evil-mc]: https://github.com/gabesoft/evil-mc -[evil-mode]: https://melpa.org/#/evil -[evil-multiedit]: https://melpa.org/#/evil-multiedit -[evil-snipe]: https://melpa.org/#/evil-snipe -[git-gutter-fringe]: https://melpa.org/#/git-gutter-fringe -[ivy]: https://melpa.org/#/ivy -[neotree]: https://melpa.org/#/neotree -[new-issue]: https://github.com/hlissner/.emacs.d/issues/new -[persp-mode]: https://melpa.org/#/persp-mode -[quickrun]: https://melpa.org/#/quickrun -[rg]: https://github.com/BurntSushi/ripgrep -[sc-diffs]: https://github.com/hlissner/.emacs.d/blob/screenshots/git-gutter.png?raw=true -[sc-multiedit]: https://raw.githubusercontent.com/hlissner/evil-multiedit/screenshots/main.gif?raw=true -[sc]: https://github.com/hlissner/.emacs.d/tree/screenshots -[shackle]: https://melpa.org/#/shackle -[swiper]: https://melpa.org/#/swiper +[evil-mode]: https://github.com/emacs-evil/evil +[git-gutter-fringe]: https://github.com/syohex/emacs-git-gutter-fringe +[helm]: https://github.com/emacs-helm/helm +[ivy]: https://github.com/abo-abo/swiper +[persp-mode]: https://github.com/Bad-ptr/persp-mode.el +[projectile]: https://github.com/bbatsov/projectile +[quelpa]: https://github.com/quelpa/quelpa +[quickrun]: https://github.com/syohex/emacs-quickrun +[ripgrep]: https://github.com/BurntSushi/ripgrep +[shackle]: https://github.com/wasamasa/shackle +[the_silver_searcher]: https://github.com/ggreer/the_silver_searcher +[use-package]: https://github.com/jwiegley/use-package [vim]: https://github.com/hlissner/.vim -[wgrep]: https://melpa.org/#/wgrep -[yasnippet]: https://melpa.org/#/yasnippet -[yay-evil]: http://ultravioletbat.deviantart.com/art/Yay-Evil-111710573 +[wgrep]: https://github.com/mhayashi1120/Emacs-wgrep + From f0cad4673c181e18702fb8d05b8ab7b469adcf8c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 13 Aug 2017 22:56:07 +0200 Subject: [PATCH 37/64] Revise modules/private/README.org --- modules/private/README.org | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/modules/private/README.org b/modules/private/README.org index f1bcded69..8b804c47e 100644 --- a/modules/private/README.org +++ b/modules/private/README.org @@ -1,20 +1,24 @@ -* :private -Modules here represent all your personal customizations. I suggest you keep them contained here to minimize friction when updating from upstream (if that matters to you). +#+TITLE: :private modules -I include my private module as a reference. I recommend you don't delete/rename it as that could cause merge conflicts. +Place your personal customizations here. My private module is there for reference. I recommend you do not delete/rename it, but instead, copy it to your own. -** Loading your private module -~:private {user-login-name}~ is loaded automatically after all other modules. +- [[#loading-your-private-module][Loading your private module]] +- [[#reconfiguring-packages][Reconfiguring packages]] +- [[#installing-your-own-packages][Installing your own packages]] -Keeping it in your init.el is unnecessary, but harmless. +* Loading your private module ++ ~:private {user-login-name}~ is loaded automatically after all other modules. -~private/{user-login-name}/init.el~ is a special file, unique to the private module named after your username in ~user-login-name~. It is loaded immediately after DOOM core is, but before any module is. This gives you an opportunity to overwrite variables and settings earlier. I will refer to this as your "private init.el". + Keeping it in your init.el is unnecessary, but harmless. -** Reconfiguring packages ++ ~private/{user-login-name}/init.el~ is a special file, unique to the private module named after your username in ~user-login-name~. It is loaded immediately after DOOM core is, but before any module is. This gives you an opportunity to overwrite variables and settings earlier. I will refer to this as your "private init.el". + +* Reconfiguring packages If your configuration needs are simple, ~add-hook!~ and ~after!~ will be sufficient to reconfigure packages: #+BEGIN_SRC emacs-lisp ;; private/hlissner/config.el + (after! evil (setq evil-magic nil)) @@ -37,18 +41,20 @@ Look into ~def-package-hook!~ if you need more customizability. It lets you disa ;; package's original :init / :config block. Exploit this to overwrite ;; DOOM's config. Otherwise, make sure they always return non-nil! (def-package-hook! doom-themes - :post-config + :pre-config (setq doom-neotree-file-icons t) nil) ;; Otherwise, you append to a packages config (def-package-hook! evil - :post-init + :pre-init (setq evil-magic nil) t) + +;; `def-package-hook' also has :post-init and :post-config hooks #+END_SRC -** Installing your own packages +* Installing your own packages Your private module is otherwise like any other module. It may possess a packages.el file, which -- with the advantage of being loaded last -- may be used not only to install your own packages, but overwrite past ~package!~ declarations. #+BEGIN_SRC emacs-lisp From ee1875ffd43f7ad49505cf49d6575fae0927acc4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 19 Aug 2017 21:58:22 +0200 Subject: [PATCH 38/64] Add feature/workspaces/README.org --- modules/feature/workspaces/README.org | 75 +++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 modules/feature/workspaces/README.org diff --git a/modules/feature/workspaces/README.org b/modules/feature/workspaces/README.org new file mode 100644 index 000000000..c2e3f2c71 --- /dev/null +++ b/modules/feature/workspaces/README.org @@ -0,0 +1,75 @@ +#+TITLE: :feature workspaces + +This module adds support for workspaces, powered by persp_mode, as well as a unified API for manipulating them. + +#+begin_quote +There are many ways to use workspaces. Some use them to group buffers/windows by project or categories (views, models, logic, etc). I use them differently: on a per-task basis, which may traverse multiple projects or aspects, but are tied to an objective. For example: implement a specific feature or fix a certain bug; sometimes unrelated to the project at hand. +#+end_quote + +* Table of Contents :TOC: +- [[#install][Install]] +- [[#features][Features]] + - [[#isolated-buffer-list][Isolated buffer-list]] + - [[#automatic-workspaces][Automatic workspaces]] + - [[#session-persistence][Session persistence]] + - [[#workspace-persistence][Workspace persistence]] +- [[#appendix][Appendix]] + - [[#commands--keybindings][Commands & Keybindings]] + - [[#api][API]] + +* Install +This module has no additional dependencies. + +* Features +** Isolated buffer-list +When persp-mode is active, ~doom-buffer-list~ becomes workspace-restricted. You can overcome this by using ~buffer-list~. + +** Automatic workspaces +A workspace is automatically created (and switched to) when you: + ++ Create a new frame (with =make-frame=; bound to =M-N= by default) ++ Switch to a project using ~projectile-switch-project~ (or its ivy/helm equivalents) + +** Session persistence +By default, your session is autosaved when you quit Emacs (or disable ~persp-mode~). You can load a previous session with ~M-x +workspace/load-session~ or ~:sl[oad]~ (ex command). + +You can supply either a name to load a specific session to replace your current one. + +** Workspace persistence +If you'd like to save a specific workspace, use ~M-x +workspace/save~, which can be loaded into the current session (as another workspace) with ~M-x +workspace/load~. + +* Appendix +** Commands & Keybindings +Here is a list of available commands, their default keybindings (defined in private/hlissner/+bindings.el), and corresponding ex commands (if any -- defined in private/hlissner/+commands.el). + +| command | key / ex command | description | +|---------------------------+----------------------------+------------------------------------------------------------| +| ~+workspace/new~ | =SPC TAB n= | Create a new, blank workspace | +| ~+workspace/display~ | =SPC TAB TAB= | Display open workspaces in the mode-line | +| ~+workspace/load~ | =SPC TAB l= | Load a saved workspace into the current session | +| ~+workspace/load-session~ | =SPC TAB L= / =:sl[oad]= | Replace current session with a saved one | +| ~+workspace/save~ | =SPC TAB s= | Save the current workspace to a file | +| ~+workspace/save-session~ | =SPC TAB S= / =:ss[ave]= | Save current session | +| ~+workspace/switch-to~ | =SPC TAB .= | Switch to an open workspace | +| ~+workspace/switch-left~ | =SPC TAB [= / =[ w= / =gT= | Switch to previous workspace | +| ~+workspace/switch-right~ | =SPC TAB [= / =] w= / =gt= | Switch to next workspace | +| ~+workspace/kill-session~ | =SPC TAB X= / =:sclear= | Clears the current session (kills all windows and buffers) | + +** API ++ ~+workspace-list~ -> list ++ ~+workspace-list-names~ -> list ++ ~+workspace-buffer-list &optional PERSP~ -> bool ++ ~+workspace-p OBJ~ -> bool ++ ~+workspace-exists-p NAME~ -> bool ++ ~+workspace-get NAME &optional NOERROR~ -> Struct ++ ~+workspace-current &optional FRAME WINDOW~ -> Struct ++ ~+workspace-current-name~ -> string ++ ~+workspace-load NAME~ ++ ~+workspace-load-session NAME~ ++ ~+workspace-save NAME~ ++ ~+workspace-save-session NAME~ ++ ~+workspace-new NAME~ ++ ~+workspace-rename NAME NEW-NAME~ ++ ~+workspace-delete NAME &optional INHIBIT-KILL-P~ ++ ~+workspace-switch NAME &optional AUTO-CREATE-P~ ++ ~+workspace-protected-p NAME~ -> bool From 0b2e3e8c817d455001fb2d570bd56f38873491fb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 19 Aug 2017 21:58:36 +0200 Subject: [PATCH 39/64] Remove modules/README.org (replaced by wiki) --- modules/README.org | 168 --------------------------------------------- 1 file changed, 168 deletions(-) delete mode 100644 modules/README.org diff --git a/modules/README.org b/modules/README.org deleted file mode 100644 index 4163f5883..000000000 --- a/modules/README.org +++ /dev/null @@ -1,168 +0,0 @@ -#+TITLE: DOOM modules - -* Table of Contents :TOC:noexport: -- [[#overview][Overview]] - - [[#module-overview][Module overview]] -- [[#the-structure-of-a-module][The structure of a module]] - - [[#configel][config.el]] - - [[#packagesel][packages.el]] - - [[#autoloadel-or-autoloadel][autoload.el OR autoload/*.el]] - - [[#additional-files][Additional files]] -- [[#appendix][Appendix]] - -* Overview -DOOM is comprised of its core files and then its modules. A small list of macros are used to manage and configure plugins, other modules and DOOM Emacs itself. - -These macros are: - -+ Package management - + ~(featurep! MODULE SUBMODULE)~: returns =t= if =:module submodule= is activated. - + ~(load! NAME)~: loads NAME.el, relative to the current file. - + ~(require! MODULE SUBMODULE &optional RELOAD-P)~: activates a module & loads its config.el, if it isn't already loaded. - + ~(package! NAME &key recipe pin)~: declares a package to be installed and where to get it. - + ~(depends-on! MODULE SUBMODULE)~: loads a module's packages.el. -+ Configuration - + ~(set! SETTING &rest ARGS)~: safely cross-configure other modules. Use ~M-x doom/describe-setting~ to see what's available. - + ~(def-package! NAME &rest PLIST)~: configure a package (wrapper around ~use-package~). - + ~(def-setting! SETTING &rest ARGS)~: defines a setting other modules can ~set!~. - -The TL;DR of this document is: - -+ Modules are comprised of: =config.el=, =packages.el=, either =autoload.el= or =autoload/*.el=, and =+*.el= files; these are all optional. -+ =config.el= is the only file loaded when a module is activated, and is where you configure the module and its plugins. -+ =packages.el= files inform DOOM what plugins to install and where from, using the ~package!~ macro. This macro accepts a MELPA-style recipe plist to specify a location other than the ELPA for fetching plugins. -+ Use ~set!~ to safely cross-configure modules; ~doom/describe-setting~ can help you discover what settings are available. -+ Packages are deferred by default; add ~:demand t~ to their ~def-package!~ declaration to load them immediately. -+ The =private/{user-login-name}= module is automatically loaded. It is harmless to keep =:private {user-login-name}= in your init.el however. -+ =private/{user-login-name}/init.el= is a special file that is automatically loaded after DOOM core files, but before modules are loaded. Use it to configure DOOM. - -** Module overview -These modules are in their ideal load order. - -+ :feature :: Broad modules that bring essential functionality to Emacs as an editor. -+ :completion :: Swappable completion modules for narrowing down candidate lists quickly. -+ :ui :: Aesthetic modules that affect the Emacs interface or user experience. -+ :tools :: Small modules that add specific, non-essential functionality to Emacs. -+ :lang :: Modules that bring support for a language or group of languages to Emacs. -+ :org :: Modules that affect and extend org-mode. -+ :app :: Large, opinionated modules that transform Emacs' UI to serve a specific purpose. -+ :private :: Private configuration modules that are untracked by version control (except for my personal one; use it as a reference). - -Change the ~doom!~ block in your ~init.el~ file to enable/disable modules on startup. You'll need to restart Emacs. - -Don't forget to run ~make~ afterwards to ensure that the needed packages are installed (and unneeded ones are uninstalled). - -#+begin_quote -*Remember*: if you've byte-compiled your config, your changes won't take effect -until you recompile or delete the \*.elc files. -#+end_quote - -* The structure of a module -Modules are made up of five *optional* parts: - -+ config.el :: The heart of a module; loaded when the module is activated. -+ packages.el :: Tells DOOM what packages to install and where from. Isn't loaded until package management commands are used. -+ autoload.el (or autoload/*.el) :: Lazily-loaded functions for that module. -+ +*.el :: Additional config files; not automatically loaded. -+ test/*.el :: unit tests for that module, if any. - -** config.el -*config.el* is loaded immediately. It is the only file proactively loaded by the DOOM module system. Additional files must be explicitly loaded using ~load!~. - -It should expect dependencies (in =packages.el=) to be installed and available, but shouldn't make assumptions about what modules are activated (use ~featurep!~ for this). - -Packages should be configured using ~after!~ or ~def-package!~ (an alias for ~use-package~). - -#+BEGIN_SRC emacs-lisp -;; from modules/completion/company/config.el -(def-package! company - :commands (company-mode global-company-mode company-complete - company-complete-common company-manual-begin company-grab-line) - :config - (setq company-idle-delay nil - company-tooltip-limit 10 - company-dabbrev-downcase nil - company-dabbrev-ignore-case nil) - [...]) -#+END_SRC - -+ Packages are *deferred* by default: add ~:demand t~ to ~def-package!~ blocks to load them immediately. -+ Use ~featurep!~ to test DOOM module availability for conditional packages. -+ Use ~set!~ to cross-configure modules safely, e.g. company backends: - - #+BEGIN_SRC emacs-lisp -;; from modules/lang/python/config.el -(set! :company-backend 'python-mode '(company-anaconda)) -#+END_SRC - -** packages.el -This file isn't loaded until you use DOOM's package management commands. - -Evaluating them should be deterministic, idempotent, and without side-effects (besides updating ~doom-modules~ and ~doom-packages~). - -Packages are declared with the ~package!~ macro, e.g. - -#+BEGIN_SRC emacs-lisp -;; from modules/lang/org/packages.el -(package! org-bullets) - -;; from modules/tools/rotate-text/packages.el -(package! rotate-text :recipe (:fetcher github :repo "debug-ito/rotate-text.el")) -#+END_SRC - -The packages.el of another module can loaded with ~depends-on!~: - -#+BEGIN_SRC emacs-lisp -;; from modules/feature/file-templates/packages.el -(depends-on! :feature snippets) -#+END_SRC - -** autoload.el OR autoload/*.el -Functions in these files are lazily loaded. ~doom/reload-autoloads~ will scan these and produce an =autoloads.el= file, which tells Emacs where to find these functions. - -For example: - -#+BEGIN_SRC emacs-lisp -;; from modules/lang/org/autoload/org.el -;;;###autoload -(defun +org/toggle-checkbox () - (interactive) - [...]) - -;; from modules/lang/org/autoload/evil.el -;;;###autoload (autoload '+org:attach "lang/org/autoload/evil" nil t) -(evil-define-command +org:attach (&optional uri) - (interactive "") - [...]) -#+END_SRC - -Autoload files named ~evil*.el~ will be ignored if =:feature evil= isn't loaded. - -** Additional files -The only convention is to prefix additional elisp files with a =+=, e.g. -=modules/feature/version-control/+git.el=. - -These are /not/ loaded automatically. Use ~load!~ to do so. - -#+BEGIN_SRC emacs-lisp -;; from modules/feature/version-control/config.el -(load +git) -#+END_SRC - -* Appendix -+ Macros - + ~(featurep! CATEGORY MODULE)~ - + ~(load! NAME)~ - + ~(package! NAME &key recipe pin)~ - + ~(require! CATEGORY MODULE &optional RELOAD-P)~ - + ~(def-package! NAME &rest PLIST)~ - + ~(set! SETTING &rest ARGS)~ - + ~(def-setting! NAME ARGLIST &rest BODY)~ -+ Commands - + ~doom/reload~ - + ~doom/reload-autoloads~ - + ~doom/compile~ - + ~doom/recompile~ - + ~doom/reset~ - + ~doom/clean-compiled~ - From b7d0f4dc3f75992c9405a0b0359701df3253bd44 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 19 Aug 2017 21:58:51 +0200 Subject: [PATCH 40/64] Simplify modules/private/README.org (replaced by wiki) --- modules/private/README.org | 67 +++----------------------------------- 1 file changed, 4 insertions(+), 63 deletions(-) diff --git a/modules/private/README.org b/modules/private/README.org index 8b804c47e..1046141fa 100644 --- a/modules/private/README.org +++ b/modules/private/README.org @@ -1,67 +1,8 @@ #+TITLE: :private modules -Place your personal customizations here. My private module is there for reference. I recommend you do not delete/rename it, but instead, copy it to your own. +Use this directory to store your private configuration modules. -- [[#loading-your-private-module][Loading your private module]] -- [[#reconfiguring-packages][Reconfiguring packages]] -- [[#installing-your-own-packages][Installing your own packages]] +Mine is included as a reference. I recommend you neither delete nor rename it, to avoid merge conflicts upstream. -* Loading your private module -+ ~:private {user-login-name}~ is loaded automatically after all other modules. - - Keeping it in your init.el is unnecessary, but harmless. - -+ ~private/{user-login-name}/init.el~ is a special file, unique to the private module named after your username in ~user-login-name~. It is loaded immediately after DOOM core is, but before any module is. This gives you an opportunity to overwrite variables and settings earlier. I will refer to this as your "private init.el". - -* Reconfiguring packages -If your configuration needs are simple, ~add-hook!~ and ~after!~ will be sufficient to reconfigure packages: - -#+BEGIN_SRC emacs-lisp -;; private/hlissner/config.el - -(after! evil - (setq evil-magic nil)) - -;; Takes a major-mode or a quoted hook function -(add-hook! python-mode - (setq python-shell-interpreter "bpython")) -#+END_SRC - -Look into ~def-package-hook!~ if you need more customizability. It lets you disable, add to or overwrite DOOM's ~def-package!~ blocks. These are powered by ~use-package~'s inject-hooks under the hood. - -*They must be used from your private init.el to work.* - -#+BEGIN_SRC emacs-lisp -;; private/hlissner/init.el - -;; To disable a package -(def-package-hook! evil-goggles :disable) - -;; If a :pre-init / :pre-config hook returns nil, it overwrites that -;; package's original :init / :config block. Exploit this to overwrite -;; DOOM's config. Otherwise, make sure they always return non-nil! -(def-package-hook! doom-themes - :pre-config - (setq doom-neotree-file-icons t) - nil) - -;; Otherwise, you append to a packages config -(def-package-hook! evil - :pre-init - (setq evil-magic nil) - t) - -;; `def-package-hook' also has :post-init and :post-config hooks -#+END_SRC - -* Installing your own packages -Your private module is otherwise like any other module. It may possess a packages.el file, which -- with the advantage of being loaded last -- may be used not only to install your own packages, but overwrite past ~package!~ declarations. - -#+BEGIN_SRC emacs-lisp -;; prevent a certain package from being installed; pair this with something -;; like (def-package-hook! evil-goggles :disable) in your private init.el -(package! evil-goggles :ignore t) - -;; Tell doom to get evil from somewhere else -(package! evil :recipe (:fetcher github :repo "hlissner/my-evil-fork")) -#+END_SRC +----- +You'll find [[/wiki/Customization][more information about customizing Doom]] on the [[/wiki][wiki]]. From cbabf6849c492455e39d86f576b6c26589823d6f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 21 Aug 2017 20:07:07 +0200 Subject: [PATCH 41/64] Standardize module READMEs --- modules/app/email/README.org | 32 +++---- modules/app/irc/README.org | 16 ++-- modules/completion/company/README.org | 32 +++---- modules/completion/ivy/README.org | 115 +++++++++++++------------- modules/feature/eval/README.org | 36 ++++---- modules/feature/evil/README.org | 37 +++++---- modules/lang/cc/README.org | 17 ++-- modules/lang/go/README.org | 12 ++- modules/lang/haskell/README.org | 43 +++++----- modules/lang/php/README.org | 16 ++-- modules/lang/rest/README.org | 10 ++- modules/tools/neotree/README.org | 2 +- modules/ui/doom-modeline/README.org | 21 +++-- modules/ui/doom/README.org | 58 +++++++++---- modules/ui/evil-goggles/README.org | 10 ++- modules/ui/nav-flash/README.org | 10 ++- 16 files changed, 281 insertions(+), 186 deletions(-) diff --git a/modules/app/email/README.org b/modules/app/email/README.org index 9faa36954..0e4fd9728 100644 --- a/modules/app/email/README.org +++ b/modules/app/email/README.org @@ -1,4 +1,4 @@ -* :app email +#+TITLE: :app email This module makes Emacs an email client, using ~mu4e~. @@ -10,41 +10,45 @@ It uses ~mu4e~ to read my email, but depends on ~offlineimap~ (to sync my email WARNING: my config is gmail/gsuite oriented, and since Google has its own opinions on the IMAP standard, it is unlikely to translate to other hosts. #+end_quote -** Install +* Table of Contents :TOC: +- [[#install][Install]] + - [[#macos][MacOS]] + - [[#arch-linux][Arch Linux]] +- [[#dependencies][Dependencies]] + +* Install This module requires: + ~offlineimap~ (to sync mail with) + ~mu~ (to index your downloaded messages) -*** MacOS +** MacOS #+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes") brew install mu --with-emacs brew install offlineimap #+END_SRC -*** Arch Linux +** Arch Linux #+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes") sudo pacman --noconfirm --needed -S offlineimap mu #+END_SRC -** Dependencies +* Dependencies You need to do the following: -1. Write a ~\~/.offlineimaprc~. 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 unix pass to securely store my login credentials. +1. Write a ~\~/.offlineimaprc~. 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. 2. Download your email: ~offlineimap -o~ (may take a while) 3. Index it with mu: ~mu index --maildir ~/.mail~ Then configure Emacs to use your email address: #+BEGIN_SRC emacs-lisp :tangle no -;; + %s is replaced with the label, e.g. /%s/Drafts => /lissner.net/Drafts -;; + Each path is relative to `+email-mu4e-mail-path', which is ~/.mail by -;; default -(set! :email "lissner.net" - '((mu4e-sent-folder . "/%s/Sent Mail") - (mu4e-drafts-folder . "/%s/Drafts") - (mu4e-trash-folder . "/%s/Trash") - (mu4e-refile-folder . "/%s/All Mail") +;; Each path is relative to `+email-mu4e-mail-path', which is ~/.mail by default +(set! :email "Lissner.net" + '((mu4e-sent-folder . "/Lissner.net/Sent Mail") + (mu4e-drafts-folder . "/Lissner.net/Drafts") + (mu4e-trash-folder . "/Lissner.net/Trash") + (mu4e-refile-folder . "/Lissner.net/All Mail") (smtpmail-smtp-user . "henrik@lissner.net") (user-mail-address . "henrik@lissner.net") (mu4e-compose-signature . "---\nHenrik Lissner")) diff --git a/modules/app/irc/README.org b/modules/app/irc/README.org index 703aec053..caf043a6d 100644 --- a/modules/app/irc/README.org +++ b/modules/app/irc/README.org @@ -1,11 +1,17 @@ -* :app irc +#+TITLE: :app irc This module turns adds an IRC client to Emacs ([[https://github.com/jorgenschaefer/circe][~circe~)]] with native notifications ([[https://github.com/eqyiel/circe-notifications][circe-notifications]]). -** Dependencies +* Table of Contents :TOC: +- [[#dependencies][Dependencies]] +- [[#configure][Configure]] + - [[#pass-the-unix-password-manager][Pass: the unix password manager]] + - [[#emacs-auth-source-api][Emacs' auth-source API]] + +* Dependencies This module has no dependencies, besides =gnutls-cli= or =openssl= for secure connections. -** Configure +* Configure Use the ~:irc~ setting to configure IRC servers. Its second argument (a plist) takes the same arguments as ~circe-network-options~. #+BEGIN_SRC emacs-lisp :tangle no @@ -19,7 +25,7 @@ Use the ~:irc~ setting to configure IRC servers. Its second argument (a plist) t *It is a obviously a bad idea to store auth-details in plaintext,* so here are some ways to avoid that: -*** Pass: the unix password manager +** Pass: the unix password manager [[https://www.passwordstore.org/][Pass]] is my tool of choice. I use it to manage my passwords. If you activate the [[/modules/tools/password-store/README.org][:tools password-store]] module you get an elisp API through which to access your password store. ~:irc~'s plist can use functions instead of strings. ~+pass-get-user~ and ~+pass-get-secret~ can help here: @@ -46,7 +52,7 @@ But wait, there's more! This stores your password in a public variable which cou And you're good to go! -*** Emacs' auth-source API +** Emacs' auth-source API ~auth-source~ is built into Emacs. As suggested [[https://github.com/jorgenschaefer/circe/wiki/Configuration#safer-password-management][in the circe wiki]], you can store (and retrieve) encrypted passwords with it. #+BEGIN_SRC emacs-lisp :tangle no diff --git a/modules/completion/company/README.org b/modules/completion/company/README.org index 56c60251c..76e9ad4ac 100644 --- a/modules/completion/company/README.org +++ b/modules/completion/company/README.org @@ -1,29 +1,33 @@ -* :completion company +#+TITLE: :completion company -This module adds completion support powered by [[https://github.com/company-mode/company-mode][company]]. +This module adds code-completion support, powered by [[https://github.com/company-mode/company-mode][company]]. + Uses ~company-quickhelp~ for documentation tooltips + Uses ~company-statistics~ to order results by usage frequency [[/../screenshots/company.png]] -** Install -Specific languages may require additional setup. Some languages may have no completion support at all. +* Table of Contents :TOC: +- [[#install][Install]] +- [[#configure][Configure]] + - [[#auto-completion][Auto-completion]] +- [[#troubleshooting][Troubleshooting]] + +* Install +Certain languages may require additional setup, and some languages may have no completion support at all. Check the README.org in that language's module for details. -** Customization -This module is configured to suit my preferences. Here are some things you may want to change: +* Configure +** Auto-completion +By default, I've disabled auto-completion. This is my preference. I prefer to invoke company when I need it by calling ~company-complete~ manually (typically, bound to =C-SPC= in insert mode). However, some may not share my preference. -*** as-you-type completion -By default, I've disabled auto-completion. This is my preference. I prefer to invoke company when I need it by pressing ~C-SPC~ from insert mode. Some don't like this. - -To make it automatic, you need to do two things: +To enable auto-completion you must: 1. Load ~company~, 2. and change ~company-idle-delay~ to a non-nil float (the default is 0.5) -To do this, add the following to your ~modules/private/~ module (remember, ~:private ~ needs to be added to init.el): +For example, add the following to your ~modules/private//config.el~ module: #+BEGIN_SRC emacs-lisp (require 'company) @@ -31,9 +35,9 @@ To do this, add the following to your ~modules/private/~ module (remem company-minimum-prefix-length 3) #+END_SRC -** Troubleshooting +* Troubleshooting If completion isn't working for you, please consider the following before posting a bug report: -+ Different languages will have different dependencies in order for auto-completion to work. Please look for the README.org in that language's respective module for details. ++ If what you are expecting is popup-as-you-type completion (which is disabled by default), see the "Customize" section above; it includes instructions on how to enable this. ++ Certain languages may have extra dependencies in order for auto-completion to work. Please look for that module's README.org for details. + Some languages don't have any auto-completion support. -+ Check [[*Customization][Customization]], perhaps what you are expecting is popup-as-you-type completion, which is disabled by default. diff --git a/modules/completion/ivy/README.org b/modules/completion/ivy/README.org index 3268e082f..b0732f935 100644 --- a/modules/completion/ivy/README.org +++ b/modules/completion/ivy/README.org @@ -1,93 +1,96 @@ -* :completion ivy +#+TITLE: :completion ivy -This module adds the Ivy completion backend. +This module adds Ivy, a completion backend. -I prefer ivy over ido and helm, for its speed and simplicity. With ivy's help and some hackery, I get the following features: +#+begin_quote +I prefer ivy over ido for its flexibility. I prefer ivy over helm because it's lighter. +#+end_quote -+ Project-wide search & replace powered by ~rg~ and ~ag~ ++ Project-wide search & replace powered by ~rg~ or ~ag~ + Project jump-to navigation ala Command-T, Sublime Text's Jump-to-anywhere or Vim's CtrlP plugin. + Ivy integration for ~M-x~, ~imenu~, ~recentf~ and others. + A powerful, interactive in-buffer search using ~swiper~. + Ivy-powered TODO/FIXME navigation -** Install +* Table of Contents :TOC: +- [[#install][Install]] + - [[#macos][MacOS]] + - [[#arch-linux][Arch Linux]] +- [[#usage][Usage]] + - [[#project-search--replace][Project search & replace]] + - [[#jump-to-file-project-navigation][Jump-to-file project navigation]] + - [[#in-buffer-searching][In-buffer searching]] + - [[#task-lookup][Task lookup]] +- [[#appendix][Appendix]] + - [[#commands][Commands]] + - [[#hacks][Hacks]] + +* Install This module optionally depends on [[https://github.com/BurntSushi/ripgrep][ripgrep]] and [[https://github.com/ggreer/the_silver_searcher][the_silver_searcher]]. -~rg~ is faster, but its results aren't deterministic and it doesn't support multiline search or full PCRE, that's where ~ag~ is useful. +~rg~ is faster, but its results aren't deterministic, neither does it support multiline search or full PCRE, that's where ~ag~ is useful. -*** MacOS +** MacOS #+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes") brew install ripgrep the_silver_searcher #+END_SRC -*** Arch Linux +** Arch Linux #+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes") sudo pacman --needed --noconfirm -S ripgrep the_silver_searcher #+END_SRC -** Usage -*** Search & Replace -A project-wide search can be performed with Ag (the silver searcher) or Rg -(ripgrep) via their ex commands: ~:ag[!]~ and ~:rg[!]~ (or their -current-directory counterparts ~:agcwd[!]~ and ~:rgcwd[!]~) +* Usage +Here is some insight into how I use this module. Keep in mind that the referenced commands and keybindings are defined [[/modules/private/hlissner][in my private module]]. + +** Project search & replace +Ex interfaces to Ag (the silver searcher) and Rg (ripgrep) are available: ~:ag[!]~ and ~:rg[!]~, or their current-directory counterparts ~:agcwd[!]~ and ~:rgcwd[!]~. [[/../screenshots/modules/completion/ivy/ivy-search.gif]] -From this session, you can press =Shift + Tab= to create an writeable occur -buffer in wgrep mode. +From this session, you can press =S+Tab= to create a writeable occur-buffer in wgrep mode. [[/../screenshots/modules/completion/ivy/ivy-search-replace.gif]] -Make your modifications and press =C-c C-c= to commit them, or =C-c C-k= to -abort. +Make your modifications and press =C-c C-c= to commit them, or =C-c C-k= to abort. -*** Jump-to-file project navigation -Inspired by Sublime Text's jump-to-anywhere, Vim's CtrlP or Unite plugins, and -Textmate's Command-T, a marriage of ~projectile~ and ~ivy~ makes this available -to you in Emacs. Invoke it with = /= or ~counsel-projectile-find-file~. +** Jump-to-file project navigation +Inspired by Sublime Text's jump-to-anywhere, Vim's CtrlP or Unite plugins, and Textmate's Command-T, a marriage of ~projectile~ and ~ivy~ makes this available to you in Emacs. Invoke it with =SPC f /=, =SPC SPC= or ~counsel-projectile-find-file~. [[/../screenshots/modules/completion/ivy/ivy-projectile.gif]] -*** In-buffer searching -I prefer to use ~evil-search~ (invoked by pressing =/= in normal mode) when -jumping small/moderate (or predictable) distances. On occasion I need more -feedback, so I turn to ~swiper~ (available directly with =M-x swiper RET=, or -via ~:sw[iper]~). +** In-buffer searching +I use ~evil-search~ (invoked by pressing =/= in normal mode) when jumping small/moderate (or predictable) distances. However, there are occasions where I need more feedback, so I turn to ~swiper~ (available directly with =M-x swiper RET=, or via ~:sw[iper]~). [[/../screenshots/modules/completion/ivy/ivy-swiper.gif]] -*** TODO-Task lookup -I sprinkle my projects with TODO's & FIXME's. Using ivy and ripgrep, I wrote -~+ivy/tasks~ to help me navigate to them. It can be invoked via ~:todo[!]~ as -well. +** Task lookup +I sprinkle my projects with TODO's & FIXME's. You can navigate to and peruse them via ~M-x +ivy/tasks~ or ~:todo[!]~ (ex command). [[/../screenshots/modules/completion/ivy/ivy-todo.gif]] -** Appendix -*** Commands & Keybindings -Here is a list of my commonly used commands, their default keybinds (defined in -[[../../private/hlissner/+bindings.el][private/hlissner/+bindings.el]]), and their corresponding ex command (defined in -[[../../private/hlissner/+commands.el][private/hlissner/+commands.el]]). +* Appendix +** Commands +Here is a list of my commonly used commands, their default keybinds (defined in [[../../private/hlissner/+bindings.el][private/hlissner/+bindings.el]]), and their corresponding ex command (defined in [[../../private/hlissner/+commands.el][private/hlissner/+commands.el]]). -| command | key / ex command | description | -|-------------------------------------+---------------------+------------------------------------------------------------------| -| ~counsel-M-x~ | =M-x= | Smarter, smex-powered M-x | -| ~counsel-bookmark~ | = b= | Find bookmark | -| ~counsel-find-file~ | = .= | Browse from current directory | -| ~counsel-projectile-find-file~ | = /= | Find file in project | -| ~counsel-projectile-switch-project~ | = p= | Open another project | -| ~counsel-recentf~ | = r= | Find recently opened file | -| ~+ivy/switch-buffer~ | = ,= | Jump to buffer in current workspace | -| ~+ivy/switch-workspace-buffer~ | = <= | Jump to buffer across workspaces | -| ~+ivy:ag~ | ~:ag[!] [QUERY]~ | Search project (BANG = ignore gitignore) | -| ~+ivy:ag-cwd~ | ~:agcwd[!] [QUERY]~ | Search this directory (BANG = don't recurse into subdirectories) | -| ~+ivy:rg~ | ~:rg[!] [QUERY]~ | Search project (if BANG, ignore gitignore) | -| ~+ivy:rg-cwd~ | ~:rgcwd[!] [QUERY]~ | Search this directory (BANG = don't recurse into subdirectories) | -| ~+ivy:swiper~ | ~:sw[iper] [QUERY]~ | Search current buffer | -| ~+ivy:todo~ | ~:todo[!]~ | List all TODO/FIXMEs in project (or current file if BANG) | +| command | key / ex command | description | +|-------------------------------------+------------------------+------------------------------------------------------------------| +| ~counsel-M-x~ | =M-x= | Smarter, smex-powered M-x | +| ~counsel-bookmark~ | =SPC RET= | Find bookmark | +| ~counsel-find-file~ | =SPC f .= or =SPC .= | Browse from current directory | +| ~counsel-projectile-find-file~ | =SPC f /= or =SPC SPC= | Find file in project | +| ~counsel-projectile-switch-project~ | =SPC p p= | Open another project | +| ~counsel-recentf~ | =SPC f r= | Find recently opened file | +| ~ivy-switch-buffer~ | =SPC b b= | Jump to buffer in current workspace | +| ~+ivy/switch-workspace-buffer~ | =SPC b B= | Jump to buffer across workspaces | +| ~+ivy:ag~ | ~:ag[!] [QUERY]~ | Search project (BANG = ignore gitignore) | +| ~+ivy:ag-cwd~ | ~:agcwd[!] [QUERY]~ | Search this directory (BANG = don't recurse into subdirectories) | +| ~+ivy:rg~ | ~:rg[!] [QUERY]~ | Search project (if BANG, ignore gitignore) | +| ~+ivy:rg-cwd~ | ~:rgcwd[!] [QUERY]~ | Search this directory (BANG = don't recurse into subdirectories) | +| ~+ivy:swiper~ | ~:sw[iper] [QUERY]~ | Search current buffer | +| ~+ivy:todo~ | ~:todo[!]~ | List all TODO/FIXMEs in project (or current file if BANG) | -While in a search (e.g. invoked from ~+ivy:ag~ or ~+ivy:rg~), these new -keybindings are available to you: +While in a search (e.g. invoked from ~+ivy:ag~ or ~+ivy:rg~), these new keybindings are available to you: | key | description | |-------------+--------------------------------------------------------------------------------| @@ -95,10 +98,8 @@ keybindings are available to you: | =C-SPC= | Preview the current candidate | | =M-RET= | Open the selected candidate in other-window | -*** Hacks -+ Where possible, functions with ivy/counsel equivalents have been remapped - (like ~find-file~ => ~counsel-find-file~). So a keybinding to ~find-file~ will - invoke ~counsel-find-file~ instead. +** Hacks ++ Functions with ivy/counsel equivalents have been globally remapped (like ~find-file~ => ~counsel-find-file~). So a keybinding to ~find-file~ will invoke ~counsel-find-file~ instead. + ~counsel-[arp]g~'s 3-character limit was reduced to 1 (mainly for the ex command) + ~counsel-[arp]g~'s parentheses quoting behavior was reversed. Now, if you want literal parentheses, you must escape them: e.g. ~\(match\)~ is literal, diff --git a/modules/feature/eval/README.org b/modules/feature/eval/README.org index a8aed9f42..ff669433d 100644 --- a/modules/feature/eval/README.org +++ b/modules/feature/eval/README.org @@ -1,17 +1,21 @@ -* :feature eval +#+TITLE: :feature eval -This module adds support for: +This modules adds support for REPLs, build tasks and code evaluation. -+ [[#repls][Defining, invoking & interacting with REPLs]], -+ [[#build-tasks][Defining & invoking build tasks for projects and files]], -+ and [[#code-evaluation][evaluating code or entire buffers, printing their output to a popup window]]. +* Table of Contents :TOC: +- [[#install][Install]] +- [[#usage][Usage]] +- [[#configuration][Configuration]] + - [[#repls][REPLs]] + - [[#build-tasks][Build Tasks]] + - [[#code-evaluation][Code Evaluation]] -** Install +* Install This module has no external dependencies. However, specific languages may require additional setup. Check the README.org in that language's module for details. -** Usage +* Usage + *REPLs* Invoked via: + ~:repl~ (evil ex-command) @@ -33,13 +37,15 @@ Check the README.org in that language's module for details. + ~M-x +eval/region-and-replace~ + Evil users can use the ~gr~ operator to select and run a region. -** Configuration -*** REPLs -REPLs have been defined for most of the languages DOOM supports (check its README.org to see if it does). +* Configuration +** REPLs +REPLs are defined for most of the languages Doom supports (check its README.org to see if it does). -Otherwise, you can define your own: +Otherwise, you can define your own for a specified major-mode with the =:repl= setting. -A REPL definition consists of two parts: an interactive command that opens (and returns) a REPL buffer and a ~:repl~ definition that maps a major-mode to said command: +~(set! :repl MAJOR-MODE FUNCTION)~ + +FUNCTION must return the repl buffer. Any window changes are ignored, then handed off to shackle (assuming shackle-mode is on) to display in a popup window. #+BEGIN_SRC emacs-lisp (defun +emacs-lisp/repl () @@ -54,8 +60,8 @@ A REPL definition consists of two parts: an interactive command that opens (and (set! :repl 'emacs-lisp-mode #'+emacs-lisp/repl) #+END_SRC -*** Build Tasks -A build task is little more than major-mode-local commands, comprised of an interactive command, an association with a major mode and an optional predicate function. +** Build Tasks +A build task is little more than a major-mode-local interactive command that performs a task, such as compiling the current project or running unit tests. A predicate function can be supplied to ensure a command is only available when it is appropriate. #+BEGIN_SRC emacs-lisp (defun +lua/run-love () @@ -83,7 +89,7 @@ A build task is little more than major-mode-local commands, comprised of an inte (set! :build 'generate-docs 'lua-mode #'+lua/generate-docs) #+END_SRC -*** Code Evaluation +** Code Evaluation Run regions or entire buffers with [[https://github.com/syohex/emacs-quickrun][Quickrun]]. Output will be sent to a popup window. Quickrun includes support for many languages, but occasionally, you'll find a language without support, such as [[https://crystal-lang.org/][Crystal]]. A "runner" can be defined like so: diff --git a/modules/feature/evil/README.org b/modules/feature/evil/README.org index 7fbf55f38..1ba70d4cb 100644 --- a/modules/feature/evil/README.org +++ b/modules/feature/evil/README.org @@ -1,20 +1,27 @@ -* :feature evil +#+TITLE: :feature evil -This holy module brings vim to Emacs. +This holy module brings the vim experience to Emacs. -** Removing evil-mode -Some users want vanilla Emacs back. To do so remove =:feature evil= from init.el. Evil-specific configuration and keybindings (defined with ~map!~) will be ignored without evil present (and removed when byte-compiling). +* Table of Contents :TOC: +- [[#removing-evil-mode][Removing evil-mode]] +- [[#features][Features]] + - [[#multiple-cursors][Multiple-cursors]] + - [[#a-hybrid-code-folding-system][A hybrid code-folding system]] + - [[#hacks][Hacks]] + - [[#differences-from-vim][Differences from vim]] -** Differences from vanilla evil -*** Overview -+ A better ~:g[lobal]~ command with match highlighting -+ ~:al[ign]~: an ex interface to ~align-regexp~ with match highlighting +* Removing evil-mode +To get back a more vanilla Emacs experience, remove =:feature evil= from init.el. Evil-specific configuration and keybindings (defined with ~map!~) will be ignored without evil present (and removed when byte-compiling). + +* Features ++ A better ~:g[lobal]~ command with incremental highlighting. ++ Adds the ~:al[ign]~ ex command: offers an ex interface to ~align-regexp~ with incremental highlighting. + Support for more of vim's filename modifiers in ex commands (like ~:p~, ~:p:h~ or ~:t~) than vanilla evil-mode offers. + A list of new text objects: + Blocks: ~B~ (from ~evil-textobj-anyblock~) + Args: ~a~ (from ~evil-args~) + Indentation: ~i~ / ~I~ / ~J~ (from ~evil-indent-plus~) -+ Ported vim plugins: ++ Incorporates vim functionality ported to evil: + ~vim-commentary~ => ~evil-commentary~ + ~vim-easymotion~ => ~evil-easymotion~ + ~vim-multiedit~ => ~evil-multiedit~ @@ -23,19 +30,21 @@ Some users want vanilla Emacs back. To do so remove =:feature evil= from init.el + ~vim-surround~ => ~evil-embrace~ & ~evil-surround~ + =NERDTree= equivalent is available in =:tools neotree= -*** Multiple-cursors +** Multiple-cursors Two multiple-cursor implementations exist in this module: ~evil-mc~ and ~evil-multiedit~. Together, these provide the functionality of ~vim-multiple-cursors~. The former lets you place "clone" cursors. The latter lets you interactively edit many regions from one place (like an interactive version of ~:%s~). -*** A saner code-folding system -This module combines ~evil-vimish-fold~ (allows arbitrary folds) and ~hideshow~ (folds based on markers and indent) to create a more consistent code-folding system. All the vim folding keys should work (=zr=, =zm=, =za=, =zo=, etc). +** A hybrid code-folding system +This module combines ~evil-vimish-fold~ and ~hideshow~. The former allows arbitrary folds and the latter allows folds on markers and indentation. Together, they create a more consistent (and feature-complete) code-folding system. -*** Hacks +Most vim folding keys should work, e.g. =zr=, =zm=, =za=, =zo=, etc. + +** Hacks + Automatically moves to new window when splitting + If in visual mode, =*= and =#= will search for the current selection instead of the word-at-point. ** Differences from vim + Column-wise ranges in ex commands are enabled by default. i.e. the range in =:'<,'>s/a/b= will only affects the visual selection, not full lines (see ~evil-ex-visual-char-range~). -+ =:g= will highlight buffer matches incrementally. ++ =:g= will incrementally highlight buffer matches. diff --git a/modules/lang/cc/README.org b/modules/lang/cc/README.org index a4fc8dbed..767519879 100644 --- a/modules/lang/cc/README.org +++ b/modules/lang/cc/README.org @@ -1,4 +1,4 @@ -* :lang cc +#+TITLE: :lang cc This module adds support for the C-family of languages: C, C++, and Objective-C. @@ -8,17 +8,23 @@ This module adds support for the C-family of languages: C, C++, and Objective-C. + Code navigation (~irony~) + File Templates ([[../../feature/file-templates/templates/c-mode][c-mode]], [[../../feature/file-templates/templates/c++-mode][c++-mode]]) + Snippets ([[https://github.com/hlissner/emacs-snippets/tree/master/cc-mode][cc-mode]], [[https://github.com/hlissner/emacs-snippets/tree/master/c-mode][c-mode]], [[https://github.com/hlissner/emacs-snippets/tree/master/c++-mode][c++-mode]]) ++ Several improvements to C++11 indentation and syntax highlighting. #+begin_quote -C contends with Haskell and Ruby for my favorite language. It's hard to beat this combination of simplicity and power. I've used C for my work since 2009, and it (along with C++) is a personal favorite for game development (with SDL, SFML or, more recently, cocos2d). +C contends with Haskell and Ruby for my favorite language. That said, it's more accurate to say I write C, but with two or three C++ features. The module provides nominal support for Objective-C, which I really only use to inspect generated glue code for iOS mobile apps. Otherwise, I prefer Swift. #+end_quote -** Install +* Table of Contents :TOC: +- [[#install][Install]] + - [[#macos][MacOS]] + - [[#arch-linux][Arch Linux]] + +* Install This module requires ~irony-server~ for most of its features, which depends on ~cmake~ and ~libclang~. -*** MacOS +** MacOS Due to linking issues, MacOS users must compile irony-server manually: #+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes") @@ -43,9 +49,10 @@ popd rm -rf irony-mode #+END_SRC -*** Arch Linux +** Arch Linux #+BEGIN_SRC sh :tangle (if (doom-system-os 'arch) "yes") sudo pacman --needed --noconfirm -S clang cmake #+END_SRC Then run ~M-x irony-install-server~ in Emacs. + diff --git a/modules/lang/go/README.org b/modules/lang/go/README.org index 4fd9ae885..c5a230d72 100644 --- a/modules/lang/go/README.org +++ b/modules/lang/go/README.org @@ -1,4 +1,4 @@ -* :lang go +#+TITLE: :lang go This module adds [[https://golang.org][Go]] support. @@ -13,12 +13,18 @@ This module adds [[https://golang.org][Go]] support. + [[https://github.com/hlissner/emacs-snippets/tree/master/go-mode][Snippets]] #+begin_quote -I have mixed feelings about Go. It's a decent compromise between C and higher-level languages. It's a pleasantly straight-forward language with elegant syntax, but it lacks /native/ support for certain luxuries I miss from other languages, like generics, optional arguments, and function overloading. You've got to learn to love ~interface{}~. +I have mixed feelings about Go. It's a decent compromise between C and higher-level languages, is pleasantly straight-forward and elegant, but lacks /native/ support for luxuries I miss from other languages, like generics, optional arguments, and function overloading. You've got to learn to love ~interface{}~. Still, Go has been a remarkably useful (and fast!) companion for a variety of small-to-medium backend web and CLI projects. #+end_quote -** Install +* Table of Contents :TOC: +- [[#install][Install]] + - [[#go][Go]] + - [[#dependencies][Dependencies]] + +* Install +** Go To get started with Go, you need the ~go~ tool: *** MacOS diff --git a/modules/lang/haskell/README.org b/modules/lang/haskell/README.org index 400be2592..7961af579 100644 --- a/modules/lang/haskell/README.org +++ b/modules/lang/haskell/README.org @@ -1,4 +1,4 @@ -* :lang haskell +#+TITLE: :lang haskell This module adds [[https://www.haskell.org/][Haskell]] support. @@ -11,52 +11,55 @@ This module adds [[https://www.haskell.org/][Haskell]] support. + [[https://github.com/hlissner/emacs-snippets/tree/master/haskell-mode][Snippets]] #+begin_quote -Haskell contends with C and Ruby as my favorite language. I don't think my Haskell code will ever save the world, but I'll reach for it when working on smaller projects and programming exercises (like projecteuler.com or exercism.io). +Haskell contends with C and Ruby as my favorite language. I don't think my Haskell code will ever save the world, but I'll reach for it for small projects and programming exercises (like projecteuler.com or exercism.io). I'd love to incorporate more of it into my machine learning work, but Python and Julia hold that crown. For now. #+end_quote -** Install -To get started with Haskell, you need: +* Table of Contents :TOC: +- [[#install][Install]] + - [[#haskell][Haskell]] + - [[#dependencies][Dependencies]] +- [[#troubleshooting][Troubleshooting]] +- [[#resources][Resources]] -+ cabal (the haskell package builder) -+ ghc/ghci (the compiler, syntax checker & repl) +* Install +** Haskell +To get started with Haskell, you need *stack* installed. *** MacOS #+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes") -brew install cabal-install ghc +brew install haskell-stack +stack setup #+END_SRC *** Arch Linux #+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes") -sudo pacman --needed --noconfirm -S cabal-install ghc +sudo pacman --needed --noconfirm -S stack +# Replace pacaur with your AUR package manager of choice +pacaur --needed --noconfirm -S ncurses5-compat-lib +stack setup #+END_SRC ** Dependencies -This module requires the following ~cabal~ packages: - -+ ~happy~ (required by ~haskell-src-exts~) -+ ~haskell-src-exts~ (required by ~ghc-mod~ & ~hoogle~) -+ ~ghc-mod~ (for auto-completion) -+ ~hoogle~ (for documentation lookup) +This module requires ~ghc-mod~ (as well as ~intero~, but those will be automatically installed). #+BEGIN_SRC sh -cabal update -cabal install happy haskell-src-exts ghc-mod hoogle +stack install ghc-mod #+END_SRC -Ensure that ~\~/.cabal/bin~ is in ~PATH~: +Also ensure that ~\~/.local/bin~ is in ~PATH~: #+BEGIN_SRC sh # place this in your profile file, like ~/.bash_profile or ~/.zshenv -export PATH="~/.cabal/bin:$PATH" +export PATH="~/.local/bin:$PATH" #+END_SRC -** Troubleshooting +* Troubleshooting + Stack users: if a ~dist/setup-config~ file exists in your project, [[ https://github.com/DanielG/ghc-mod/wiki#known-issues-related-to-stack][ghc-mod may refuse to work]]. -** Resources +* Resources Here are a few resources I've found indespensible in my Haskell adventures: + [[http://learnyouahaskell.com/][Learn you a haskell for great good]] diff --git a/modules/lang/php/README.org b/modules/lang/php/README.org index dae07fe8c..418ce8fde 100644 --- a/modules/lang/php/README.org +++ b/modules/lang/php/README.org @@ -1,4 +1,4 @@ -* :lang php +#+TITLE: :lang php This module adds support for PHP 5.3+ (including PHP7). @@ -12,14 +12,18 @@ This module adds support for PHP 5.3+ (including PHP7). + [[https://github.com/hlissner/emacs-snippets/tree/master/php-mode][Snippets]] #+begin_quote -PHP was the first programming language I got paid to code in, back in the Cretaceous period (2003). I'm so, so sorry. All those programmers who inherited my earliest PHP work. I know you're out there, writhing in your straitjackets. - -I suppose it's hip for programmers to projectile vomit to any mention of PHP, but they have good reason to. Not because it's /necessarily/ a bad language, and not /just/ because of a couple inconsistently ordered parameters, but because it's too easy to make junk with. You've heard the war stories. +PHP was the first programming language I got paid to code in, back in the Cretaceous period (2003). My sincerest apologies go out to all the programmers who inherited my earliest PHP work. I know you're out there, writhing in your straitjackets. Save a programmer today. Stop a friend from choosing PHP as their first language. #+end_quote -** Install +* Table of Contents :TOC: +- [[#install][Install]] + - [[#php][PHP]] + - [[#dependencies][Dependencies]] + +* Install +** PHP To get started with PHP, you'll need ~php~ (5.3+) and ~composer~: *** MacOS @@ -37,7 +41,7 @@ sudo pacman --needed --noconfirm -S php composer # or php53, php54, php55 #+END_SRC ** Dependencies -The features in this module optionally depends on the following php packages: +The features in this module optionally depend on the following php packages: + ~boris~ (REPL) + ~phpctags~ (better code completion) diff --git a/modules/lang/rest/README.org b/modules/lang/rest/README.org index 001509114..bd3d163c7 100644 --- a/modules/lang/rest/README.org +++ b/modules/lang/rest/README.org @@ -1,4 +1,4 @@ -* :lang rest +#+TITLE: :lang rest This module adds [[https://en.wikipedia.org/wiki/Representational_state_transfer][REST]] support. @@ -10,10 +10,14 @@ This module adds [[https://en.wikipedia.org/wiki/Representational_state_transfer ~restclient-mode~ is tremendously useful for testing REST APIs. My workflow is to open an ~org-mode~ buffer, create a restclient source block and hack away. ~restclient-mode~ and ~company-restclient~ power this arcane wizardry. #+end_quote -** Install +* Table of Contents :TOC: +- [[#install][Install]] +- [[#example][Example]] + +* Install No additional setup required. -** Example +* Example #+BEGIN_SRC restclient GET https://jsonplaceholder.typicode.com/posts/1 #+END_SRC diff --git a/modules/tools/neotree/README.org b/modules/tools/neotree/README.org index f5e448181..280a97c3d 100644 --- a/modules/tools/neotree/README.org +++ b/modules/tools/neotree/README.org @@ -1,4 +1,4 @@ -* :evil neotree +#+TITLE: :evil neotree This module brings a side panel for browsing project files, inspired by vim's NERDTree. diff --git a/modules/ui/doom-modeline/README.org b/modules/ui/doom-modeline/README.org index 6ff36de4b..fcb8f4685 100644 --- a/modules/ui/doom-modeline/README.org +++ b/modules/ui/doom-modeline/README.org @@ -1,4 +1,4 @@ -* :ui doom-modeline +#+TITLE: :ui doom-modeline This module customizes the Emacs mode-line. @@ -17,12 +17,18 @@ The DOOM modeline was designed for minimalism, and offers: [[/../screenshots/ml-version.png]] [[/../screenshots/ml-errors.png]] -** Install +* Table of Contents :TOC: +- [[#install][Install]] +- [[#extracting-my-modeline][Extracting my modeline]] +- [[#troubleshooting][Troubleshooting]] + - [[#where-are-my-minor-modes][Where are my minor modes?]] + +* Install This module requires the fonts included with ~all-the-icons~ to be installed. Run ~M-x all-the-icons-install-fonts~ to do so. -** Extracting my modeline +* Extracting my modeline Some might want my modeline without the DOOM config altogether. I've tried to make this easier for you, but there are a few things you'll need to do: + Ensure [[https://github.com/bbatsov/projectile][projectile]] and [[https://github.com/domtronn/all-the-icons.el][all-the-icons]] are installed. @@ -30,7 +36,6 @@ Some might want my modeline without the DOOM config altogether. I've tried to ma + Ensure the fonts included with ~all-the-icons~ are installed (~M-x all-the-icons-install-fonts~). + Replace ~def-package!~ calls with ~use-package~. + Replace ~doom-project-root~ calls with ~projectile-project-root~. -+ Change the one ~def-memoized!~ function to ~defun~. + The ~+doom-modeline--make-xpm~ function is memoized with the ~def-memoized!~ macro. Change ~def-memoized!~ to ~defun~. + Copy the ~add-hook!~ macro definition from [[/master/core/core-lib.el][core/core-lib.el]]. + Copy the following macros and functions from [[/master/core/core-ui.el][core/core-ui.el]]: @@ -40,8 +45,8 @@ Some might want my modeline without the DOOM config altogether. I've tried to ma + ~doom-modeline~ + ~doom-set-modeline~ -That /should/ be everything. As I have never used this out of my config I can't guarantee immediate success, but I'd be happy to help you out. File an issue. +That /should/ be everything. As I have never used this out of my config I can't guarantee immediate success, but I'd be happy to help you out if you file an issue. -** Troubleshooting -*** Where are my minor-modes? -I didn't need it, so I removed it. I wrote ~doom/what-minor-mode~ in the rare case I needed to investigate the currently active minor modes however. +* Troubleshooting +** Where are my minor modes? +I didn't need it, so I removed it. Run ~M-x doom/what-minor-mode~ to investigate what minor modes are currently active. diff --git a/modules/ui/doom/README.org b/modules/ui/doom/README.org index bc5077361..7900474a8 100644 --- a/modules/ui/doom/README.org +++ b/modules/ui/doom/README.org @@ -1,32 +1,60 @@ -* :ui doom +#+TITLE: :ui doom This module modifies Emacs' user interface. -DOOM's look is loosely inspired by Atom's One Dark theme, and is largely contained in the [[https://github.com/hlissner/emacs-doom-theme/][doom-themes]] plugin. +Doom's look is loosely inspired by Atom's One Dark theme, and is largely contained in the] plugin. -By default, this module uses: ++ A colorscheme inspired by Atom's One Dark theme (now available in a separate plugin: [[https://github.com/hlissner/emacs-doom-theme/][doom-themes]]) ++ Uses the [[https://github.com/mozilla/Fira][Fira Mono and Fira Sans]] fonts, and [[https://dejavu-fonts.github.io/][DejaVu Sans Mono]] for unicode symbols. ++ A custom folded-region indicator for ~hideshow~ ++ "Thin bar" fringe bitmaps for ~git-gutter-fringe~ ++ File-visiting buffers are slightly brighter (powered by solaire-mode) -+ [[https://github.com/mozilla/Fira][Fira Mono and Fira Sans]] (fonts) -+ [[https://dejavu-fonts.github.io/][DejaVu Sans Mono]] (font, for displaying unicode characters) -+ ~hideshow~, modified to use a nicer folded-region indicator. -+ Custom fringe bitmaps for ~git-gutter-fringe~ (thin bars) +* Table of Contents :TOC: +- [[#install][Install]] + - [[#macos][MacOS]] + - [[#arch-linux][Arch Linux]] +- [[#configuration][Configuration]] + - [[#changing-fonts][Changing fonts]] +- [[#troubleshooting][Troubleshooting]] + - [[#strange-font-symbols][Strange font symbols]] -** Install -[[https://github.com/mozilla/Fira][Fira Mono]] is this module's only dependency (if you want to use it). +* Install +This module optionally depends on: -*** MacOS ++ The [[https://github.com/mozilla/Fira][Fira Mono]] family of fonts ++ [[https://dejavu-fonts.github.io/][DejaVu Sans Mono]] + +You don't have to install these if you use a different font. + +** MacOS #+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes") brew tap caskroom/fonts brew cask install font-fira-{sans,mono} font-dejavu-sans #+END_SRC -*** Arch Linux +** Arch Linux #+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes") sudo pacman --noconfirm --needed -S ttf-fira-{sans,mono} ttf-dejavu #+END_SRC -** Troubleshooting -*** Strange font symbols -If you're getting strange unicode symbols, that is likely ~all-the-icons~ doing (caused by other UI modules, specifically [[../doom-modeline][doom-modeline]] and [[../doom-dashboard][doom-dashboard]]). +* Configuration +** Changing fonts +There are four font settings you can change: -You must install the fonts included with ~all-the-icons~ with: ~M-x all-the-icons-install-fonts~. ++ ~:font~ :: the default font. ++ ~:big-font~ :: the font to use when ~doom-big-font-mode~ is enabled. ++ ~:variable-font~ :: the font to use when ~variable-pitch-mode~ is active (or where the ~variable-pitch~ face is used). ++ ~:unicode-font~ :: the font used to display unicode symbols. This is ignored if the =:ui unicode= module is enabled. + +#+BEGIN_SRC emacs-lisp +;; These are the defaults of this module +(set! :font "Fira Mono" :size 12) +(set! :big-font "Fira Mono" :size 18) +(set! :variable-font "Fira Sans" :size 12) +(set! :unicode-font "DejaVu Sans Mono" :size 12) +#+END_SRC + +* Troubleshooting +** Strange font symbols +If you're seeing strange unicode symbols, this is likely because you don't have ~all-the-icons~'s font icon installed. You can install them with ~M-x all-the-icons-install-fonts~. diff --git a/modules/ui/evil-goggles/README.org b/modules/ui/evil-goggles/README.org index e0f756b16..a358d75be 100644 --- a/modules/ui/evil-goggles/README.org +++ b/modules/ui/evil-goggles/README.org @@ -1,12 +1,16 @@ -* :ui evil-goggles +#+TITLE: :ui evil-goggles This module uses ~evil goggles~ to displays visual hints when editing with evil. -** Install +* Table of Contents :TOC: +- [[#install][Install]] +- [[#configure][Configure]] + +* Install This module requires: + ~evil~ (inherently tied to evil mode) -** Configure +* Configure By default, ~evil-goggles~ will be enabled by default and requires no additional configuration. diff --git a/modules/ui/nav-flash/README.org b/modules/ui/nav-flash/README.org index 416098161..7fd4772ce 100644 --- a/modules/ui/nav-flash/README.org +++ b/modules/ui/nav-flash/README.org @@ -1,4 +1,4 @@ -* :ui nav-flash +#+TITLE: :ui nav-flash This module uses ~nav-flash~ to flash the line around the cursor after any motion command that might reasonably send the cursor somewhere the eyes can't follow. @@ -6,10 +6,14 @@ This module uses ~nav-flash~ to flash the line around the cursor after any motio Tremendously helpful on a 30" 2560x1600 display. #+end_quote -** Install +* Table of Contents :TOC: +- [[#install][Install]] +- [[#configure][Configure]] + +* Install This module has no other dependencies. -** Configure +* Configure By default, ~nav-flash~ will be triggered whenever ~recenter~ is called. =:feature jump= attaches ~recenter~ to various hooks: #+BEGIN_SRC emacs-lisp From 4ff80cf4164b8435505b01a2b20ddf29f3a5c6d4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 21 Aug 2017 20:12:25 +0200 Subject: [PATCH 42/64] Add READMEs for several modules --- modules/feature/snippets/README.org | 27 ++++++++++++++++ modules/lang/javascript/README.md | 16 ---------- modules/lang/javascript/README.org | 46 ++++++++++++++++++++++++++++ modules/lang/perl/README.org | 13 ++++++++ modules/lang/sh/README.org | 22 +++++++++++++ modules/ui/doom-dashboard/README.org | 17 ++++++++++ modules/ui/doom-quit/README.org | 7 +++++ modules/ui/hl-todo/README.org | 13 ++++++++ modules/ui/tabbar/README.org | 5 +++ modules/ui/unicode/README.org | 10 ++++++ 10 files changed, 160 insertions(+), 16 deletions(-) create mode 100644 modules/feature/snippets/README.org delete mode 100644 modules/lang/javascript/README.md create mode 100644 modules/lang/javascript/README.org create mode 100644 modules/lang/perl/README.org create mode 100644 modules/lang/sh/README.org create mode 100644 modules/ui/doom-dashboard/README.org create mode 100644 modules/ui/doom-quit/README.org create mode 100644 modules/ui/hl-todo/README.org create mode 100644 modules/ui/tabbar/README.org create mode 100644 modules/ui/unicode/README.org diff --git a/modules/feature/snippets/README.org b/modules/feature/snippets/README.org new file mode 100644 index 000000000..3a81372b6 --- /dev/null +++ b/modules/feature/snippets/README.org @@ -0,0 +1,27 @@ +#+TITLE: :feature snippets + +This module adds snippets to Emacs, powered by yasnippet. + +* Table of Contents :TOC: +- [[#install][Install]] + +* Install +There are no extra dependencies for this module. + +By default, this module uses the snippet library included with yasnippet. + +For the best experience, I'd suggest installing mine from https://github.com/hlissner/emacs-snippets -- they have been tailored specifically for Doom. + +1. Clone the repo to your private module: + #+BEGIN_SRC bash + git clone https://github.com/hlissner/emacs-snippets ~/.emacs.d/modules/private/$(whoami)/snippets + #+END_SRC +2. Tell yasnippet where to look for them: + #+BEGIN_SRC emacs-lisp + ;; modules/private/{USERNAME}/config.el + (after! yasnippet + (setq yas-snippet-dirs + (append (list (expand-file-name "snippets/" (file-name-directory load-file-name))) + (delq 'yas-installed-snippets-dir yas-snippet-dirs)))) + #+END_SRC + diff --git a/modules/lang/javascript/README.md b/modules/lang/javascript/README.md deleted file mode 100644 index 9002dba68..000000000 --- a/modules/lang/javascript/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# javascript - -Javascript support, including auto-completion (tern), REPL support -(nodejs-repl), refactoring commands (js2-refactor), and syntax checking -(flycheck). - -Includes coffescript and jsx support, as well as project minor modes for nodejs -projects (with a package.json) or launchbar 6 actions. - -## External Dependencies - -Run `make bootstrap js` to install these. - -+ NodeJS & NPM (`brew install node`, `pacman -S nodejs npm`) -+ tern: `npm -g install tern` (for completion) - diff --git a/modules/lang/javascript/README.org b/modules/lang/javascript/README.org new file mode 100644 index 000000000..dfc55ebbe --- /dev/null +++ b/modules/lang/javascript/README.org @@ -0,0 +1,46 @@ +#+TITLE: :lang javascript + +This module adds Javascript support. + ++ Code completion (tern) ++ REPL support (nodejs-repl) ++ Refactoring commands (js2-refactor) ++ Syntax checking (flycheck) ++ Browser code injection with skewer-mode ++ Coffeescript & JSX support ++ Jump-to-definitions and references support (xref) + +* Table of Contents :TOC: +- [[#install][Install]] + - [[#node--npm][Node & NPM]] + - [[#dependencies][Dependencies]] +- [[#appendix][Appendix]] + - [[#commands][Commands]] + +* Install +** Node & NPM +To get started with Javascript, you'll need node and its package manager, NPM, installed. + +*** MacOS +#+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes") +brew install node +#+END_SRC + +*** Arch Linux +#+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes") +sudo pacman --needed --noconfirm -S nodejs npm +#+END_SRC + +** Dependencies +This module optionally requires ~tern~ for code completion. + +#+BEGIN_SRC sh +npm -g install tern +#+END_SRC + +* Appendix +** Commands +| command | key / ex command | description | +|----------------------------------+------------------+------------------------------------------------------------| +| ~+javascript/repl~ | =:repl= | Open the NodeJS REPL (or send the current selection to it) | +| ~+javascript/skewer-this-buffer~ | =SPC m S= | Attaches a browser to the current buffer | diff --git a/modules/lang/perl/README.org b/modules/lang/perl/README.org new file mode 100644 index 000000000..aa91a438e --- /dev/null +++ b/modules/lang/perl/README.org @@ -0,0 +1,13 @@ +#+TITLE: :lang perl + +This module adds support for Perl 6, and flycheck support for all versions of Perl. + +* Table of Contents :TOC: +- [[#install][Install]] + +* Install +This module depends on perl itself. Perl <5 typically comes bundled with most OSes and Linux distros. + +You'll have to install + +There are no other dependencies. diff --git a/modules/lang/sh/README.org b/modules/lang/sh/README.org new file mode 100644 index 000000000..8ee01d3d9 --- /dev/null +++ b/modules/lang/sh/README.org @@ -0,0 +1,22 @@ +#+TITLE: :lang sh + +This module adds support for shell scripting languages. + ++ Code completion (company-shell) ++ Syntax Checking (flycheck) ++ Added command substitution and variable interpolation fontification ++ REPL support + +* Table of Contents :TOC: +- [[#install][Install]] +- [[#appendix][Appendix]] + - [[#commands][Commands]] + +* Install +This module has no dependencies. + +* Appendix +** Commands +| command | key / ex command | description | +|------------+------------------+-------------------------------------------------------| +| ~+sh/repl~ | =:repl= | Open a terminal (or send the current selection to it) | diff --git a/modules/ui/doom-dashboard/README.org b/modules/ui/doom-dashboard/README.org new file mode 100644 index 000000000..6a2815682 --- /dev/null +++ b/modules/ui/doom-dashboard/README.org @@ -0,0 +1,17 @@ +#+TITLE: :ui doom-dashboard + +This module gives Doom Emacs a dashboard buffer. + +It is loosely inspired by Atom's dashboard. + +* Table of Contents :TOC: +- [[#install][Install]] +- [[#keybindings][Keybindings]] +- [[#customization][Customization]] + +* Install +This module only requires that ~all-the-icons~'s icon fonts are installed. Use ~M-x all-the-icons-install-fonts~ to do so. + +* Keybindings + +* Customization diff --git a/modules/ui/doom-quit/README.org b/modules/ui/doom-quit/README.org new file mode 100644 index 000000000..9625c9f7f --- /dev/null +++ b/modules/ui/doom-quit/README.org @@ -0,0 +1,7 @@ +#+TITLE: :ui doom-quit + +Remember these? + +[[http://cf.geekdo-images.com/images/pic969210_md.jpg]] + +Yeah. diff --git a/modules/ui/hl-todo/README.org b/modules/ui/hl-todo/README.org new file mode 100644 index 000000000..d8af7eb85 --- /dev/null +++ b/modules/ui/hl-todo/README.org @@ -0,0 +1,13 @@ +#+TITLE: :ui hl-todo + +This module adds syntax highlighting for TODO/FIXME/NOTE tags in programming major-modes. + +What keywords are highlighted (and their color) can be customized through ~hl-todo-keyword-faces~. + +#+BEGIN_SRC emacs-lisp +;; the default +(setq hl-todo-keyword-faces + `(("TODO" . ,(face-foreground 'warning)) + ("FIXME" . ,(face-foreground 'error)) + ("NOTE" . ,(face-foreground 'success)))) +#+END_SRC diff --git a/modules/ui/tabbar/README.org b/modules/ui/tabbar/README.org new file mode 100644 index 000000000..b21f9bbd4 --- /dev/null +++ b/modules/ui/tabbar/README.org @@ -0,0 +1,5 @@ +#+TITLE: :ui tabbar + +This module adds a tabbar to the Emacs UI. + +I don't recommend you use this module. It is here for reference, is unstable and doesn't integrate with Doom's UI well. I find ivy, helm or even ~buffer-menu~ to be better suited for buffer management. diff --git a/modules/ui/unicode/README.org b/modules/ui/unicode/README.org new file mode 100644 index 000000000..8b9e7ec74 --- /dev/null +++ b/modules/ui/unicode/README.org @@ -0,0 +1,10 @@ +#+TITLE: :ui unicode + +This unicode extends Doom's ability to display non-English unicode. + +This is for non-English Emacs users, for whom Doom's built-in unicode support in insufficient. + +When this module is enabled... + ++ The first time you run Emacs a unicode cache will be generated -- this will take a while! ++ Doom will ignore the ~doom-unicode-font~ variable and the ~:unicode-font~ setting. From ce723d63ccf570065df84f13410b9df84e45680d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 21 Aug 2017 20:12:53 +0200 Subject: [PATCH 43/64] Add file template for doom module READMEs --- modules/feature/file-templates/config.el | 1 + .../templates/org-mode/__doom-readme | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 modules/feature/file-templates/templates/org-mode/__doom-readme diff --git a/modules/feature/file-templates/config.el b/modules/feature/file-templates/config.el index e7d4b2fc2..11a9d7a7e 100644 --- a/modules/feature/file-templates/config.el +++ b/modules/feature/file-templates/config.el @@ -55,6 +55,7 @@ ("-test\\.el$" "__" emacs-ert-mode) ("/.emacs.d/.+\\.el$" "__doom-module" emacs-lisp-mode) ("/.emacs.d/.+/packages\\.el$" "__doom-packages" emacs-lisp-mode) + ("/.emacs.d/.+/README\\.org$" "__doom-readme" org-mode) (snippet-mode "__" snippet-mode) ;; Go ("\\.go$" "__.go" go-mode) diff --git a/modules/feature/file-templates/templates/org-mode/__doom-readme b/modules/feature/file-templates/templates/org-mode/__doom-readme new file mode 100644 index 000000000..bd4c3fb91 --- /dev/null +++ b/modules/feature/file-templates/templates/org-mode/__doom-readme @@ -0,0 +1,48 @@ +# -*- mode: snippet -*- +# name: Doom module readme +# -- +#+TITLE: ${1:`(progn (string-match "modules/\\([^/]+\\)/\\([^/]+\\)/.+" buffer-file-name) + (format ":%s %s" + (match-string 1 buffer-file-name) + (match-string 2 buffer-file-name)))`} + +${2:A short summary about what this module does.} + +${3:If necessary, include a longer description below it that goes into more detail. This may be as long as you like. + ++ If possible, include a list of features ++ Include links to major plugins that the module uses, if applicable ++ Use links whenever you can ++ Mention dependencies on other modules here} + +* Table of Contents :TOC: + +* Install +** Main dependencies +*** MacOS +#+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes") +brew install x +#+END_SRC + +*** Arch Linux +#+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes") +sudo pacman --needed --noconfirm -S X +#+END_SRC + +** Extra Dependencies ++ A ++ B ++ C + +#+BEGIN_SRC sh +Y install A B C +#+END_SRC + +* Configuration + +* Usage + +* Appendix +** Commands +** Hacks +$0 \ No newline at end of file From 11e55a5a4f877cdc9815487f0a073d51a76b0766 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 21 Aug 2017 21:52:48 +0200 Subject: [PATCH 44/64] Add *.org file template --- modules/feature/file-templates/config.el | 2 ++ modules/feature/file-templates/templates/org-mode/__ | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/feature/file-templates/config.el b/modules/feature/file-templates/config.el index 11a9d7a7e..d1f6977a5 100644 --- a/modules/feature/file-templates/config.el +++ b/modules/feature/file-templates/config.el @@ -79,6 +79,8 @@ ("/conf\\.lua$" "__conf.lua" love-mode) ;; Markdown ("\\.md$" "__" markdown-mode) + ;; Org + ("\\.org$" "__" org-mode) ;; PHP ("\\.php$" "__" php-mode) ("\\.class\\.php$" "__.class.php" php-mode) diff --git a/modules/feature/file-templates/templates/org-mode/__ b/modules/feature/file-templates/templates/org-mode/__ index 67d8e4192..23d7b522d 100644 --- a/modules/feature/file-templates/templates/org-mode/__ +++ b/modules/feature/file-templates/templates/org-mode/__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: Org template # -- -#+TITLE:${1:`(file-name-base buffer-file-name)`} +#+TITLE: ${1:`(file-name-base buffer-file-name)`} $0 \ No newline at end of file From 8e0e4d67b1e434ed000ace9b583780896956d333 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 21 Aug 2017 21:54:04 +0200 Subject: [PATCH 45/64] Convert +ivy/switch-buffer to transformers + add mode icons #169 --- modules/completion/ivy/autoload/ivy.el | 99 ++++++++++---------------- modules/completion/ivy/config.el | 11 ++- 2 files changed, 47 insertions(+), 63 deletions(-) diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index 944741053..cc1dd0f01 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -1,72 +1,47 @@ ;;; completion/ivy/autoload/ivy.el -*- lexical-binding: t; -*- -;; Show more information in ivy-switch-buffer; and only display -;; workgroup-relevant buffers. -(defun +ivy--get-buffers (&optional buffer-list) - (when-let (buffer-list (delq (current-buffer) (or buffer-list (doom-buffer-list)))) - (let* ((min-name - (+ 5 (cl-loop for buf in buffer-list - maximize (length (buffer-name buf))))) - (min-mode - (+ 5 (cl-loop for buf in buffer-list - maximize (length (symbol-name (buffer-local-value 'major-mode buf))))))) - (cl-loop - with project-root = (doom-project-root) - for buf in buffer-list - collect - (cl-destructuring-bind (type mode path) - (with-current-buffer buf - (list (concat - (let ((buffer-name (buffer-name buf))) - (propertize - buffer-name - 'face (cond ((string-match-p "^ ?\\*" buffer-name) - 'font-lock-comment-face) - ((not (string= project-root (doom-project-root))) - 'warning) - (buffer-read-only - 'error)))) - (when (and buffer-file-name (buffer-modified-p)) - (propertize "[+]" 'face 'doom-modeline-buffer-modified))) - (propertize (symbol-name major-mode) 'face 'font-lock-constant-face) - (when buffer-file-name - (abbreviate-file-name - (file-name-directory buffer-file-name))))) - (format (format "%%-%ds %%-%ds %%s" min-name min-mode) - type mode (or path ""))))))) +(defsubst +ivy--icon-for-mode (mode) + "Apply `all-the-icons-for-mode' on MODE but either return an icon or nil." + (let ((icon (all-the-icons-icon-for-mode mode))) + (unless (symbolp icon) icon))) -(defun +ivy--select-buffer-action (buffer) - (ivy--switch-buffer-action - (string-remove-suffix - "[+]" - (substring buffer 0 (string-match-p (regexp-quote " ") buffer))))) - -(defun +ivy--select-buffer-other-window-action (buffer) - (ivy--switch-buffer-other-window-action - (string-remove-suffix - "[+]" - (substring buffer 0 (string-match-p (regexp-quote " ") buffer))))) +(defun +ivy-buffer-transformer (str) + (let* ((buf (get-buffer str)) + (path (buffer-file-name buf)) + (mode (buffer-local-value 'major-mode buf)) + (faces + (with-current-buffer buf + (cond ((string-match-p "^ ?\\*" (buffer-name buf)) + 'font-lock-comment-face) + ((buffer-modified-p buf) + 'doom-modeline-buffer-modified) + (buffer-read-only + 'error))))) + (propertize + (format "%-40s %s%-20s %s" + str + (if +ivy-buffer-icons + (concat (propertize " " 'display + (or (+ivy--icon-for-mode mode) + (+ivy--icon-for-mode (get mode 'derived-mode-parent)))) + "\t") + "") + mode + (or (and path (abbreviate-file-name (file-name-directory (file-truename path)))) + "")) + 'face faces))) ;;;###autoload -(defun +ivy/switch-workspace-buffer (&optional other-window-p) - "Switch to an open buffer in the current workspace. +(defun +ivy/switch-workspace-buffer (&optional arg) + "Switch to another buffer within the current workspace. -If OTHER-WINDOW-P (universal arg), then open target in other window." +If ARG (universal argument), open selection in other-window." (interactive "P") - (+ivy/switch-buffer other-window-p t)) - -;;;###autoload -(defun +ivy/switch-buffer (&optional other-window-p workspace-only-p) - "Switch to an open buffer in the global buffer list. - -If OTHER-WINDOW-P (universal arg), then open target in other window. -If WORKSPACE-ONLY-P (universal arg), limit to buffers in the current workspace." - (interactive "P") - (ivy-read (format "%s buffers: " (if workspace-only-p "Workspace" "Global")) - (+ivy--get-buffers (unless workspace-only-p (buffer-list))) - :action (if other-window-p - #'+ivy--select-buffer-other-window-action - #'+ivy--select-buffer-action) + (ivy-read "Switch to workspace buffer: " + (mapcar #'buffer-name (delq (current-buffer) (doom-buffer-list))) + :action (if arg + #'ivy--switch-buffer-other-window-action + #'ivy--switch-buffer-action) :matcher #'ivy--switch-buffer-matcher :keymap ivy-switch-buffer-map :caller #'+ivy/switch-workspace-buffer)) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 46fd19e2a..f9bcda203 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -1,5 +1,8 @@ ;;; completion/ivy/config.el -*- lexical-binding: t; -*- +(defvar +ivy-buffer-icons nil + "If non-nil, show buffer mode icons in `ivy-switch-buffer' and the like.") + (defvar +ivy-task-tags '(("TODO" . warning) ("FIXME" . error)) @@ -46,7 +49,7 @@ session)." [remap apropos] #'counsel-apropos [remap describe-face] #'counsel-describe-face [remap find-file] #'counsel-find-file - [remap switch-to-buffer] #'+ivy/switch-buffer + [remap switch-to-buffer] #'ivy-switch-buffer [remap persp-switch-to-buffer] #'+ivy/switch-workspace-buffer [remap recentf] #'counsel-recentf [remap imenu] #'counsel-imenu @@ -59,6 +62,12 @@ session)." [remap describe-variable] #'counsel-describe-variable [remap describe-face] #'counsel-describe-face) + ;; Show more buffer information in switch-buffer commands + (ivy-set-display-transformer 'ivy-switch-buffer #'+ivy-buffer-transformer) + (ivy-set-display-transformer 'ivy-switch-buffer-other-window #'+ivy-buffer-transformer) + (ivy-set-display-transformer '+ivy/switch-workspace-buffer #'+ivy-buffer-transformer) + (ivy-set-display-transformer 'counsel-recentf #'abbreviate-file-name) + (when (featurep! :feature workspaces) (nconc ivy-sort-functions-alist '((persp-kill-buffer . nil) From 1b8970786d5199f0d730b42c2bc02ee2dfcafb72 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 21 Aug 2017 21:55:34 +0200 Subject: [PATCH 46/64] lang/sh: remove unused setup.sh --- modules/lang/sh/setup.sh | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100755 modules/lang/sh/setup.sh diff --git a/modules/lang/sh/setup.sh b/modules/lang/sh/setup.sh deleted file mode 100755 index 49a1ca27d..000000000 --- a/modules/lang/sh/setup.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -source VARS - -# -echo "Setting up zsh/bash (zshdb, bashdb)" - -if is-mac; then - brew install zshdb bashdb -elif is-arch; then - sudo pacman --noconfirm -S zshdb bashdb -fi From 9ed322ded60e2f015098c1c8b410493db7855987 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 21 Aug 2017 21:58:51 +0200 Subject: [PATCH 47/64] Remove recentf-filename-handlers fix for projectile-recentf-files This is unnecessary now that path abbreviation occurs in an ivy transformer rather than as a handler in recentf-filename-handlers. --- core/core-projects.el | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/core/core-projects.el b/core/core-projects.el index 0d87e32b6..c0a241e33 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -33,18 +33,6 @@ state are passed in.") (append (list doom-local-dir ".sync") projectile-globally-ignored-directories)) - ;; Add `recentf-filename-handlers' support to `projectile-recentf-files'. - (defun doom*projectile-abbreviate-project-root (orig-fn &rest args) - "Abbreviate `projectile-project-root'." - (cl-letf (((symbol-function 'projectile-project-root) - `(lambda () - (cl-loop with dir = (,(symbol-function 'projectile-project-root)) - for fn in recentf-filename-handlers - do (setq dir (funcall fn dir)) - finally return dir)))) - (apply orig-fn args))) - (advice-add #'projectile-recentf-files :around #'doom*projectile-abbreviate-project-root) - ;; Projectile root-searching functions can cause an infinite loop on TRAMP ;; connections, so disable them. (defun doom*projectile-locate-dominating-file (orig-fn &rest args) From e1f7d76bc5132190a9dfcc7636f5583957e313e2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 21 Aug 2017 22:31:07 +0200 Subject: [PATCH 48/64] Prevent private commands from affecting projectile cache This causes projectile-project-root to act strangely, because my private project navigational commands were rewriting the projectile cache. --- modules/private/hlissner/autoload/hlissner.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/private/hlissner/autoload/hlissner.el b/modules/private/hlissner/autoload/hlissner.el index 0fdaac6eb..2c8c52b90 100644 --- a/modules/private/hlissner/autoload/hlissner.el +++ b/modules/private/hlissner/autoload/hlissner.el @@ -23,7 +23,8 @@ private/hlissner/snippets." (interactive) (let ((default-directory ,dir) projectile-require-project-root - projectile-cached-buffer-file-name) + projectile-cached-buffer-file-name + projectile-cached-project-root) (call-interactively (command-remapping #'projectile-find-file)))) (defun ,(intern (format "+hlissner/browse-%s" name)) () (interactive) From 07187701510fb14c8050c0d826e4aca2ee8e92c1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 22 Aug 2017 01:12:28 +0200 Subject: [PATCH 49/64] Fix wiki links in README --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d82549c71..b6a2ff30f 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ - - -

- Documentation | + Documentation | Screenshots | - Troubleshooting | - FAQ | + Troubleshooting | + FAQ | Changelog

@@ -104,11 +104,11 @@ If you'd like to support my efforts, I welcome contributions of any kind: a line at henrik@lissner.net. I'm eager to learn. -[wiki]: /wiki -[wiki-contribute]: /wiki/Contribute -[wiki-conventions]: /wiki/Conventions -[wiki-modules]: /wiki/Modules -[wiki-customization]: /wiki/Customization +[wiki]: /../wiki +[wiki-contribute]: /../wiki/Contribute +[wiki-conventions]: /../wiki/Conventions +[wiki-modules]: /../wiki/Modules +[wiki-customization]: /../wiki/Customization [doom-my-bindings]: modules/private/hlissner/+bindings.el [doom-my-commands]: modules/private/hlissner/+commands.el From 2be0292a6fd575d85d305ae519089306273c53e3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 22 Aug 2017 01:14:55 +0200 Subject: [PATCH 50/64] Correct intro in README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b6a2ff30f..8f2f0822e 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,11 @@ It is a story as old as time. A stubborn, shell-dwelling, and melodramatic vimmer -- envious of the features of modern text editors -- spirals into despair before he finally succumbs to the [dark side][evil-mode]. This is his config. -DOOM's philosophy is simple: be **fast**, be **pretty**, and be **vim** (or -better). It is tailored for neckbeards with a blue-belt or better in -command-line-fu who don't shy away from dabbling with Elisp. +DOOM's philosophy is simple: be **fast**, be **readable**, and be **pretty**. It +is tailored for neckbeards with a blue-belt or better in command-line-fu who +don't shy away from dabbling with Elisp. -Rip and tear. Until it is done. +Rip and tear. Until it compiles. > **Important:** Doom only supports Emacs >= 25.1, and is tailored for Arch > Linux 4.7+ and Mac OS 10.11+. From e7ec8a07b2ebcac9ab12d0ef22c722f8ef703aea Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 22 Aug 2017 01:16:33 +0200 Subject: [PATCH 51/64] Fix wiki links in README (again) --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8f2f0822e..c47f2a24b 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ - - -

- Documentation | + Documentation | Screenshots | - Troubleshooting | - FAQ | + Troubleshooting | + FAQ | Changelog

@@ -104,11 +104,11 @@ If you'd like to support my efforts, I welcome contributions of any kind: a line at henrik@lissner.net. I'm eager to learn. -[wiki]: /../wiki -[wiki-contribute]: /../wiki/Contribute -[wiki-conventions]: /../wiki/Conventions -[wiki-modules]: /../wiki/Modules -[wiki-customization]: /../wiki/Customization +[wiki]: /../../wiki +[wiki-contribute]: /../../wiki/Contribute +[wiki-conventions]: /../../wiki/Conventions +[wiki-modules]: /../../wiki/Modules +[wiki-customization]: /../../wiki/Customization [doom-my-bindings]: modules/private/hlissner/+bindings.el [doom-my-commands]: modules/private/hlissner/+commands.el From 4ff294e9e1a4d316322d04c5fc2b4d6f5a8a8ce9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 22 Aug 2017 22:16:55 +0200 Subject: [PATCH 52/64] README: expand troubleshooting --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c47f2a24b..648789b9b 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,9 @@ Found a problem? Here are some things to try: + If you byte-compiled Doom, run `make clean` or `M-x doom/clean-compiled-files` and restart Emacs. Never debug byte-compiled code, it will interfere with your efforts in subtle (and not-so-subtle) ways. ++ Check [the FAQ][wiki-troubleshooting] to see if your issue is mentioned. ++ If your issue is associated with a particular module, like code-completion, + check the module's README.org, if any. If all else fails, [file a bug report][doom-new-issue]. @@ -109,6 +112,7 @@ If you'd like to support my efforts, I welcome contributions of any kind: [wiki-conventions]: /../../wiki/Conventions [wiki-modules]: /../../wiki/Modules [wiki-customization]: /../../wiki/Customization +[wiki-troubleshooting]: /../../wiki/FAQ#troubleshooting [doom-my-bindings]: modules/private/hlissner/+bindings.el [doom-my-commands]: modules/private/hlissner/+commands.el From bb5907cadb4091a0e85440a444edb9789d315263 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 Sep 2017 16:11:14 +0200 Subject: [PATCH 53/64] Rethink smartparens config #181 + Parts of my smartparens config that were personal preference have been moved to my private module. + The css-mode config was redundant and was removed + Moved lang-specific config to their respective modules + Markdown config was redundant with native electric support, and thus removed. --- core/core-editor.el | 20 ++------------------ modules/lang/markdown/config.el | 9 +-------- modules/lang/sh/config.el | 3 +++ modules/private/hlissner/config.el | 15 +++++++++++++++ 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index be5e9b1e6..985b0aeec 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -213,27 +213,11 @@ with functions that require it (like modeline segments)." (add-hook 'doom-init-hook #'smartparens-global-mode) (require 'smartparens-config) - ;; Smartparens interferes with Replace mode + + ;; disable smartparens in evil-mode's replace state (they conflict) (add-hook 'evil-replace-state-entry-hook #'turn-off-smartparens-mode) (add-hook 'evil-replace-state-exit-hook #'turn-on-smartparens-mode) - ;; Auto-close more conservatively - (let ((unless-list '(sp-point-before-word-p - sp-point-after-word-p - sp-point-before-same-p))) - (sp-pair "'" nil :unless unless-list) - (sp-pair "\"" nil :unless unless-list)) - (sp-pair "{" nil :post-handlers '(("||\n[i]" "RET") ("| " " ")) - :unless '(sp-point-before-word-p sp-point-before-same-p)) - (sp-pair "(" nil :post-handlers '(("||\n[i]" "RET") ("| " " ")) - :unless '(sp-point-before-word-p sp-point-before-same-p)) - (sp-pair "[" nil :post-handlers '(("| " " ")) - :unless '(sp-point-before-word-p sp-point-before-same-p)) - - (sp-local-pair 'css-mode "/*" "*/" - :post-handlers '(("[d-3]||\n[i]" "RET") ("| " "SPC"))) - (sp-local-pair '(sh-mode markdown-mode) "`" nil - :unless '(sp-point-before-word-p sp-point-before-same-p)) (sp-local-pair '(xml-mode nxml-mode php-mode) "" :post-handlers '(("| " "SPC")))) diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index eb34411be..7b2345662 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -20,14 +20,7 @@ (setq line-spacing 2 fill-column 80)) - (sp-local-pair - '(markdown-mode gfm-mode) - "\`\`\`" "\`\`\`" :post-handlers '(("||\n" "RET"))) - - (map! (:map gfm-mode-map - "`" #'self-insert-command) - - (:map markdown-mode-map + (map! (:map markdown-mode-map [remap find-file-at-point] #'markdown-follow-thing-at-point "M-*" #'markdown-insert-list-item "M-b" #'markdown-insert-bold diff --git a/modules/lang/sh/config.el b/modules/lang/sh/config.el index 8fac14209..0c06ab1f3 100644 --- a/modules/lang/sh/config.el +++ b/modules/lang/sh/config.el @@ -35,6 +35,9 @@ (,(regexp-opt +sh-builtin-keywords 'words) (0 'font-lock-builtin-face append)))) + ;; autoclose backticks + (sp-local-pair 'sh-mode "`" nil :unless '(sp-point-before-word-p sp-point-before-same-p)) + ;; sh-mode has file extensions checks for other shells, but not zsh, so... (defun +sh|detect-zsh () (when (or (and buffer-file-name diff --git a/modules/private/hlissner/config.el b/modules/private/hlissner/config.el index b6ea7b4cc..94afe04b4 100644 --- a/modules/private/hlissner/config.el +++ b/modules/private/hlissner/config.el @@ -19,6 +19,21 @@ (apply orig-fn args))) (advice-add #'tramp-read-passwd :around #'+hlissner*no-authinfo-for-tramp) +;; +(after! smartparens + ;; Auto-close more conservatively + (let ((unless-list '(sp-point-before-word-p + sp-point-after-word-p + sp-point-before-same-p))) + (sp-pair "'" nil :unless unless-list) + (sp-pair "\"" nil :unless unless-list)) + (sp-pair "{" nil :post-handlers '(("||\n[i]" "RET") ("| " " ")) + :unless '(sp-point-before-word-p sp-point-before-same-p)) + (sp-pair "(" nil :post-handlers '(("||\n[i]" "RET") ("| " " ")) + :unless '(sp-point-before-word-p sp-point-before-same-p)) + (sp-pair "[" nil :post-handlers '(("| " " ")) + :unless '(sp-point-before-word-p sp-point-before-same-p))) + ;; (after! doom-themes From 5140bb8850f0597d6533c0b612b58e24ec618430 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 Sep 2017 16:12:53 +0200 Subject: [PATCH 54/64] Autoload json library --- core/core-lib.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/core-lib.el b/core/core-lib.el index d5b241959..81e6ae883 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -21,6 +21,9 @@ (dolist (sym '(when-let if-let string-trim string-join string-blank-p string-lessp)) (autoload sym "subr-x" nil nil 'macro)) +(dolist (sym '(json-read json-read-file json-read-from-string json-encode)) + (autoload sym "json")) + ;; ;; Helpers From 6439d7abeef4497accd604d9f8436a6664eedefb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 Sep 2017 16:14:25 +0200 Subject: [PATCH 55/64] Add elfeed-(show|search)-mode to evil-snipe-disabled-modes --- modules/feature/evil/config.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/feature/evil/config.el b/modules/feature/evil/config.el index 892e04afa..dc284783c 100644 --- a/modules/feature/evil/config.el +++ b/modules/feature/evil/config.el @@ -323,6 +323,7 @@ the new algorithm is confusing, like in python or ruby." evil-snipe-scope 'line evil-snipe-repeat-scope 'visible evil-snipe-char-fold t + evil-snipe-disabled-modes '(magit-mode elfeed-show-mode elfeed-search-mode) evil-snipe-aliases '((?\[ "[[{(]") (?\] "[]})]") (?\; "[;:]"))) From 6947fd72c3a8c56cc46257f6709bc082efeb56b4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 Sep 2017 16:15:09 +0200 Subject: [PATCH 56/64] org: set org-ellipsis to downward chevron This is no longer set by doom-themes. --- modules/org/org/config.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/org/org/config.el b/modules/org/org/config.el index 620f3efb2..4660e786d 100644 --- a/modules/org/org/config.el +++ b/modules/org/org/config.el @@ -98,6 +98,7 @@ org-cycle-separator-lines 1 ;; org-ellipsis "  " org-entities-user '(("flat" "\\flat" nil "" "" "266D" "♭") ("sharp" "\\sharp" nil "" "" "266F" "♯")) + org-ellipsis "  " org-fontify-done-headline t org-fontify-quote-and-verse-blocks t org-fontify-whole-heading-line t From 20fd0e67783c45a1a551ebc0d1906285fbc45a70 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 Sep 2017 16:28:53 +0200 Subject: [PATCH 57/64] Correct troubleshooting link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 648789b9b..edc93f6e3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@

Documentation | Screenshots | - Troubleshooting | + Troubleshooting | FAQ | Changelog

From d28c64b4faa25a8e4ed8dc463ca40160e25469f7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 Sep 2017 16:39:51 +0200 Subject: [PATCH 58/64] General refactor & cleanup --- modules/completion/ivy/config.el | 5 ++--- modules/feature/workspaces/config.el | 2 +- modules/lang/cc/config.el | 2 +- modules/lang/javascript/config.el | 5 +++-- modules/lang/markdown/config.el | 4 ++-- modules/private/hlissner/config.el | 7 ++----- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index f9bcda203..ed08c5e84 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -25,7 +25,8 @@ session)." ;; (def-package! ivy - :demand t + :commands ivy-mode + :init (add-hook 'doom-init-hook #'ivy-mode) :config (setq ivy-height 12 ivy-do-completion-in-region nil @@ -43,8 +44,6 @@ session)." (after! magit (setq magit-completing-read-function #'ivy-completing-read)) (after! yasnippet (push #'+ivy-yas-prompt yas-prompt-functions)) - (add-hook 'doom-init-hook #'ivy-mode) - (map! :map ivy-mode-map [remap apropos] #'counsel-apropos [remap describe-face] #'counsel-describe-face diff --git a/modules/feature/workspaces/config.el b/modules/feature/workspaces/config.el index bbf78bd3a..aacc47ca7 100644 --- a/modules/feature/workspaces/config.el +++ b/modules/feature/workspaces/config.el @@ -10,7 +10,7 @@ ;; load the last autosaved session. You can give sessions a custom name so they ;; can be loaded later. ;; -;; FYI persp-mode requires `workgroups' for file persistence in Emacs 24.4. +;; NOTE persp-mode requires `workgroups' for file persistence in Emacs 24.4. (defvar +workspaces-main "main" "The name of the primary and initial workspace, which cannot be deleted or diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index 01a466a68..2b2e3fec4 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -76,7 +76,7 @@ (c-set-offset 'inclass #'+cc--c-lineup-inclass) - ;; Certain mappings interfere with smartparens and custom bindings, + ;; Certain electric mappings interfere with smartparens and custom bindings, ;; so unbind them (map! :map c-mode-map "DEL" nil diff --git a/modules/lang/javascript/config.el b/modules/lang/javascript/config.el index b2bd9ee15..47972d434 100644 --- a/modules/lang/javascript/config.el +++ b/modules/lang/javascript/config.el @@ -119,8 +119,9 @@ (set! :electric 'rjsx-mode :chars '(?\} ?\) ?. ?>)) ;; disable electric keys (I use snippets and `emmet-mode' instead) - (define-key rjsx-mode-map "<" nil) - (define-key rjsx-mode-map (kbd "C-d") nil) + (map! :map rjsx-mode-map + "<" nil + "C-d" nil) (add-hook! rjsx-mode ;; jshint doesn't really know how to deal with jsx (push 'javascript-jshint flycheck-disabled-checkers))) diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 7b2345662..80255e3c2 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -1,9 +1,9 @@ ;;; lang/markdown/config.el -*- lexical-binding: t; -*- (def-package! markdown-mode - :mode ("/README\\.md$" . gfm-mode) - :mode "\\.m\\(d\\|arkdown\\)$" :mode "/README$" + :mode "\\.m\\(d\\|arkdown\\)$" + :mode ("/README\\.md$" . gfm-mode) :init (setq markdown-enable-wiki-links t markdown-enable-math t diff --git a/modules/private/hlissner/config.el b/modules/private/hlissner/config.el index 94afe04b4..31ffa9019 100644 --- a/modules/private/hlissner/config.el +++ b/modules/private/hlissner/config.el @@ -4,11 +4,8 @@ (load! +bindings) ; my key bindings (load! +commands)) ; my custom ex commands -(defvar +hlissner-dir - (file-name-directory load-file-name)) - -(defvar +hlissner-snippets-dir - (expand-file-name "snippets/" +hlissner-dir)) +(defvar +hlissner-dir (file-name-directory load-file-name)) +(defvar +hlissner-snippets-dir (expand-file-name "snippets/" +hlissner-dir)) (setq epa-file-encrypt-to user-mail-address auth-sources (list (expand-file-name ".authinfo.gpg" +hlissner-dir))) From c7957c93214df5ea6a590fdfbe01a17762f33582 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 Sep 2017 20:28:04 +0200 Subject: [PATCH 59/64] Make +ivy-buffer-transformer autoloadable --- modules/completion/ivy/autoload/ivy.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index cc1dd0f01..70f59eac9 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -5,6 +5,7 @@ (let ((icon (all-the-icons-icon-for-mode mode))) (unless (symbolp icon) icon))) +;;;###autoload (defun +ivy-buffer-transformer (str) (let* ((buf (get-buffer str)) (path (buffer-file-name buf)) From 23404980acac298f69599a17f1e2a363db3f9b77 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 3 Sep 2017 20:59:52 +0200 Subject: [PATCH 60/64] Fix wrong-type-argument error from +org/insert-item +org/insert-item would throw "save-excursion: Wrong type argument: listp, 1" when used from BOL on the first sub-item in a list. --- modules/org/org/autoload/org.el | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/org/org/autoload/org.el b/modules/org/org/autoload/org.el index 03baa862f..e712813f0 100644 --- a/modules/org/org/autoload/org.el +++ b/modules/org/org/autoload/org.el @@ -146,7 +146,7 @@ wrong places)." '(table table-row headline inlinetask item plain-list) t)) (type (org-element-type context))) - (cond ((eq type 'item) + (cond ((memq type '(item plain-list)) (let ((marker (org-element-property :bullet context)) (pad (save-excursion (back-to-indentation) @@ -157,7 +157,7 @@ wrong places)." (insert (concat "\n" (make-string pad ? ) marker))) ('above (goto-char (line-beginning-position)) - (insert (make-string pad ? ) marker) + (insert (make-string pad 32) (or marker "")) (save-excursion (insert "\n"))))) (when (org-element-property :checkbox context) (insert "[ ] "))) @@ -167,15 +167,13 @@ wrong places)." ('below (org-table-insert-row t)) ('above (+org/table-prepend-row-or-shift-up)))) - ((memq type '(headline inlinetask plain-list)) + ((memq type '(headline inlinetask)) (let* ((subcontext (org-element-context)) (level (save-excursion (org-back-to-heading) - (org-element-property - :level - (if (eq (org-element-type subcontext) 'headline) - subcontext - 1))))) + (if (eq (org-element-type subcontext) 'headline) + (org-element-property :level subcontext) + 1)))) (pcase direction ('below (let ((at-eol (= (point) (1- (line-end-position))))) From 33428bca893c59ddd968f3f1a06b090bf07f85a6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 3 Sep 2017 21:09:45 +0200 Subject: [PATCH 61/64] Update changelog --- CHANGELOG.org | 57 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 359e44ee0..b71257c19 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -47,9 +47,7 @@ + =lang/alda= -- Language support for [[https://github.com/alda-lang/alda][Alda]], the music programming language, using [[https://github.com/jgkamat/alda-mode][alda-mode]]. + =org/org-publish= -- publishing org files to HTML (thanks to [[https://github.com/matthewgraybosch][matthewgraybosch]]) + =org/org-attach= -- my own, simpler attachment system with drag-drop image attachment support and centralized storage. -+ *Bug fixes:* - + =core-ui= Replace or fix ~winner-mode~ unreliability (will close windows trying to revive killed buffers). Perhaps make ~doom/kill-this-buffer~ only disassociate buffer from persp-mode or bury buffer if persp-mode is inactive. - + =ui/doom-modeline= Fix ~0/0~ leftover panel in modeline (caused by lingering anzu state). ++ =core-ui= Replace or fix ~winner-mode~ unreliability (will close windows trying to revive killed buffers). Perhaps make ~doom/kill-this-buffer~ only disassociate buffer from persp-mode or bury buffer if persp-mode is inactive. + =org= + Better shackle + org-agenda integration + Fix janky visual line motions (~evil-next-visual-line~, etc) @@ -61,29 +59,58 @@ + =tools/upload= Add ~+upload/open-remote-file~ command to open current file on the remote (with TRAMP). + Add =bin/org-alert= script -- a cron script that scans TODOs in org files and dispatches system alerts. + =feature/workspaces= Add a bookmarks feature, but for wconfs, that can revive file buffers. Also needs an interface. -+ =ui/doom-modeline= fix hardcoded spacing in between segments. ++ =ui/doom-modeline= + + Fix hardcoded spacing in between segments. + + Fix ~0/0~ leftover panel in modeline (caused by lingering anzu state). + Update =bin/org-capture= to read from stdin in the absence of arguments. -+ Add README.org's with working babel blocks to modules. -+ Rewrite and expand documentation to include more information about setting up, customizing, and troubleshooting DOOM Emacs, including best practices. + =core-popups= Add support for moving popup windows to the ~+evil/window-move-*~ commands #171 * Unreleased (master) + =doom= - + Added new module: ~lang/ocaml~, offering OCaml support (thanks to ptival) - + Added new module: ~tools/rgb~, with tools for dealing with colors (thanks to bandresen) - + Added new module: ~tools/prodigy~, with tools for managing external services (thanks to bandresen) - + Added new module: ~feature/hydra~, offers an extra and customizable layer of modal keybinds (thanks to bandresen) + + Added new module: ~lang/ocaml~, offering OCaml support (thanks to [[https://github.com/Ptival][ptival]]) + + Added new module: ~tools/rgb~, with tools for dealing with colors (thanks to [[https://github.com/bandresen][bandresen]]) + + Added new module: ~tools/prodigy~, with tools for managing external services (thanks to [[https://github.com/bandresen][bandresen]]) + + Added new module: ~feature/hydra~, offers an extra and customizable layer of modal keybinds (thanks to [[https://github.com/bandresen][bandresen]]) + + Added two new core-lib helpers for macros: ~doom-enlist~ and ~doom-unquote~. + Switch to ~doom-fallback-buffer~ after using ~doom/kill-all-buffers~ (or ~:killall!~). + ~make doctor~ now does font detection and will complain when fonts are missing. + When switching to a new project, a new workspace is spawned and a fuzzy find-file prompt is opened. However, a buffer from the previous workspace would linger on screen *and* the scratch buffer would CD to HOME, rather than the project root. This is fixed now. + Added module flags to the ~doom!~ macro in init.el, and modified the ~featurep!~ macro so that it can be used to detect these flags from within modules. It is up to modules how to interpret them. More information in [[https://github.com/hlissner/.emacs.d/commit/0b7b8800a2478588bde408c92fcdfa0e43a5baf0][0b7b880]]. + Fix projectile-find-file not respecting ~default-directory~ (caused by changes upstream). -+ =lang= - + =C/C++= The advise function ~c-lineup-arglist~ was missing, and has now be reimplemented. - + =Haskell= With module flags implemented, Intero support is now available to lang/haskell and is now the default. Dante support is still available with the ~+dante~ flag. -+ =org= - + Fix vanilla C-j/C-k bindings overshadowing custom window navigation bindings. + + Rewrote, revised and expanded module documentation, and created a [[https://github.com/hlissner/.emacs.d/wiki][wiki]] with more information. + + Removed the =:L= flag from =map!= and replaced it with a =:local= property. + + Added new function: ~doom|disable-vi-tilde-fringe~ for turning off vi-tilde-fringe in select buffers. + + Added support for relative line numbers (see ~doom-line-numbers-style~), using nlinum-relative on Emacs <26, and display-line-numbers on Emacs 26+. ++ =modules= ++ =feature= + + =File Templates= Added a file template for: + + *.org files + + Module README.org files. + + =jump= + + Added documentation for ~:jump~ setting, describing the three properties it supports (~:definition~, ~:references~ and ~:documentation~). + + Rewrote ~+jump/online~ to: + + Use the current selection, if active, or prompt for a query otherwise (with the thing at point as the initial input). + + Prompts for the provider (search engine) on first use, and reuses the last provider on consecutive uses. If the universal argument is supplied, force ~+jump/online~ to prompt for the provider anyway. ++ =completion= + + Added all-the-icons support to ~ivy-switch-buffer~ and ~+ivy/switch-workspace-buffer~. Enable this with ~(setq +ivy-buffer-icons t)~. ++ =ui= + rainbow-mode is no longer activated on ~prog-mode-hook~. + + =doom-modeline= + + Modeline now uses shrink-path.el to shrink the buffer name in the case of a small frame (thanks to [[https://github.com/bandresen][bandresen]]). [[https://github.com/hlissner/.emacs.d/pull/176][See #176]] + + Fixed mode-line going blank in terminal Emacs (thanks to [[https://github.com/bandresen][bandresen]]). + + =doom-dashboard= Fixed "Load last session" button on dashboard. ++ =tools= + + =eshell= General improvements made to further integrate eshell with Doom (thanks to [[https://github.com/bandresen][bandresen]]). [[https://github.com/hlissner/.emacs.d/pull/160][See #160]] + + =pass= ~+pass-get-field~ now no-ops if used in a non-interactive session (e.g. during testing or byte compilation). + + =neotree= Add =r= and =d= bindings for renaming and deleting files, respectively. ++ =lang= + + =C/C++= The advise function ~c-lineup-arglist~ was missing, and has now been reimplemented. + + =Haskell= With module flags implemented, Intero support is now available to lang/haskell and is now the default. Dante support is still available with the ~+dante~ flag. + + =Java= Now auto-installs meghanda-server on first use, and fixed code-completion in java buffers. ++ =org= + + Fixed vanilla C-j/C-k bindings overshadowing custom window navigation bindings. + + Added C-[hjkl] keybindings in insert mode for org table navigation. + + Fixed ~+org/insert-item~ throwing =save-excursion: Wrong type argument: listp, 1= error when used from BOL on the first sub-item in a list. * 2.0.4 (Jul 14, 2017) + *Module changes:* From 8bacb2512a2d4c4fb434df8417af25a16b64615d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 3 Sep 2017 21:58:46 +0200 Subject: [PATCH 62/64] Fix neotree always changing root --- modules/tools/neotree/autoload.el | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/tools/neotree/autoload.el b/modules/tools/neotree/autoload.el index 8dc6baaf4..74358725c 100644 --- a/modules/tools/neotree/autoload.el +++ b/modules/tools/neotree/autoload.el @@ -9,7 +9,6 @@ (require 'neotree) (cond ((and (neo-global--window-exists-p) (get-buffer-window neo-buffer-name t)) - (neotree-hide) (neotree-find path project-root)) ((not (and (neo-global--window-exists-p) (equal (file-truename (neo-global--with-buffer neo-buffer--start-node)) From 90048fc0198e601a5a95f483342c4bde92e12cc3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 3 Sep 2017 21:59:11 +0200 Subject: [PATCH 63/64] Temporarily disable doom-themes-visual-bell-config It currently conflicts with swapping backgrounds with solaire-mode. --- modules/ui/doom/config.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/doom/config.el b/modules/ui/doom/config.el index ec5575bfe..7cb145cc6 100644 --- a/modules/ui/doom/config.el +++ b/modules/ui/doom/config.el @@ -20,7 +20,7 @@ (add-hook 'doom-init-ui-hook #'doom-themes-org-config) ;; blink mode-line on errors - (add-hook 'doom-init-ui-hook #'doom-themes-visual-bell-config) + ;; (add-hook 'doom-init-ui-hook #'doom-themes-visual-bell-config) ;; Add file icons to doom-neotree (add-hook 'doom-init-ui-hook #'doom-themes-neotree-config) From 71bda74fdc2d1015e09a83da11228c161533f1bd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 3 Sep 2017 23:31:45 +0200 Subject: [PATCH 64/64] Prepare for v2.0.5 --- CHANGELOG.org | 11 ++++++----- core/core.el | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index b71257c19..2df246501 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -2,6 +2,7 @@ - [[#todo][Todo]] - [[#unreleased-master][Unreleased (master)]] +- [[#205-sep-03-2017][2.0.5 (Sep 03, 2017)]] - [[#204-jul-14-2017][2.0.4 (Jul 14, 2017)]] - [[#203-jun-11-2017][2.0.3 (Jun 11, 2017)]] - [[#202-may-13-2017][2.0.2 (May 13, 2017)]] @@ -66,8 +67,9 @@ + =core-popups= Add support for moving popup windows to the ~+evil/window-move-*~ commands #171 * Unreleased (master) + +* 2.0.5 (Sep 03, 2017) + =doom= - + Added new module: ~lang/ocaml~, offering OCaml support (thanks to [[https://github.com/Ptival][ptival]]) + Added new module: ~tools/rgb~, with tools for dealing with colors (thanks to [[https://github.com/bandresen][bandresen]]) + Added new module: ~tools/prodigy~, with tools for managing external services (thanks to [[https://github.com/bandresen][bandresen]]) + Added new module: ~feature/hydra~, offers an extra and customizable layer of modal keybinds (thanks to [[https://github.com/bandresen][bandresen]]) @@ -81,7 +83,6 @@ + Removed the =:L= flag from =map!= and replaced it with a =:local= property. + Added new function: ~doom|disable-vi-tilde-fringe~ for turning off vi-tilde-fringe in select buffers. + Added support for relative line numbers (see ~doom-line-numbers-style~), using nlinum-relative on Emacs <26, and display-line-numbers on Emacs 26+. -+ =modules= + =feature= + =File Templates= Added a file template for: + *.org files @@ -104,9 +105,9 @@ + =pass= ~+pass-get-field~ now no-ops if used in a non-interactive session (e.g. during testing or byte compilation). + =neotree= Add =r= and =d= bindings for renaming and deleting files, respectively. + =lang= - + =C/C++= The advise function ~c-lineup-arglist~ was missing, and has now been reimplemented. - + =Haskell= With module flags implemented, Intero support is now available to lang/haskell and is now the default. Dante support is still available with the ~+dante~ flag. - + =Java= Now auto-installs meghanda-server on first use, and fixed code-completion in java buffers. + + =cc= The advise function ~c-lineup-arglist~ was missing, and has now been reimplemented. + + =haskell= With module flags implemented, Intero support is now available to lang/haskell and is now the default. Dante support is still available with the ~+dante~ flag. + + =java= Now auto-installs meghanda-server on first use, and fixed code-completion in java buffers. + =org= + Fixed vanilla C-j/C-k bindings overshadowing custom window navigation bindings. + Added C-[hjkl] keybindings in insert mode for org table navigation. diff --git a/core/core.el b/core/core.el index 7df4199bf..d9a864e43 100644 --- a/core/core.el +++ b/core/core.el @@ -15,7 +15,7 @@ ;; Autoloaded functions are in core/autoload/*.el and modules/*/*/autoload.el or ;; modules/*/*/autoload/*.el. -(defvar doom-version "2.0.4" +(defvar doom-version "2.0.5" "Current version of DOOM emacs.") (defvar doom-debug-mode (or (getenv "DEBUG") init-file-debug)