How do I turn off fringes in text-mode? The closest I've gotten is this:
(add-hook 'text-mode-hook (lambda () (set-fringe-mode '(0 . 0))))
But that turns off fringes permanently for all buffers after I've visited a text buffer once.
The documentation offers a couple of options: https://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Size_002fPos.html
One of the options mentioned uses buffer-local variables -- i.e.,
right-window-fringe. However, the documentation discusses some exceptions when those settings will not take effect immediately. The following example uses a value of
0 for the width.
(setq left-fringe-width 0) (setq right-fringe-width 0)
Another method described in the documentation uses the function
set-window-fringes -- e.g.,
(set-window-fringes (selected-window) 0 0 nil)
The latter example will take effect immediately when evaluating it in a window that is already displayed.