When Emacs wraps long lines, is there a way to prevent the wrap prefix from having syntax highlighting (font-lock) or any such special properties?

Specifically, I have the following settings:

;; Wrap long lines instead of having them truncated and fall off the screen
(setq truncate-lines nil)
;; Make wrapped lines start at half the available text width
(setq wrap-prefix '(space . (:width (0.5 . text))))

Now, long lines appear like (in org-mode):


Or with visual-line-mode:

with visual-line-mode

(No change with adaptive-wrap-prefix-mode turned on or off.)

Is there a way to have the wrapped line not retain the highlighting (the underline in the images above)?

1 Answer 1


How about using a stretch-glyph?

(setq truncate-lines nil
      wrap-prefix (propertize (char-to-string ?\uE000)
                    'display '(space . (:width (0.5 . text)))))

With this, the examples in the question now look like:

without visual-line-mode

and with visual-line-mode:

enter image description here


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.