Debug undefined add-hook-before-save
`use-package` complains that `add-hook-before-save` doesn't exist. This is because it's now named `macros-add-hook-before-save`. This fixes that.
This commit is contained in:
		
							parent
							
								
									71e57700d6
								
							
						
					
					
						commit
						924c7fa419
					
				
					 4 changed files with 36 additions and 5 deletions
				
			
		|  | @ -38,7 +38,7 @@ Useful in `add-hook' calls." | |||
| 
 | ||||
| (defmacro macros-add-hook-before-save (mode f) | ||||
|   "Register a hook, `F', for a mode, `MODE' more conveniently. | ||||
| Usage: (add-hook-before-save 'reason-mode-hook #'refmt-before-save)" | ||||
| Usage: (macros-add-hook-before-save 'reason-mode-hook #'refmt-before-save)" | ||||
|   `(add-hook ,mode | ||||
|              (lambda () | ||||
|                (add-hook 'before-save-hook ,f)))) | ||||
|  |  | |||
|  | @ -9,9 +9,20 @@ | |||
| ;; My preferences for working with Elixir / Erlang projects | ||||
| 
 | ||||
| ;;; Code: | ||||
| 
 | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| ;; Dependencies | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| 
 | ||||
| (require 'macros) | ||||
| 
 | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| ;; Configuration | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| 
 | ||||
| (use-package elixir-mode | ||||
|   :config | ||||
|   (add-hook-before-save 'elixir-mode-hook #'elixir-format)) | ||||
|   (macros-add-hook-before-save 'elixir-mode-hook #'elixir-format)) | ||||
| 
 | ||||
| (provide 'wpc-elixir) | ||||
| ;;; wpc-elixir.el ends here | ||||
|  |  | |||
|  | @ -10,10 +10,20 @@ | |||
| 
 | ||||
| ;;; Code: | ||||
| 
 | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| ;; Dependencies | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| 
 | ||||
| (require 'macros) | ||||
| 
 | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| ;; Configuration | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| 
 | ||||
| ;; font-locking, glyph support, etc | ||||
| (use-package haskell-mode | ||||
|   :config | ||||
|   (add-hook-before-save 'haskell-mode #'haskell-align-imports)) | ||||
|   (macros-add-hook-before-save 'haskell-mode #'haskell-align-imports)) | ||||
| 
 | ||||
| ;; LSP support | ||||
| (use-package lsp-haskell | ||||
|  |  | |||
|  | @ -13,8 +13,18 @@ | |||
| ;; - `rustup component add rust-src` | ||||
| ;; - `rustup toolchain add nightly && cargo +nightly install racer` | ||||
| 
 | ||||
| 
 | ||||
| ;;; Code: | ||||
| 
 | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| ;; Dependencies | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| 
 | ||||
| (require 'macros) | ||||
| 
 | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| ;; Configuration | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| 
 | ||||
| (use-package racer | ||||
|   :config | ||||
|   (setq rust-sysroot (->> "~/.cargo/bin/rustc --print sysroot" | ||||
|  | @ -26,7 +36,7 @@ | |||
| (use-package rust-mode | ||||
|   :config | ||||
|   (add-hook 'rust-mode-hook #'racer-mode) | ||||
|   (add-hook-before-save 'rust-mode-hook #'rust-format-buffer) | ||||
|   (macros-add-hook-before-save 'rust-mode-hook #'rust-format-buffer) | ||||
|   (define-key rust-mode-map | ||||
|     (kbd "TAB") | ||||
|     #'company-indent-or-complete-common) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue