aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2014-04-15 09:21:18 -0400
committerStefan Monnier2014-04-15 09:21:18 -0400
commit20fa59a004fff136c8fe8d4cd160c12d208c5cde (patch)
treeca419d8f8bfd86149ee28c3b1aad2d961bc33695 /lisp
parentf596f897c6681236092a47cabf51d07abff2286b (diff)
downloademacs-20fa59a004fff136c8fe8d4cd160c12d208c5cde.tar.gz
emacs-20fa59a004fff136c8fe8d4cd160c12d208c5cde.zip
* 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/ChangeLog10
-rw-r--r--lisp/htmlfontify.el11
-rw-r--r--lisp/obsolete/lucid.el10
-rw-r--r--lisp/ps-def.el46
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 @@
12014-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * ps-def.el (ps-generate-postscript-with-faces1): Use the new `sorted'
4 arg of overlays-at. Use `invisible-p'.
5
6 * obsolete/lucid.el (extent-at):
7 * htmlfontify.el (hfy-overlay-props-at): Use the new `sorted' arg of
8 overlays-at.
9 (hfy-fontify-buffer): Remove unused var `orig-ovls'.
10
12014-04-14 João Távora <joaotavora@gmail.com> 112014-04-14 João Távora <joaotavora@gmail.com>
2 12
3 * net/shr.el (shr-expand-url): Use `expand-file-name' for relative 13 * 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."
1328(defun hfy-overlay-props-at (p) 1328(defun hfy-overlay-props-at (p)
1329 "Grab overlay properties at point P. 1329 "Grab overlay properties at point P.
1330The plists are returned in descending priority order." 1330The plists are returned in descending priority order."
1331 (sort (mapcar #'overlay-properties (overlays-at p)) 1331 (mapcar #'overlay-properties (overlays-at p 'sorted)))
1332 (lambda (A B) (> (or (cadr (memq 'priority A)) 0) ;FIXME: plist-get?
1333 (or (cadr (memq 'priority B)) 0)))))
1334 1332
1335;; construct an assoc of (face-name . (css-name . "{ css-style }")) elements: 1333;; construct an assoc of (face-name . (css-name . "{ css-style }")) elements:
1336(defun hfy-compile-stylesheet () 1334(defun hfy-compile-stylesheet ()
@@ -1642,7 +1640,6 @@ FILE, if set, is the file name."
1642 (css-map nil) 1640 (css-map nil)
1643 (invis-ranges nil) 1641 (invis-ranges nil)
1644 (rovl nil) 1642 (rovl nil)
1645 (orig-ovls (overlays-in (point-min) (point-max)))
1646 (rmin (when mark-active (region-beginning))) 1643 (rmin (when mark-active (region-beginning)))
1647 (rmax (when mark-active (region-end ))) ) 1644 (rmax (when mark-active (region-end ))) )
1648 (when (and mark-active 1645 (when (and mark-active
@@ -1664,12 +1661,6 @@ FILE, if set, is the file name."
1664 (set-buffer html-buffer) 1661 (set-buffer html-buffer)
1665 ;; rip out props that could interfere with our htmlization of the buffer: 1662 ;; rip out props that could interfere with our htmlization of the buffer:
1666 (remove-text-properties (point-min) (point-max) hfy-ignored-properties) 1663 (remove-text-properties (point-min) (point-max) hfy-ignored-properties)
1667 ;; Apply overlay invisible spec
1668 (setq orig-ovls
1669 (sort orig-ovls
1670 (lambda (A B)
1671 (> (or (cadr (memq 'priority (overlay-properties A))) 0)
1672 (or (cadr (memq 'priority (overlay-properties B))) 0)))))
1673 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1664 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1674 ;; at this point, html-buffer retains the fontification of the parent: 1665 ;; at this point, html-buffer retains the fontification of the parent:
1675 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1666 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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."
125 125
126(defun extent-at (pos &optional object property before) 126(defun extent-at (pos &optional object property before)
127 (with-current-buffer (or object (current-buffer)) 127 (with-current-buffer (or object (current-buffer))
128 (let ((overlays (overlays-at pos))) 128 (let ((overlays (overlays-at pos 'sorted)))
129 (when property 129 (when property
130 (let (filtered) 130 (let (filtered)
131 (while overlays 131 (while overlays
@@ -133,14 +133,6 @@ This is an XEmacs compatibility function."
133 (setq filtered (cons (car overlays) filtered))) 133 (setq filtered (cons (car overlays) filtered)))
134 (setq overlays (cdr overlays))) 134 (setq overlays (cdr overlays)))
135 (setq overlays filtered))) 135 (setq overlays filtered)))
136 (setq overlays
137 (sort overlays
138 (function (lambda (o1 o2)
139 (let ((p1 (or (overlay-get o1 'priority) 0))
140 (p2 (or (overlay-get o2 'priority) 0)))
141 (or (> p1 p2)
142 (and (= p1 p2)
143 (> (overlay-start o1) (overlay-start o2)))))))))
144 (if before 136 (if before
145 (nth 1 (memq before overlays)) 137 (nth 1 (memq before overlays))
146 (car overlays))))) 138 (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 @@
339 (setq position (min property-change overlay-change) 339 (setq position (min property-change overlay-change)
340 before-string nil 340 before-string nil
341 after-string nil) 341 after-string nil)
342 ;; The code below is not quite correct,
343 ;; because a non-nil overlay invisible property
344 ;; which is inactive according to the current value
345 ;; of buffer-invisibility-spec nonetheless overrides
346 ;; a face text property.
347 (setq face 342 (setq face
348 (cond ((let ((prop (get-text-property from 'invisible))) 343 (cond ((invisible-p from)
349 ;; Decide whether this invisible property
350 ;; really makes the text invisible.
351 (if (eq save-buffer-invisibility-spec t)
352 (not (null prop))
353 (or (memq prop save-buffer-invisibility-spec)
354 (assq prop save-buffer-invisibility-spec))))
355 'emacs--invisible--face) 344 'emacs--invisible--face)
356 ((get-text-property from 'face)) 345 ((get-char-property from 'face))
357 (t 'default))) 346 (t 'default)))
358 (let ((overlays (overlays-at from))
359 (face-priority -1)) ; text-property
360 (while (and overlays
361 (not (eq face 'emacs--invisible--face)))
362 (let* ((overlay (car overlays))
363 (overlay-invisible
364 (overlay-get overlay 'invisible))
365 (overlay-priority
366 (or (overlay-get overlay 'priority) 0)))
367 (and (> overlay-priority face-priority)
368 (setq before-string
369 (or (overlay-get overlay 'before-string)
370 before-string)
371 after-string
372 (or (and (<= (overlay-end overlay) position)
373 (overlay-get overlay 'after-string))
374 after-string)
375 face-priority overlay-priority
376 face
377 (cond
378 ((if (eq save-buffer-invisibility-spec t)
379 (not (null overlay-invisible))
380 (or (memq overlay-invisible
381 save-buffer-invisibility-spec)
382 (assq overlay-invisible
383 save-buffer-invisibility-spec)))
384 'emacs--invisible--face)
385 ((overlay-get overlay 'face))
386 (t face)
387 ))))
388 (setq overlays (cdr overlays))))
389 ;; Plot up to this record. 347 ;; Plot up to this record.
390 (and before-string 348 (and before-string
391 (ps-plot-string before-string)) 349 (ps-plot-string before-string))