diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-04-15 09:21:18 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-04-15 09:21:18 -0400 |
commit | 20fa59a004fff136c8fe8d4cd160c12d208c5cde (patch) | |
tree | ca419d8f8bfd86149ee28c3b1aad2d961bc33695 /lisp | |
parent | f596f897c6681236092a47cabf51d07abff2286b (diff) | |
download | emacs-20fa59a004fff136c8fe8d4cd160c12d208c5cde.tar.gz |
* 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'.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 10 | ||||
-rw-r--r-- | lisp/htmlfontify.el | 11 | ||||
-rw-r--r-- | lisp/obsolete/lucid.el | 10 | ||||
-rw-r--r-- | lisp/ps-def.el | 46 |
4 files changed, 14 insertions, 63 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 40690692e88..d8e66425d75 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2014-04-15 Stefan Monnier <monnier@iro.umontreal.ca> + + * ps-def.el (ps-generate-postscript-with-faces1): Use the new `sorted' + arg of overlays-at. Use `invisible-p'. + + * obsolete/lucid.el (extent-at): + * htmlfontify.el (hfy-overlay-props-at): Use the new `sorted' arg of + overlays-at. + (hfy-fontify-buffer): Remove unused var `orig-ovls'. + 2014-04-14 João Távora <joaotavora@gmail.com> * net/shr.el (shr-expand-url): Use `expand-file-name' for relative diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 1282654899f..56887f39bef 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -1328,9 +1328,7 @@ return a `defface' style list of face properties instead of a face symbol." (defun hfy-overlay-props-at (p) "Grab overlay properties at point P. The plists are returned in descending priority order." - (sort (mapcar #'overlay-properties (overlays-at p)) - (lambda (A B) (> (or (cadr (memq 'priority A)) 0) ;FIXME: plist-get? - (or (cadr (memq 'priority B)) 0))))) + (mapcar #'overlay-properties (overlays-at p 'sorted))) ;; construct an assoc of (face-name . (css-name . "{ css-style }")) elements: (defun hfy-compile-stylesheet () @@ -1642,7 +1640,6 @@ FILE, if set, is the file name." (css-map nil) (invis-ranges nil) (rovl nil) - (orig-ovls (overlays-in (point-min) (point-max))) (rmin (when mark-active (region-beginning))) (rmax (when mark-active (region-end ))) ) (when (and mark-active @@ -1664,12 +1661,6 @@ FILE, if set, is the file name." (set-buffer html-buffer) ;; rip out props that could interfere with our htmlization of the buffer: (remove-text-properties (point-min) (point-max) hfy-ignored-properties) - ;; Apply overlay invisible spec - (setq orig-ovls - (sort orig-ovls - (lambda (A B) - (> (or (cadr (memq 'priority (overlay-properties A))) 0) - (or (cadr (memq 'priority (overlay-properties B))) 0))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; at this point, html-buffer retains the fontification of the parent: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lisp/obsolete/lucid.el b/lisp/obsolete/lucid.el index d3cb3f135d8..15f80652809 100644 --- a/lisp/obsolete/lucid.el +++ b/lisp/obsolete/lucid.el @@ -125,7 +125,7 @@ This is an XEmacs compatibility function." (defun extent-at (pos &optional object property before) (with-current-buffer (or object (current-buffer)) - (let ((overlays (overlays-at pos))) + (let ((overlays (overlays-at pos 'sorted))) (when property (let (filtered) (while overlays @@ -133,14 +133,6 @@ This is an XEmacs compatibility function." (setq filtered (cons (car overlays) filtered))) (setq overlays (cdr overlays))) (setq overlays filtered))) - (setq overlays - (sort overlays - (function (lambda (o1 o2) - (let ((p1 (or (overlay-get o1 'priority) 0)) - (p2 (or (overlay-get o2 'priority) 0))) - (or (> p1 p2) - (and (= p1 p2) - (> (overlay-start o1) (overlay-start o2))))))))) (if before (nth 1 (memq before overlays)) (car overlays))))) diff --git a/lisp/ps-def.el b/lisp/ps-def.el index 06cef75cbbd..92a2e0b38cd 100644 --- a/lisp/ps-def.el +++ b/lisp/ps-def.el @@ -339,53 +339,11 @@ (setq position (min property-change overlay-change) before-string nil after-string nil) - ;; The code below is not quite correct, - ;; because a non-nil overlay invisible property - ;; which is inactive according to the current value - ;; of buffer-invisibility-spec nonetheless overrides - ;; a face text property. (setq face - (cond ((let ((prop (get-text-property from 'invisible))) - ;; Decide whether this invisible property - ;; really makes the text invisible. - (if (eq save-buffer-invisibility-spec t) - (not (null prop)) - (or (memq prop save-buffer-invisibility-spec) - (assq prop save-buffer-invisibility-spec)))) + (cond ((invisible-p from) 'emacs--invisible--face) - ((get-text-property from 'face)) + ((get-char-property from 'face)) (t 'default))) - (let ((overlays (overlays-at from)) - (face-priority -1)) ; text-property - (while (and overlays - (not (eq face 'emacs--invisible--face))) - (let* ((overlay (car overlays)) - (overlay-invisible - (overlay-get overlay 'invisible)) - (overlay-priority - (or (overlay-get overlay 'priority) 0))) - (and (> overlay-priority face-priority) - (setq before-string - (or (overlay-get overlay 'before-string) - before-string) - after-string - (or (and (<= (overlay-end overlay) position) - (overlay-get overlay 'after-string)) - after-string) - face-priority overlay-priority - face - (cond - ((if (eq save-buffer-invisibility-spec t) - (not (null overlay-invisible)) - (or (memq overlay-invisible - save-buffer-invisibility-spec) - (assq overlay-invisible - save-buffer-invisibility-spec))) - 'emacs--invisible--face) - ((overlay-get overlay 'face)) - (t face) - )))) - (setq overlays (cdr overlays)))) ;; Plot up to this record. (and before-string (ps-plot-string before-string)) |