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.

1
  • 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: gnu.org/software/emacs/manual/html_node/elisp/… [The documentation discusses how to update the window when using the latter two variables; however, the first option updates the window immediately.]
    – lawlist
    Commented Mar 8, 2015 at 1:31

1 Answer 1

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.

1
  • 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
    Commented Aug 26, 2022 at 19:30

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.