www.delorie.com/gnu/docs/elisp-manual-21/elisp_645.html   search  
Buy the book!

GNU Emacs Lisp Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

38.12.3 Displaying in the Margins

A buffer can have blank areas called display margins on the left and on the right. Ordinary text never appears in these areas, but you can put things into the display margins using the display property.

To put text in the left or right display margin of the window, use a display specification of the form (margin right-margin) or (margin left-margin) on it. To put an image in a display margin, use that display specification along with the display specification for the image.

Before the display margins can display anything, you must give them a nonzero width. The usual way to do that is to set these variables:

Variable: left-margin-width
This variable specifies the width of the left margin. It is buffer-local in all buffers.

Variable: right-margin-width
This variable specifies the width of the right margin. It is buffer-local in all buffers.

Setting these variables does not immediately affect the window. These variables are checked when a new buffer is displayed in the window. Thus, you can make changes take effect by calling set-window-buffer.

You can also set the margin widths immediately.

Function: set-window-margins window left &optional right
This function specifies the margin widths for window window. The argument left controls the left margin and right controls the right margin (default 0).

Function: window-margins &optional window
This function returns the left and right margins of window as a cons cell of the form (left . right). If window is nil, the selected window is used.

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003