General minor refactor & docstring fixes

This commit is contained in:
Henrik Lissner 2018-05-14 20:55:55 +02:00
parent 67dab98859
commit bb88411cc9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
9 changed files with 27 additions and 28 deletions

View file

@ -551,7 +551,6 @@ The module is only loaded once. If RELOAD-P is non-nil, load it again."
(if (file-directory-p module-path) (if (file-directory-p module-path)
`(condition-case-unless-debug ex `(condition-case-unless-debug ex
(let ((doom--current-module ',(cons module submodule))) (let ((doom--current-module ',(cons module submodule)))
;; ,(if plist `(doom-module-set ,module ',submodule ,@plist))
(load! init ,module-path :noerror) (load! init ,module-path :noerror)
(load! config ,module-path :noerror)) (load! config ,module-path :noerror))
('error ('error
@ -566,12 +565,12 @@ The module is only loaded once. If RELOAD-P is non-nil, load it again."
"Returns t if MODULE SUBMODULE is enabled. If FLAG is provided, returns t if "Returns t if MODULE SUBMODULE is enabled. If FLAG is provided, returns t if
MODULE SUBMODULE has FLAG enabled. MODULE SUBMODULE has FLAG enabled.
(featurep! :private default) (featurep! :config default)
Module FLAGs are set in your config's `doom!' block, typically in Module FLAGs are set in your config's `doom!' block, typically in
~/.emacs.d/init.el. Like so: ~/.emacs.d/init.el. Like so:
:private (default +flag1 -flag2) :config (default +flag1 -flag2)
When this macro is used from inside a module, MODULE and SUBMODULE can be When this macro is used from inside a module, MODULE and SUBMODULE can be
omitted. eg. (featurep! +flag1)" omitted. eg. (featurep! +flag1)"
@ -579,7 +578,7 @@ omitted. eg. (featurep! +flag1)"
(let* ((path (or load-file-name byte-compile-current-file)) (let* ((path (or load-file-name byte-compile-current-file))
(module-pair (doom-module-from-path path))) (module-pair (doom-module-from-path path)))
(unless module-pair (unless module-pair
(error "featurep! couldn't detect what module I'm in! (in %s)" path)) (error "featurep! couldn't detect what module its in! (in %s)" path))
(setq flag module (setq flag module
module (car module-pair) module (car module-pair)
submodule (cdr module-pair)))) submodule (cdr module-pair))))

View file

@ -304,8 +304,8 @@ DEFAULT is non-nil, set the default mode-line for all buffers."
;; remove prompt if the file is opened in other clients ;; remove prompt if the file is opened in other clients
(defun server-remove-kill-buffer-hook () (defun server-remove-kill-buffer-hook ()
(remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)) (remove-hook 'kill-buffer-query-functions #'server-kill-buffer-query-function))
(add-hook 'server-visit-hook 'server-remove-kill-buffer-hook) (add-hook 'server-visit-hook #'server-remove-kill-buffer-hook)
;; whitespace-mode settings ;; whitespace-mode settings
(setq whitespace-line-column nil (setq whitespace-line-column nil

View file

@ -47,9 +47,10 @@
(bar matches " %b " selection-info) (bar matches " %b " selection-info)
()) ())
(add-hook! twittering-mode (defun +twitter|switch-mode-and-header-line ()
(setq header-line-format (or (doom-modeline 'twitter) mode-line-format) (setq header-line-format (or (doom-modeline 'twitter) mode-line-format)
mode-line-format nil)) mode-line-format nil))
(add-hook 'twittering-mode-hook #'+twitter|switch-mode-and-header-line)
(map! :map twittering-mode-map (map! :map twittering-mode-map
"q" #'+twitter/quit "q" #'+twitter/quit

View file

@ -365,8 +365,8 @@ the new algorithm is confusing, like in python or ruby."
evil-visualstar/begin-search-forward evil-visualstar/begin-search-forward
evil-visualstar/begin-search-backward) evil-visualstar/begin-search-backward)
:init :init
(map! :v "*" #'evil-visualstar/begin-search-forward (map! :m [remap evil-ex-search-word-forward] #'evil-visualstar/begin-search-forward
:v "#" #'evil-visualstar/begin-search-backward) :m [remap evil-ex-search-word-backward] #'evil-visualstar/begin-search-backward)
:config :config
(global-evil-visualstar-mode 1)) (global-evil-visualstar-mode 1))

View file

@ -31,11 +31,11 @@
:documentation +lookup-documentation-functions :documentation +lookup-documentation-functions
:file +lookup-file-functions) :file +lookup-file-functions)
prop) prop)
for fn = (or (command-remapping fn) fn) for cmd = (or (command-remapping fn) fn)
if (condition-case e if (condition-case e
(or (if (commandp fn) (or (if (commandp cmd)
(call-interactively fn) (call-interactively cmd)
(funcall fn identifier)) (funcall cmd identifier))
(/= (point-marker) origin)) (/= (point-marker) origin))
('error (ignore (message "%s" e)))) ('error (ignore (message "%s" e))))
return it)) return it))

View file

@ -2,9 +2,17 @@
;;;###if (featurep! +intero) ;;;###if (featurep! +intero)
(def-package! intero (def-package! intero
:after haskell-mode :commands intero-mode
:config :init
(defun +haskell|init-intero ()
"Initializes `intero-mode' in haskell-mode, unless stack isn't installed.
This is necessary because `intero-mode' doesn't do its own error checks."
(when (derived-mode-p 'haskell-mode)
(if (executable-find "stack")
(intero-mode +1)
(message "Couldn't find stack. Refusing to enable intero-mode."))))
(add-hook 'haskell-mode-hook #'+haskell|init-intero) (add-hook 'haskell-mode-hook #'+haskell|init-intero)
:config
(add-hook 'intero-mode-hook #'flycheck-mode) (add-hook 'intero-mode-hook #'flycheck-mode)
(set! :lookup 'haskell-mode :definition #'intero-goto-definition)) (set! :lookup 'haskell-mode :definition #'intero-goto-definition))

View file

@ -1,10 +0,0 @@
;;; lang/haskell/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +haskell|init-intero ()
"Initializes `intero-mode' in haskell-mode, unless stack isn't installed.
This is necessary because `intero-mode' doesn't do its own error checks."
(when (derived-mode-p 'haskell-mode)
(if (executable-find "stack")
(intero-mode +1)
(message "Couldn't find stack. Refusing to enable intero-mode."))))

View file

@ -183,8 +183,9 @@
(def-package! eslintd-fix (def-package! eslintd-fix
:commands (eslintd-fix-mode eslintd-fix) :commands (eslintd-fix-mode eslintd-fix)
:config :config
(add-hook! 'eslintd-fix-mode-hook (defun +javascript|set-flycheck-executable-to-eslint ()
(setq flycheck-javascript-eslint-executable eslintd-fix-executable))) (setq flycheck-javascript-eslint-executable eslintd-fix-executable))
(add-hook 'eslintd-fix-mode-hook #'+javascript|set-flycheck-executable-to-eslint))
(def-package! skewer-mode (def-package! skewer-mode

View file

@ -306,7 +306,7 @@ between the two."
(defun +org|setup-hacks () (defun +org|setup-hacks ()
"Getting org to behave." "Getting org to behave."
;; Don't open separate windows ;; Don't open separate windows
(map-put org-link-frame-setup 'file 'find-file) (map-put org-link-frame-setup 'file #'find-file)
;; Let OS decide what to do with files when opened ;; Let OS decide what to do with files when opened
(setq org-file-apps (setq org-file-apps