emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About the interpretation of negative integer values for 'priority overla


From: Sora Takai
Subject: About the interpretation of negative integer values for 'priority overlay property
Date: Mon, 19 Feb 2024 11:10:42 +0900

According to the manual/reference (https://www.gnu.org/software/emacs/manual/html_node/elisp/Overlay-Properties.html), 'priority value of an overlay can be either:

1. nil (which would be interpreted as 0)
2. integer value of 1 or higher (i.e. positive integer)
3. (primary . secondary) cons where both of which can take the value of either (1) or (2).

However, I am seeing cases where negative integers are specified for overlay 'priority property -- even in a core package like simple.el.

To be specific, these are:

lisp/progmodes/gud.el:3098:                    (overlay-put overlay 'priority -45) ; 5 less than hl-line.
lisp/simple.el:523:        (overlay-put ol 'priority -50)


Now the questions I have is:

1. Are negative 'priority integers interpreted in an intuitive sense?  That is, would overlays with negative 'priority numbers rank distinctly lower than anything with higher 'priority values (0 or above)?

2. Are they "valid" in a sense that emacs intends 'priority property to be (in which case the manual description would have to be changed).


Personally, I think having negative 'priority -- given it works as intended -- is useful, since I sometimes bump into use cases where I'd like to make sure certain overlays have the lowest 'priority possible below all others.


Thanks,
Sora

reply via email to

[Prev in Thread] Current Thread [Next in Thread]