5

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.

MajorBriggs
  • 236
  • 1
  • 8
  • How about? `(set-window-fringes (selected-window) 0 0 nil)` Or, perhaps?: `(setq left-fringe-width 0)` and `(setq right-fringe-width 0)` They are considered buffer-local variables: https://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Size_002fPos.html [The documentation discusses how to update the window when using the latter two variables; however, the first option updates the window immediately.] – lawlist Mar 08 '15 at 01:31

1 Answers1

7

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., left-window-fringe and 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.

lawlist
  • 18,826
  • 5
  • 37
  • 118
  • This does not work. In a terminal it does nothing, and in the GUI if you get rid of the fringe where the little arrows are shown, then you get the '\' instead like in terminal mode. – psusi Aug 26 '22 at 19:30