Skip to content

Commit 6113006

Browse files
committed
haskell-load: with-overlay-properties
1 parent 6bb5128 commit 6113006

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

haskell-load.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ actual Emacs buffer of the module being loaded."
304304
(with-current-buffer buffer
305305
(remove-overlays (point-min) (point-max) 'haskell-check t)))
306306

307+
(defmacro with-overlay-properties (proplist ovl &rest body)
308+
"Evaluate BODY with names in PROPLIST bound to the values of
309+
correspondingly-named overlay properties of OVL."
310+
(let ((ovlvar (gensym)))
311+
`(let* ((,ovlvar ,ovl)
312+
,@(mapcar (lambda (p) `(,p (overlay-get ,ovlvar ',p))) proplist))
313+
,@body)))
314+
307315
(defun overlay-start> (o1 o2)
308316
(> (overlay-start o1) (overlay-start o2)))
309317
(defun overlay-start< (o1 o2)

0 commit comments

Comments
 (0)