New answers tagged

1

Drew's answer correctly identifies the source of the error message, but there are some additional problems with the code. (defun yasm-calculate-indentation (oldfun) "Add the formatting for a few other keywords I like." (cond ((looking-at-p "section") 0) ; section ((looking-at-p "global") 0) ; global ((looking-at-p "extern") 0) ...


1

(advice-add :around #'asm-calculate-indentation #'yasm-calculate-indentation) should be (advice-add #'asm-calculate-indentation :around #'yasm-calculate-indentation) C-h f advice-add says: advice-add is a compiled Lisp function in `nadvice.el'. (advice-add SYMBOL WHERE FUNCTION &optional PROPS) Like `add-function' but for the function named SYMBOL....


3

The problem isn't that no Magit buffer exists but rather that Magit has not even been loaded. The result is that Symbol’s function definition is void: magit-after-save-refresh-status. So you have to delay adding this function to the hook until it actually exists, like so: (with-eval-after-load 'magit-mode (add-hook 'after-save-hook 'magit-after-save-...


4

No need for a macro, all you need is a function doing a loop: (defun add-hook-x (hook &rest functions) (dolist (function functions) (add-hook hook function))) There isn't really a need for this either once you realize that you can bundle all these functions added to the hook into a single function: (defun my-go-mode-setup () (my-go-project-...


Top 50 recent answers are included