* src/buffer.c (Foverlays_at): Add argument `sorted'.

* doc/lispref/display.texi (Overlay Properties): Reword the doc of `priority'.
(Finding Overlays): Document new arg of `overlays-at'.
* lisp/obsolete/lucid.el (extent-at):
* lisp/htmlfontify.el (hfy-overlay-props-at): Use the new `sorted' arg of
overlays-at.
(hfy-fontify-buffer): Remove unused var `orig-ovls'.
* lisp/ps-def.el (ps-generate-postscript-with-faces1): Use the new `sorted'
arg of overlays-at.  Use `invisible-p'.
This commit is contained in:
Stefan Monnier
2014-04-15 09:21:18 -04:00
parent f596f897c6
commit 20fa59a004
8 changed files with 41 additions and 76 deletions

View File

@@ -4168,9 +4168,10 @@ OVERLAY. */)
}
DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0,
doc: /* Return a list of the overlays that contain the character at POS. */)
(Lisp_Object pos)
DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 2, 0,
doc: /* Return a list of the overlays that contain the character at POS.
If SORTED is non-nil, then sort them by decreasing priority. */)
(Lisp_Object pos, Lisp_Object sorted)
{
ptrdiff_t len, noverlays;
Lisp_Object *overlay_vec;
@@ -4190,6 +4191,10 @@ DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0,
noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len,
NULL, NULL, 0);
if (!NILP (sorted))
noverlays = sort_overlays (overlay_vec, noverlays,
WINDOWP (sorted) ? XWINDOW (sorted) : NULL);
/* Make a list of them all. */
result = Flist (noverlays, overlay_vec);