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.

  • 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 Mar 8 '15 at 1:31
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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