0

I have this minor mode set to work on all buffers:

;; John Mercouris centered point mode
;; Homepage: https://github.com/jmercouris/emacs-centered-point

(define-minor-mode centered-point-mode
  "Alaways center the cursor in the middle of the screen."
  :lighter "..."
  (cond (centered-point-mode (add-hook 'post-command-hook 'line-change))
    (t (remove-hook 'post-command-hook 'line-change))))

(defun line-change ()
  (when (eq (get-buffer-window)
            (selected-window))
    (recenter)))

(provide 'centeredpoint)

(centered-point-mode t)

This is close to what I want. I wished this was a global mode working on all buffers, except for the SLIME's REPL buffer.

How can I insert this exception in my config files?

What should I change on:

(centered-point-mode t)
Drew
  • 75,699
  • 9
  • 109
  • 225
Pedro Delfino
  • 1,369
  • 3
  • 13
  • 3
    Does this answer your question? [Disabling visual-line-mode only in org-agenda-mode](https://emacs.stackexchange.com/questions/68160/disabling-visual-line-mode-only-in-org-agenda-mode) – Drew Dec 02 '22 at 16:56
  • I do not use @drew Slime anymore... It has been 6 months. I am not sure. But, I think no. It would not answer the question as the answer below did. – Pedro Delfino Dec 02 '22 at 18:37
  • 1
    This is an older question of which this one is essentially a duplicate. This is what I should have pointed to (the question really has nothing to do with any particular major or minor modes): https://emacs.stackexchange.com/questions/50339/enabling-a-minor-mode-in-all-but-some-buffers – Drew Dec 02 '22 at 18:40

1 Answers1

2

Something like

(add-hook 'slime-repl-mode-hook (lambda () (centered-point-mode -1)))

which toggles the mode off in slime REPLs.

Fran Burstall
  • 3,665
  • 10
  • 18