Using a 80xN terminal, I'm seeing that lines that are exactly 80 characters long are wrapped and the 80th character is shown on a separate line:


Is there some way to stop emacs from wrapping lines that are exactly 80 chars long? (Or rather, exactly $COLUMNS long?). And show them on one line while still wrapping lines that are > 80 chars long... After all, they do in fact fit on an $COLUMNS wide terminal.

A 2003 posting on help-gnu-emacs says:

Also, prior to Emacs 21, Emacs wasted a column for the "\" character that's used to indicate that a line has wrapped (Emacs 21 replaced this with a marker closer to the window border). So a line that's exactly the window's width would be wrapped -- the first n-1 characters would be on the line, then there would be a "\", and then the next line would contain the nth character.

Which describes my situation perfectly, except I'm running Emacs 24.4.1 according to (emacs-version).

(I'm investigating returning to Emacs after many years with Vim. And yes, I want to run Emacs in the terminal, as 99% of my development time I'm editing on remote servers)

  • 2
    Emacs has support for editing remote files using tramp, so you could run a local emacs under a windowing system. – rpluim Sep 10 '18 at 8:46
  • 1
    Note that "closer to the window border" isn't actually possible in a terminal. That text is describing how in GUI frames the fringe is now used to avoid unnecessary wrapping in such situations. – phils Sep 10 '18 at 9:40
  • I'm unfamiliar with all the mechanisms involved here, but I can see in the documentation that the continuation marker can be a character defined by the display table, and that there is zero-width character display option for glyphless characters. It's possible (although I'm not at all certain) this would successfully hide the continuation marker -- however I'm not seeing an obvious way to do so contextually. – phils Sep 10 '18 at 10:05
  • Assuming it's not supported, it seems like a reasonable feature request. – phils Sep 10 '18 at 10:06
  • 1
    Sorry, I'd forgotten that ucs-names used to be an alist. Try this instead (let ((disptab (or buffer-display-table (setq buffer-display-table (make-display-table))))) (set-display-table-slot disptab 'wrap (cdr (assoc "ZERO WIDTH SPACE" (ucs-names))))) – rpluim Sep 11 '18 at 11:43

Your Answer

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

Browse other questions tagged or ask your own question.