all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sora Takai <booksipadtest@gmail.com>
To: emacs-devel@gnu.org
Subject: About the interpretation of negative integer values for 'priority overlay property
Date: Mon, 19 Feb 2024 11:10:42 +0900	[thread overview]
Message-ID: <CADWbB7A3jA2EGsAkrzk39-sMEXWXMrDvBwgcjt+Gc1FCOt=5ig@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1576 bytes --]

             reply	other threads:[~2024-02-19  2:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19  2:10 Sora Takai [this message]
2024-02-19 12:30 ` About the interpretation of negative integer values for 'priority overlay property Eli Zaretskii
2024-02-19 13:06   ` Sora Takai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADWbB7A3jA2EGsAkrzk39-sMEXWXMrDvBwgcjt+Gc1FCOt=5ig@mail.gmail.com' \
    --to=booksipadtest@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.