summaryrefslogtreecommitdiff
path: root/devdocs/elisp/fringe-bitmaps.html
blob: 6f1448067e63e9b33c671d601e3ac6a32a0bee81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 <h4 class="subsection">Fringe Bitmaps</h4>   <p>The <em>fringe bitmaps</em> are the actual bitmaps which represent the logical fringe indicators for truncated or continued lines, buffer boundaries, overlay arrows, etc. Each bitmap is represented by a symbol. These symbols are referred to by the variable <code>fringe-indicator-alist</code>, which maps fringe indicators to bitmaps (see <a href="fringe-indicators">Fringe Indicators</a>), and the variable <code>fringe-cursor-alist</code>, which maps fringe cursors to bitmaps (see <a href="fringe-cursors">Fringe Cursors</a>). </p> <p>Lisp programs can also directly display a bitmap in the left or right fringe, by using a <code>display</code> property for one of the characters appearing in the line (see <a href="other-display-specs">Other Display Specs</a>). Such a display specification has the form </p> <div class="example"> <pre class="example">(<var>fringe</var> <var>bitmap</var> [<var>face</var>])
</pre>
</div> <p><var>fringe</var> is either the symbol <code>left-fringe</code> or <code>right-fringe</code>. <var>bitmap</var> is a symbol identifying the bitmap to display. The optional <var>face</var> names a face whose foreground and background colors are to be used to display the bitmap, using the attributes of the <code>fringe</code> face for colors that <var>face</var> didn’t specify. If <var>face</var> is omitted, that means to use the attributes of the <code>default</code> face for the colors which the <code>fringe</code> face didn’t specify. For predictable results that don’t depend on the attributes of the <code>default</code> and <code>fringe</code> faces, we recommend you never omit <var>face</var>, but always provide a specific face. In particular, if you want the bitmap to be always displayed in the <code>fringe</code> face, use <code>fringe</code> as <var>face</var>. </p> <p>For instance, to display an arrow in the left fringe, using the <code>warning</code> face, you could say something like: </p> <div class="lisp"> <pre class="lisp">(overlay-put
 (make-overlay (point) (point))
 'before-string (propertize
                 "x" 'display
                 `(left-fringe right-arrow warning)))
</pre>
</div> <p>Here is a list of the standard fringe bitmaps defined in Emacs, and how they are currently used in Emacs (via <code>fringe-indicator-alist</code> and <code>fringe-cursor-alist</code>): </p> <dl compact> <dt>
<code>left-arrow</code>, <code>right-arrow</code>
</dt> <dd>
<p>Used to indicate truncated lines. </p> </dd> <dt>
<code>left-curly-arrow</code>, <code>right-curly-arrow</code>
</dt> <dd>
<p>Used to indicate continued lines. </p> </dd> <dt>
<code>right-triangle</code>, <code>left-triangle</code>
</dt> <dd>
<p>The former is used by overlay arrows. The latter is unused. </p> </dd> <dt>
<code>up-arrow</code>, <code>down-arrow</code>
</dt> <dt>
<code>bottom-left-angle</code>, <code>bottom-right-angle</code>
</dt> <dt>
<code>top-left-angle</code>, <code>top-right-angle</code>
</dt> <dt>
<code>left-bracket</code>, <code>right-bracket</code>
</dt> <dt><code>empty-line</code></dt> <dd>
<p>Used to indicate buffer boundaries. </p> </dd> <dt>
<code>filled-rectangle</code>, <code>hollow-rectangle</code>
</dt> <dt>
<code>filled-square</code>, <code>hollow-square</code>
</dt> <dt>
<code>vertical-bar</code>, <code>horizontal-bar</code>
</dt> <dd>
<p>Used for different types of fringe cursors. </p> </dd> <dt>
<code>exclamation-mark</code>, <code>question-mark</code>
</dt> <dd><p>Not used by core Emacs features. </p></dd> </dl> <p>The next subsection describes how to define your own fringe bitmaps. </p> <dl> <dt id="fringe-bitmaps-at-pos">Function: <strong>fringe-bitmaps-at-pos</strong> <em>&amp;optional pos window</em>
</dt> <dd>
<p>This function returns the fringe bitmaps of the display line containing position <var>pos</var> in window <var>window</var>. The return value has the form <code>(<var>left</var> <var>right</var> <var>ov</var>)</code>, where <var>left</var> is the symbol for the fringe bitmap in the left fringe (or <code>nil</code> if no bitmap), <var>right</var> is similar for the right fringe, and <var>ov</var> is non-<code>nil</code> if there is an overlay arrow in the left fringe. </p> <p>The value is <code>nil</code> if <var>pos</var> is not visible in <var>window</var>. If <var>window</var> is <code>nil</code>, that stands for the selected window. If <var>pos</var> is <code>nil</code>, that stands for the value of point in <var>window</var>. </p>
</dd>
</dl><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
    <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Bitmaps.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Bitmaps.html</a>
  </p>
</div>