Questions tagged [hooks]
Hooks are an important mechanism for customizing Emacs. A hook is a Lisp variable which holds a list of functions, to be called on some well-defined occasion.
417 questions
0 votes
0 answers
4 views
access server-buffer-clients from mode hook, or access current server process from lisp code
How can I access, from a mode's hook, the client process(es) that is/are visiting the buffer the mode is being set on? Outside of the context of a hook, I can just access the buffer-local variable ...
0 votes
0 answers
84 views
Clarification on use-package with :hook
At https://www.gnu.org/software/emacs/manual/html_node/use-package/Hooks.html, the Emacs manual states (use-package company :commands company-mode :init (add-hook 'prog-mode-hook #'company-mode))...
0 votes
0 answers
38 views
How to make format-all-mode stop affecting evil-jump-backward?
I recently added following configuration for auto formatting. (use-package format-all :commands format-all-mode :hook (prog-mode . format-all-mode) ;; <------------------ this ...
1 vote
1 answer
114 views
Launch Emacs - How pass name of second monitor to function make-frame-on-monitor?
Given: Emacs 28.1 I have two monitors. M-x make-frame-on-monitor I select "DISPLAY2" and new frame open in the second monitor. Nice. But I want to do this when Emacs is launch. I init.el I ...
1 vote
1 answer
122 views
Hooking backspace character
I have already found the proper hook for when the character is inserted(post-self-insert-hook), but how to hook when a character is deleted? Also, how to get the character that was deleted, I am ...
1 vote
1 answer
114 views
Make backticks electric for markdown mode
I'm trying to use electric pair mode for backticks in markdown mode. The following code hasn't worked and throws and error whenever I type a backtick. How was it wrong? (defvar markdown-electric-pairs ...
0 votes
1 answer
129 views
Can cape be disabled on a mode basis?
I love using cape in text mode, but I cannot figure out how to stop it from activating in programming modes. Is it possible to either only enable it in certain modes or to disable it in specific modes?...
0 votes
2 answers
298 views
before-save-hook not working with use-package and custom mode
I wrote a little derived mode for the kage shader language, it's derived from go-mode (syntax is the same). I also like to use gofmt, but it's just not loading the hook. Here's the mode: (define-...