Skip to content

Commit

Permalink
Minor refactors & revision across the board
Browse files Browse the repository at this point in the history
  • Loading branch information
hlissner committed Jul 31, 2020
1 parent a54d2b3 commit 6a64f37
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 35 deletions.
6 changes: 5 additions & 1 deletion modules/config/literate/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,14 @@ For example:
(package! other-package)
,#+END_SRC

,#+BEGIN_SRC sh :tangle ~/.dotfiles/bin/script.sh
,#+BEGIN_SRC sh :tangle ~/.dotfiles/bin/script.sh :tangle-mode (identity #o755)
#!/usr/bin/env bash
echo Hello world
,#+END_SRC

,#+BEGIN_SRC sh :tangle ~/.dotfiles/bin/script.sh :shebang "#!/usr/bin/env bash"
echo Hello world
,#+END_SRC
#+END_SRC

** Modularizing your literate config with ~#+INCLUDE~ directives
Expand Down
19 changes: 9 additions & 10 deletions modules/config/literate/autoload.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,25 @@ byte-compiled from.")
(print! (start "Compiling your literate config..."))
(print-group!
(let* ((default-directory doom-private-dir)
(org (expand-file-name +literate-config-file))
(dest (concat (file-name-sans-extension +literate-config-file) ".el"))
(org (expand-file-name +literate-config-file))
(dest (concat (file-name-sans-extension +literate-config-file) ".el"))
(backup (make-temp-file "config.org.backup")))
(and (require 'ox)
(require 'ob-tangle)
(unwind-protect
(letf! ((defun message (msg &rest args)
(when msg
(print! (info "%s") (apply #'format msg args))))
;; Prevent infinite recursion due to
;; recompile-on-save hooks later.
;; Prevent infinite recursion due to recompile-on-save
;; hooks later.
(org-mode-hook nil))
;; We do the ol' switcheroo because `org-babel-tangle'
;; writes changes to the current file, which would be
;; imposing on the user.
;; Do the ol' switcheroo because `org-babel-tangle' writes
;; changes to the user's literate config, which would impose on
;; the user.
(copy-file org backup t)
(with-current-buffer (find-file-noselect org)
;; Tangling doesn't expand #+INCLUDE directives, so we
;; do it ourselves, since includes are so useful for
;; literate configs!
;; Tangling won't ordinarily expand #+INCLUDE directives, so
;; we do it ourselves.
(org-export-expand-include-keyword)
(org-babel-tangle nil dest))
t)
Expand Down
7 changes: 4 additions & 3 deletions modules/editor/objed/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ This modules adds [[https://github.com/clemera/objed][objed]], a global minor-mo
text objects. It combines the ideas of versor-mode and other editors like Vim or
Kakoune and tries to align them with regular Emacs conventions.

Note that =objed= is intended as an *alternative* to =evil=, for people who
prefer standard Emacs key-bindings and conventions. It's not recommended to use
these modules together.
#+begin_quote
This module is incompatible with the =:editor evil=. Enabling them both will
cause errors.
#+end_quote

[[https://github.com/clemera/objed][See the objed project README]] for information on keybinds and usage.

Expand Down
11 changes: 6 additions & 5 deletions modules/lang/elixir/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
(after! projectile
(add-to-list 'projectile-project-root-files "mix.exs"))

(after! highlight-numbers
(puthash 'elixir-mode
"\\_<-?[[:digit:]]+\\(?:_[[:digit:]]\\{3\\}\\)*\\_>"
highlight-numbers-modelist))

;;
;;; Packages
Expand Down Expand Up @@ -41,7 +37,12 @@
(sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p)))

(when (featurep! +lsp)
(add-hook 'elixir-mode-local-vars-hook #'lsp!)))
(add-hook 'elixir-mode-local-vars-hook #'lsp!))

(after! highlight-numbers
(puthash 'elixir-mode
"\\_<-?[[:digit:]]+\\(?:_[[:digit:]]\\{3\\}\\)*\\_>"
highlight-numbers-modelist)))


(use-package! flycheck-credo
Expand Down
2 changes: 2 additions & 0 deletions modules/lang/emacs-lisp/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ This module provides no flags.
(in [[file:../../../docs/api.org][docs/api.org]]).
+ This module extends imenu support for Doom's API (e.g. ~package!~,
~use-package~, ~after!~)
+ Flycheck has been configured to tone down the false positives when you are
editing your Emacs or Doom config.

* Prerequisites
This module's sole dependency is Emacs. It's very obscure, you wouldn't know
Expand Down
3 changes: 1 addition & 2 deletions modules/lang/emacs-lisp/autoload.el
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
(or (not default-directory)
(cl-find-if (doom-partial #'file-in-directory-p default-directory)
+emacs-lisp-disable-flycheck-in-dirs)))
(add-to-list (make-local-variable 'flycheck-disabled-checkers)
'emacs-lisp-checkdoc)
(add-to-list 'flycheck-disabled-checkers 'emacs-lisp-checkdoc)
(set (make-local-variable 'flycheck-emacs-lisp-check-form)
(concat "(progn "
(prin1-to-string
Expand Down
9 changes: 5 additions & 4 deletions modules/lang/gdscript/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
:config
(set-lookup-handlers! 'gdscript-mode
:documentation #'gdscript-docs-browse-symbol-at-point)

(when (featurep! +lsp)
(add-hook 'gdscript-mode-local-vars-hook #'lsp!))

(map! :localleader
:map gdscript-mode-map

Expand All @@ -27,7 +31,4 @@

(:prefix ("f" . "format")
"b" #'gdscript-format-buffer
"r" #'gdscript-format-region))

(when (featurep! +lsp)
(add-hook 'gdscript-mode-local-vars-hook #'lsp!)))
"r" #'gdscript-format-region)))
12 changes: 8 additions & 4 deletions modules/lang/org/contrib/roam.el
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@
:desc "Tomorrow" "m" #'org-roam-dailies-tomorrow
:desc "Yesterday" "y" #'org-roam-dailies-yesterday))
:config
(setq org-roam-directory (file-name-as-directory (expand-file-name (or org-roam-directory "roam")
org-directory))
org-roam-verbose nil ; https://youtu.be/fn4jIlFwuLU
org-roam-buffer-window-parameters '((no-delete-other-windows . t)) ; make org-roam buffer sticky
(setq org-roam-directory
(file-name-as-directory
(expand-file-name (or org-roam-directory "roam")
org-directory))
org-roam-verbose nil ; https://youtu.be/fn4jIlFwuLU
;; Make org-roam buffer sticky; i.e. don't replace it when opening a
;; file with an *-other-window command.
org-roam-buffer-window-parameters '((no-delete-other-windows . t))
org-roam-completion-system
(cond ((featurep! :completion helm) 'helm)
((featurep! :completion ivy) 'ivy)
Expand Down
1 change: 1 addition & 0 deletions modules/lang/php/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The features in this module optionally depend on the following php packages:
+ ~boris~ (REPL)
+ ~phpctags~ (better code completion)
+ ~phpunit~ (unit test commands)
+ ~php-cs-fixer~ (for code formatting)

#+BEGIN_SRC sh
composer global require \
Expand Down
5 changes: 3 additions & 2 deletions modules/ui/doom/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
(when solaire-global-mode
(solaire-global-mode -1))))))

(add-hook! 'solaire-global-mode-hook
(add-hook! 'solaire-global-mode-hook :append
(defun +doom-solaire-swap-bg-faces-maybe-h ()
(and solaire-global-mode
(and (bound-and-true-p solaire-global-mode)
(symbolp doom-theme)
(string-prefix-p "doom-" (symbol-name doom-theme))
(solaire-mode-swap-bg))))

Expand Down
8 changes: 4 additions & 4 deletions modules/ui/popup/+hacks.el
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ Ugh, such an ugly hack."
(defadvice! +popup--ignore-window-parameters-a (orig-fn &rest args)
"Allow *interactive* window moving commands to traverse popups."
:around '(windmove-up windmove-down windmove-left windmove-right)
(letf! ((defun windmove-find-other-window (dir &optional arg window)
(window-in-direction
(pcase dir (`up 'above) (`down 'below) (_ dir))
window (bound-and-true-p +popup-mode) arg windmove-wrap-around t)))
(letf! (defun windmove-find-other-window (dir &optional arg window)
(window-in-direction
(pcase dir (`up 'above) (`down 'below) (_ dir))
window (bound-and-true-p +popup-mode) arg windmove-wrap-around t))
(apply orig-fn args)))

0 comments on commit 6a64f37

Please sign in to comment.