forked from alpaker/fill-column-indicator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted README to markdown format and added screenshot.
- Loading branch information
Showing
2 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
Many modern editors and IDEs can graphically indicate the location of the | ||
fill column by drawing a thin line (in design parlance, a `rule') down the | ||
length of the editing window. Fill-column-indicator implements this | ||
facility in Emacs: | ||
|
||
![](./FciRuleStyle.png) | ||
|
||
Installation and Usage | ||
====================== | ||
|
||
Put this file in your load path and put | ||
|
||
(require 'fill-column-indicator) | ||
|
||
in your .emacs. | ||
|
||
To toggle graphical indication of the fill column in a buffer, use the | ||
command `fci-mode'. | ||
|
||
Configuration | ||
============= | ||
|
||
The color of the fill-column rule is controlled by the variable | ||
`fci-rule-color'. Its value can be any valid color name. If nil (the | ||
default value), fci-mode tries to select an appropriate color | ||
automatically. | ||
|
||
On graphical displays, the rule is drawn using a bitmap image generated by | ||
fci-mode. The rule's width (in pixels) is determined by the variable | ||
`fci-rule-width'. The default value is 2. | ||
|
||
On character terminals the rule is drawn using the character specified by | ||
`fci-rule-character'; the default is `|' (ascii 124). If you'd like the | ||
rule to be drawn using fci-rule-character even on graphical displays, set | ||
`fci-always-use-textual-rule' to a non-nil value. | ||
|
||
The image formats used by fci-mode are XPM, PBM, and XBM. By default, it | ||
uses XPM images if Emacs has been compiled with the appropriate library; | ||
if not, it uses PBM images, which are natively supported. You can specify | ||
a particular format by setting `fci-rule-image-format' to either 'xpm, | ||
'xpm, or 'xbm. | ||
|
||
Other Options | ||
============= | ||
|
||
When `truncate-lines' is nil, the effect of drawing a fill-column | ||
indicator is very odd looking. Indeed, in a window with continuation | ||
lines, it makes little sense to indicate the position of the fill column | ||
relative to the window edge (think about what it would mean to talk about | ||
"the" location of the fill column in that case). For this reason, | ||
fci-mode sets truncate-lines to t in buffers in which it is enabled and | ||
restores it to its previous value when disabled. You can turn this | ||
feature off by setting `fci-handle-truncate-lines' to nil. | ||
|
||
If `line-move-visual' is t, then vertical navigation can behave oddly in | ||
several edge cases while fci-mode is enabled (this is due to a bug in C | ||
code). Accordingly, fci-mode locally sets line-move-visual to nil when | ||
enabled and restores it when disabled. This can be suppressed by setting | ||
`fci-handle-line-move-visual' to nil. (But you shouldn't want to do | ||
this. There's no reason to use line-move-visual if truncate-lines is t, | ||
and it doesn't make sense to use something like fci-mode when | ||
truncate-lines is nil.) | ||
|
||
Troubleshooting | ||
=============== | ||
|
||
o If the fill-column rule is misaligned on some lines but otherwise looks | ||
normal, then you're most likely not displaying the buffer contents with | ||
a monospaced font. Check whether the lines in question contain | ||
non-ascii characters that are wider or shorter than the normal character | ||
width. Also, be aware that certain font-lock themes set some faces so | ||
that they look monospaced but aren't quite so. | ||
|
||
o Although the XBM format is natively supported by Emacs, the | ||
implementation on some ports is incomplete; the v23 and v24 Mac OS X | ||
ports are examples. On these systems XBM images are always drawn in | ||
black, in which case one cannot control the color of the rule. Use XPM | ||
or PBM images instead. | ||
|
||
o Fci-mode needs free use of two characters (specifically, it needs the | ||
use of two characters whose display table entries it can change | ||
arbitrarily). By default, it uses the first two characters of the | ||
Private Use Area of the Unicode BMP, viz. U+E000 and U+E001. If you | ||
need to use those characters for some reason, set `fci-padding-char' and | ||
`fci-eol-char' to different values. | ||
|
||
Known Issues | ||
============ | ||
|
||
o The indicator extends only to end of the buffer contents (as opposed to | ||
running the full length of the editing window). | ||
|
||
o When portions of a buffer are invisible, such as when outline mode is | ||
used to hide certain lines, the fill-column rule is hidden as | ||
well. (Working around this would require either (a) rewriting a large | ||
part of xdisp.c, or (b) advising every function that might hide part of | ||
a buffer.) | ||
|
||
o Fci-mode is generally fast: Displaying the rule should be O(n) in the | ||
number of lines in a buffer, with a low constant. (Activating the mode | ||
in a buffer with 30k lines should take under 0.5 sec on a modern | ||
machine.) However, the presence of multibyte characters can slow down | ||
its performance, in proportion to the number of multibyte characters in | ||
the buffer. (This problem stems from the fact that the performance of | ||
the primitive overlay commands is degraded by multibyte characters.) | ||
|
||
o An issue specifc to the Mac OS X (NextStep) port, versions 23.0-23.2: On | ||
graphical displays, the cursor will disappear when positioned directly | ||
on top of the fill-column rule (i.e., when it is positioned at the end | ||
of a line that extends up to but not past the fill-column). The best | ||
way to deal with this is to upgrade to 23.3 or to 24 (or downgrade to | ||
22). If that isn't practical, a fix is available via the mini-package | ||
fci-osx-23-fix.el, which can be downloaded from either: | ||
|
||
github.com/alpaker/Fill-Column-Indicator | ||
|
||
or | ||
|
||
emacswiki.org/emacs/FillColumnIndicator | ||
|
||
Directions for its use are given in the file header. | ||
|
||
Todo | ||
==== | ||
|
||
Accomodate non-nil values of `hl-line-sticky-flag' and similar cases. | ||
|