aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii2016-09-23 11:27:18 +0300
committerEli Zaretskii2016-09-23 11:27:18 +0300
commit2c72c46af18b586137c3cebde56f451c1b0b7a9b (patch)
tree4904056f078af099b3f3777395a639aa3b504e56 /doc
parentf6fa160e91e264f0a3f797b56e8605dbdb32cb76 (diff)
downloademacs-2c72c46af18b586137c3cebde56f451c1b0b7a9b.tar.gz
emacs-2c72c46af18b586137c3cebde56f451c1b0b7a9b.zip
Improve documentation of overlay priorities
* doc/lispref/display.texi (Overlay Properties): Minor copyedits. By popular demand, mention the '(PRIMNARY . SECONDARY)' form of overlay properties used for the region. (Bug#20253)
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/display.texi23
1 files changed, 15 insertions, 8 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 0d0ec671f7c..d3e424853ad 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1553,10 +1553,8 @@ the buffer's undo list.
1553 1553
1554 Since more than one overlay can specify a property value for the 1554 Since more than one overlay can specify a property value for the
1555same character, Emacs lets you specify a priority value of each 1555same character, Emacs lets you specify a priority value of each
1556overlay. In case two overlays have the same priority value, and one 1556overlay. The priority value is used to decide which of the
1557is nested in the other, then the inner one will have priority over the 1557overlapping overlays will ``win''.
1558outer one. If neither is nested in the other then you should not make
1559assumptions about which overlay will prevail.
1560 1558
1561 These functions read and set the properties of an overlay: 1559 These functions read and set the properties of an overlay:
1562 1560
@@ -1593,17 +1591,26 @@ If you want to specify a priority value, use either @code{nil}
1593 1591
1594The priority matters when two or more overlays cover the same 1592The priority matters when two or more overlays cover the same
1595character and both specify the same property; the one whose 1593character and both specify the same property; the one whose
1596@code{priority} value is larger overrides the other. For the 1594@code{priority} value is larger overrides the other. (For the
1597@code{face} property, the higher priority overlay's value does not 1595@code{face} property, the higher priority overlay's value does not
1598completely override the other value; instead, its face attributes 1596completely override the other value; instead, its face attributes
1599override the face attributes of the lower priority @code{face} 1597override the face attributes of the lower priority @code{face}
1600property. 1598property.) If two overlays have the same priority value, and one is
1599nested in the other, then the inner one will prevail over the outer
1600one. If neither is nested in the other then you should not make
1601assumptions about which overlay will prevail.
1601 1602
1602Currently, all overlays take priority over text properties. 1603Currently, all overlays take priority over text properties.
1603 1604
1604Note that Emacs sometimes uses non-numeric priority values for some of 1605Note that Emacs sometimes uses non-numeric priority values for some of
1605its internal overlays, so do not try to do arithmetic on the 1606its internal overlays, so do not try to do arithmetic on the priority
1606priority of an overlay (unless it is one that you created). If you 1607of an overlay (unless it is one that you created). In particular, the
1608overlay used for showing the region uses a priority value of the form
1609@w{@code{(@var{primary} . @var{secondary})}}, where the @var{primary}
1610value is used as described above, and @var{secondary} is the fallback
1611value used when @var{primary} and the nesting considerations fail to
1612resolve the precedence between overlays. However, you are advised not
1613to design Lisp programs based on this implementation detail; if you
1607need to put overlays in priority order, use the @var{sorted} argument 1614need to put overlays in priority order, use the @var{sorted} argument
1608of @code{overlays-at}. @xref{Finding Overlays}. 1615of @code{overlays-at}. @xref{Finding Overlays}.
1609 1616