aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/span.el
diff options
context:
space:
mode:
Diffstat (limited to 'lib/span.el')
-rw-r--r--lib/span.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/span.el b/lib/span.el
index cbdf8406..371292ec 100644
--- a/lib/span.el
+++ b/lib/span.el
@@ -85,11 +85,16 @@
(car-safe (spans-at-point-prop pt prop)))
(defsubst span-delete (span)
- "Delete SPAN."
- (let ((predelfn (span-property span 'span-delete-action)))
- (and predelfn (funcall predelfn)))
+ "Run the 'span-delete-actions and delete SPAN."
+ (mapc (lambda (predelfn) (funcall predelfn))
+ (span-property span 'span-delete-actions))
(delete-overlay span))
+(defsubst span-add-delete-action (span action)
+ "Add ACTION to the list of functions called when SPAN is deleted."
+ (span-set-property span 'span-delete-actions
+ (cons action (span-property span 'span-delete-actions))))
+
;; The next two change ordering of list of spans:
(defsubst span-mapcar-spans (fn start end prop)
"Map function FN over spans between START and END with property PROP."