aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/span.el
diff options
context:
space:
mode:
Diffstat (limited to 'lib/span.el')
-rw-r--r--lib/span.el42
1 files changed, 19 insertions, 23 deletions
diff --git a/lib/span.el b/lib/span.el
index e7e3d68b..4bb7507e 100644
--- a/lib/span.el
+++ b/lib/span.el
@@ -1,9 +1,9 @@
-;;; span.el --- Datatype of "spans" for Proof General
+;;; span.el --- Datatype of "spans" for Proof General -*- lexical-binding:t -*-
;; This file is part of Proof General.
;; Portions © Copyright 1994-2012 David Aspinall and University of Edinburgh
-;; Portions © Copyright 2003, 2012, 2014 Free Software Foundation, Inc.
+;; Portions © Copyright 2003-2018 Free Software Foundation, Inc.
;; Portions © Copyright 2001-2017 Pierre Courtieu
;; Portions © Copyright 2010, 2016 Erik Martin-Dorel
;; Portions © Copyright 2011-2013, 2016-2017 Hendrik Tews
@@ -24,8 +24,6 @@
;;; Code:
-(eval-when-compile (require 'cl)) ;For lexical-let.
-
(defalias 'span-start 'overlay-start)
(defalias 'span-end 'overlay-end)
(defalias 'span-set-property 'overlay-put)
@@ -42,10 +40,9 @@
"Check if an overlay OL belongs to PG."
(overlay-get ol 'pg-span))
-(defun span-read-only-hook (overlay after start end &optional len)
+(defun span-read-only-hook (&rest _)
(unless inhibit-read-only
- (error "Region is read-only")))
-(add-to-list 'debug-ignored-errors "Region is read-only")
+ (user-error "Region is read-only")))
(defun span-read-only (span)
"Set SPAN to be read only."
@@ -61,12 +58,11 @@
(defun span-write-warning (span fun)
"Give a warning message when SPAN is changed, unless `inhibit-read-only' is non-nil."
- (lexical-let ((fun fun))
- (let ((funs (list (lambda (span afterp beg end &rest args)
- (if (and (not afterp) (not inhibit-read-only))
- (funcall fun beg end))))))
- (span-set-property span 'modification-hooks funs)
- (span-set-property span 'insert-in-front-hooks funs))))
+ (let ((funs (list (lambda (_span afterp beg end &rest _)
+ (if (and (not afterp) (not inhibit-read-only))
+ (funcall fun beg end))))))
+ (span-set-property span 'modification-hooks funs)
+ (span-set-property span 'insert-in-front-hooks funs)))
;; We use end first because proof-locked-queue is often changed, and
;; its starting point is always 1
@@ -155,13 +151,13 @@ A span is before PT if it begins before the character before PT."
(overlay-buffer span)
(buffer-live-p (overlay-buffer span))))
-(defun span-raise (span)
- "Set priority of SPAN to make it appear above other spans."
- ;; FIXME: Emacs already uses a "shorter goes above" which takes care of
- ;; preventing a span from seeing another. So don't play with
- ;; priorities, please!
- ;; (span-set-property span 'priority 100)
- )
+;; (defun span-raise (_span)
+;; "Set priority of SPAN to make it appear above other spans."
+;; ;; FIXME: Emacs already uses a "shorter goes above" which takes care of
+;; ;; preventing a span from seeing another. So don't play with
+;; ;; priorities, please!
+;; ;; (span-set-property span 'priority 100)
+;; )
(defun span-string (span)
(with-current-buffer (overlay-buffer span)
@@ -180,7 +176,7 @@ A span is before PT if it begins before the character before PT."
(overlays-at (posn-point (event-start event)))
(or prop 'span))))
-(defun fold-spans (f &optional buffer from to maparg ignored-flags prop val)
+(defun fold-spans (f &optional buffer from to maparg _ignored-flags prop val)
(with-current-buffer (or buffer (current-buffer))
(let ((ols (overlays-in (or from (point-min)) (or to (point-max))))
res)
@@ -238,7 +234,7 @@ The span will remove itself after a timeout of 2 seconds."
(add-timeout 2 'delete-overlay ol)
ol))
-(defun span-delete-self-modification-hook (span &rest args)
+(defun span-delete-self-modification-hook (span &rest _)
"Hook for overlay modification-hooks, which deletes SPAN."
(if (span-live-p span)
(span-delete span)))
@@ -252,7 +248,7 @@ Return the span."
(overlay-put ol (car props) (cadr props))
(setq props (cddr props)))
(span-set-property ol 'modification-hooks
- (list 'span-delete-self-modification-hook))
+ (list #'span-delete-self-modification-hook))
ol))