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)
3
  • 3
    Does this answer your question? Disabling visual-line-mode only in org-agenda-mode
    – Drew
    Dec 2, 2022 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. Dec 2, 2022 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): emacs.stackexchange.com/questions/50339/…
    – Drew
    Dec 2, 2022 at 18:40

1 Answer 1

2

Something like

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

which toggles the mode off in slime REPLs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.