aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlan Mackenzie2017-05-21 10:16:09 +0000
committerAlan Mackenzie2017-05-21 10:16:09 +0000
commitb0b02ca7f3e06d0f092df6f81babd1277bf93b0f (patch)
tree8d5d40e2150d975bd4a4a67e3190fe65b0f9ed37 /doc
parent9759b249e97d4b05644309fc70ae9277b347027e (diff)
downloademacs-b0b02ca7f3e06d0f092df6f81babd1277bf93b0f.tar.gz
emacs-b0b02ca7f3e06d0f092df6f81babd1277bf93b0f.zip
Enhance mode-line percentage offset facility, with "%o" and "%q"
"%o" will display the percentage "travel" of the window through the buffer. "%q" will display a combination of the percentage offsets of the top and bottom of the window. The new user option mode-line-percent-position will facilitate selecting a setting for this part of the mode line. * lisp/bindings.el (mode-line-percent-position): New customizable user option. (mode-line-position): Use mode-line-percent-position in place of "%p", etc. * src/xdisp.c (decode_mode_spec): Add handlers for "%o" and "%q". * doc/lispref/modes.texi (Mode Line Variables): Document mode-line-percent-position. (%-Constructs): Document %o and %q. * etc/NEWS: Add an entry for these new facilities.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/modes.texi18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index eb72fcfd369..0e476b47a31 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -1972,6 +1972,14 @@ displays the buffer percentage and, optionally, the buffer size, the
1972line number and the column number. 1972line number and the column number.
1973@end defvar 1973@end defvar
1974 1974
1975@defopt mode-line-percent-position
1976This option is used in @code{mode-line-position}. Its value specifies
1977both the buffer percentage to display (one of @code{nil}, @code{"%o"},
1978@code{"%p"}, @code{"%P"} or @code{"%q"}, @pxref{%-Constructs}) and a
1979width to space-fill or truncate to. You are recommended to set this
1980option with the @code{customize-variable} facility.
1981@end defopt
1982
1975@defvar vc-mode 1983@defvar vc-mode
1976The variable @code{vc-mode}, buffer-local in each buffer, records 1984The variable @code{vc-mode}, buffer-local in each buffer, records
1977whether the buffer's visited file is maintained with version control, 1985whether the buffer's visited file is maintained with version control,
@@ -2147,6 +2155,12 @@ of the buffer.
2147@samp{Narrow} when narrowing is in effect; nothing otherwise (see 2155@samp{Narrow} when narrowing is in effect; nothing otherwise (see
2148@code{narrow-to-region} in @ref{Narrowing}). 2156@code{narrow-to-region} in @ref{Narrowing}).
2149 2157
2158@item %o
2159The degree of @dfn{travel} of the window through (the visible portion
2160of) the buffer, i.e. the size of the text above the top of the window
2161expressed as a percentage of all the text outside the window, or
2162@samp{Top}, @samp{Bottom} or @samp{All}.
2163
2150@item %p 2164@item %p
2151The percentage of the buffer text above the @strong{top} of window, or 2165The percentage of the buffer text above the @strong{top} of window, or
2152@samp{Top}, @samp{Bottom} or @samp{All}. Note that the default mode 2166@samp{Top}, @samp{Bottom} or @samp{All}. Note that the default mode
@@ -2158,6 +2172,10 @@ the window (which includes the text visible in the window, as well as
2158the text above the top), plus @samp{Top} if the top of the buffer is 2172the text above the top), plus @samp{Top} if the top of the buffer is
2159visible on screen; or @samp{Bottom} or @samp{All}. 2173visible on screen; or @samp{Bottom} or @samp{All}.
2160 2174
2175@item %q
2176The percentages of text above both the @strong{top} and the
2177@strong{bottom} of the window, separated by @samp{-}, or @samp{All}.
2178
2161@item %s 2179@item %s
2162The status of the subprocess belonging to the current buffer, obtained with 2180The status of the subprocess belonging to the current buffer, obtained with
2163@code{process-status}. @xref{Process Information}. 2181@code{process-status}. @xref{Process Information}.