Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs print margin column

Tags:

emacs

is there any way to show a real print margin at a specific column (e.g. 80), such that the background gets another color for columns above "n" or a solid line is shown at this column?

I found ColumnMarker (see here), unfortunately, this addon only highlights text that is beyond the specified column.

What I've also tried is changing the window/frame size of emacs to (w/h) = (80/). Generally, this works pretty fine. Unfortunately, it doesn't under GNOME, if the emacs window/frame is maximized!

like image 306
mefiX Avatar asked Aug 13 '10 14:08

mefiX


2 Answers

The package fill-column-indicator.el does exactly what you want, it draws a vertical line at the fill-margin column, but can be configured to use a different value (wrap code comments at column 70, display the vertical line at column 80).

The EmacsWiki has the file and configuration tips.

http://www.emacswiki.org/emacs-en/FillColumnIndicator

like image 102
cst Avatar answered Sep 24 '22 14:09

cst


As far as I recall, there is no way to set a different background to the right of the end-of-line (which I think is what you are trying to do). You can set a background color for each frame, and override it only for normal displayed characters.

My information is a little dated, so it's possible that the impossibility is only in Emacs <=22 and Emacs 23 introduces a way.

like image 42
Gilles 'SO- stop being evil' Avatar answered Sep 21 '22 14:09

Gilles 'SO- stop being evil'