Variable: cache-long-scans
cache-long-scans is a buffer-local variable defined in buffer.c.
Documentation
Non-nil means that Emacs should use caches in attempt to speedup buffer scans.
There is no reason to set this to nil except for debugging purposes.
Normally, the line-motion functions work by scanning the buffer for
newlines. Columnar operations (like move-to-column and
compute-motion) also work by scanning the buffer, summing character
widths as they go. This works well for ordinary text, but if the
buffer's lines are very long (say, more than 500 characters), these
motion functions will take longer to execute. Emacs may also take
longer to update the display.
If cache-long-scans is non-nil, these motion functions cache the
results of their scans, and consult the cache to avoid rescanning
regions of the buffer until the text is modified. The caches are most
beneficial when they prevent the most searching---that is, when the
buffer contains long lines and large regions of characters with the
same, fixed screen width.
When cache-long-scans is non-nil, processing short lines will
become slightly slower (because of the overhead of consulting the
cache), and the caches will use memory roughly proportional to the
number of newlines and characters whose screen width varies.
Bidirectional editing also requires buffer scans to find paragraph
separators. If you have large paragraphs or no paragraph separators
at all, these scans may be slow. If cache-long-scans is non-nil,
results of these scans are cached. This doesn't help too much if
paragraphs are of the reasonable (few thousands of characters) size.
The caches require no explicit maintenance; their accuracy is maintained internally by the Emacs primitives. Enabling or disabling the cache should not affect the behavior of any of the motion functions; it should only affect their performance.
Probably introduced at or before Emacs version 24.4.
Aliases
cache-long-line-scans (obsolete since 24.4)
Source Code
// Defined in /usr/src/emacs/src/buffer.c
// Skipping highlighting due to helpful-max-highlight.
DEFVAR_PER_BUFFER ("cache-long-scans", &BVAR (current_buffer, cache_long_scans), Qnil,
doc: /* Non-nil means that Emacs should use caches in attempt to speedup buffer scans.
There is no reason to set this to nil except for debugging purposes.
Normally, the line-motion functions work by scanning the buffer for
newlines. Columnar operations (like `move-to-column' and
`compute-motion') also work by scanning the buffer, summing character
widths as they go. This works well for ordinary text, but if the
buffer's lines are very long (say, more than 500 characters), these
motion functions will take longer to execute. Emacs may also take
longer to update the display.
If `cache-long-scans' is non-nil, these motion functions cache the
results of their scans, and consult the cache to avoid rescanning
regions of the buffer until the text is modified. The caches are most
beneficial when they prevent the most searching---that is, when the
buffer contains long lines and large regions of characters with the
same, fixed screen width.
When `cache-long-scans' is non-nil, processing short lines will
become slightly slower (because of the overhead of consulting the
cache), and the caches will use memory roughly proportional to the
number of newlines and characters whose screen width varies.
Bidirectional editing also requires buffer scans to find paragraph
separators. If you have large paragraphs or no paragraph separators
at all, these scans may be slow. If `cache-long-scans' is non-nil,
results of these scans are cached. This doesn't help too much if
paragraphs are of the reasonable (few thousands of characters) size.
The caches require no explicit maintenance; their accuracy is
maintained internally by the Emacs primitives. Enabling or disabling
the cache should not affect the behavior of any of the motion
functions; it should only affect their performance. */);
DEFVAR_PER_BUFFER ("point-before-scroll", &BVAR (current_buffer, point_before_scroll), Qnil,
doc: /* Value of point before the last series of scroll operations, or nil. */);
DEFVAR_PER_BUFFER ("buffer-file-format", &BVAR (current_buffer, file_format), Qnil,
doc: /* List of formats to use when saving this buffer.
Formats are defined by `format-alist'. This variable is
set when a file is visited. */);
DEFVAR_PER_BUFFER ("buffer-auto-save-file-format",
&BVAR (current_buffer, auto_save_file_format), Qnil,
doc: /* Format in which to write auto-save files.
Should be a list of symbols naming formats that are defined in `format-alist'.
If it is t, which is the default, auto-save files are written in the
same format as a regular save would use. */);
DEFVAR_PER_BUFFER ("buffer-invisibility-spec",
&BVAR (current_buffer, invisibility_spec), Qnil,
doc: /* Invisibility spec of this buffer.
The default is t, which means that text is invisible if it has a non-nil
`invisible' property.
This variable can also be a list. The list can have two kinds of elements:
`ATOM' and `(ATOM . ELLIPSIS)'. A text character is invisible if its
`invisible' property is `ATOM', or has an `invisible' property that is a list
that contains `ATOM'.
If the `(ATOM . ELLIPSIS)' form is used, and `ELLIPSIS' is non-nil, an
ellipsis will be displayed after the invisible characters.
Setting this variable is very fast, much faster than scanning all the text in
the buffer looking for properties to change. */);
DEFVAR_PER_BUFFER ("buffer-display-count",
&BVAR (current_buffer, display_count), Qintegerp,
doc: /* A number incremented each time this buffer is displayed in a window.
The function `set-window-buffer' increments it. */);
DEFVAR_PER_BUFFER ("buffer-display-time",
&BVAR (current_buffer, display_time), Qnil,
doc: /* Time stamp updated each time this buffer is displayed in a window.
The function `set-window-buffer' updates this variable
to the value obtained by calling `current-time'.
If the buffer has never been shown in a window, the value is nil. */);
DEFVAR_LISP ("transient-mark-mode", Vtransient_mark_mode,
doc: /* Non-nil if Transient Mark mode is enabled.
See the command `transient-mark-mode' for a description of this minor mode.
Non-nil also enables highlighting of the region whenever the mark is active.
The region is highlighted with the `region' face.
The variable `highlight-nonselected-windows' controls whether to highlight
all windows or just the selected window.
Lisp programs may give this variable certain special values:
- The symbol `lambda' enables Transient Mark mode temporarily.
The mode is disabled again after any subsequent action that would
normally deactivate the mark (e.g. buffer modification).
- The pair (only . OLDVAL) enables Transient Mark mode
temporarily. After any subsequent point motion command that is
not shift-translated, or any other action that would normally
deactivate the mark (e.g. buffer modification), the value of
`transient-mark-mode' is set to OLDVAL. */);
Vtransient_mark_mode = Qnil;
DEFVAR_LISP ("inhibit-read-only", Vinhibit_read_only,
doc: /* Non-nil means disregard read-only status of buffers or characters.
A non-nil value that is a list means disregard `buffer-read-only' status,
and disregard a `read-only' text property if the property value is a
member of the list. Any other non-nil value means disregard `buffer-read-only'
and all `read-only' text properties. */);
Vinhibit_read_only = Qnil;
DEFVAR_PER_BUFFER ("cursor-type", &BVAR (current_buffer, cursor_type), Qnil,
doc: /* Cursor to use when this buffer is in the selected window.
Values are interpreted as follows:
t use the cursor specified for the frame
nil don't display a cursor
box display a filled box cursor
(box . SIZE) display a filled box cursor, but make it
hollow if cursor is under masked image larger than
SIZE pixels in either dimension.
hollow display a hollow box cursor
bar display a vertical bar cursor with default width
(bar . WIDTH) display a vertical bar cursor with width WIDTH
hbar display a horizontal bar cursor with default height
(hbar . HEIGHT) display a horizontal bar cursor with height HEIGHT
ANYTHING ELSE display a hollow box cursor
WIDTH and HEIGHT can't exceed the frame's canonical character size.
When the buffer is displayed in a non-selected window, the
cursor's appearance is instead controlled by the variable
`cursor-in-non-selected-windows'. */);
DEFVAR_PER_BUFFER ("line-spacing",
&BVAR (current_buffer, extra_line_spacing), Qnumberp,
doc: /* Additional space to put between lines when displaying a buffer.
The space is measured in pixels, and put below lines on graphic displays,
see `display-graphic-p'.
If value is a floating point number, it specifies the spacing relative
to the default frame line height. A value of nil means add no extra space. */);
DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows",
&BVAR (current_buffer, cursor_in_non_selected_windows), Qnil,
doc: /* Non-nil means show a cursor in non-selected windows.
If nil, only shows a cursor in the selected window.
If t, displays a cursor related to the usual cursor type
\(a solid box becomes hollow, a bar becomes a narrower bar).
You can also specify the cursor type as in the `cursor-type' variable.
Use Custom to set this variable and update the display. */);