[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auto-overlays f17a94b 88/93: Switch auto-overlays over
From: |
Stefan Monnier |
Subject: |
[elpa] externals/auto-overlays f17a94b 88/93: Switch auto-overlays over to cl-lib and lexical binding. |
Date: |
Mon, 14 Dec 2020 13:00:44 -0500 (EST) |
branch: externals/auto-overlays
commit f17a94b6f93a30853d3732bedf928c554f00378f
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Switch auto-overlays over to cl-lib and lexical binding.
---
auto-overlay-flat.el | 5 ++---
auto-overlay-line.el | 4 ++--
auto-overlay-nested.el | 7 ++++---
auto-overlay-self.el | 25 +++++++++++--------------
auto-overlay-word.el | 2 +-
auto-overlays.el | 33 ++++++++++++++++-----------------
6 files changed, 36 insertions(+), 40 deletions(-)
diff --git a/auto-overlay-flat.el b/auto-overlay-flat.el
index cf1d37f..e50ceac 100644
--- a/auto-overlay-flat.el
+++ b/auto-overlay-flat.el
@@ -1,4 +1,4 @@
-;;; auto-overlay-flat.el --- flat start/end-delimited automatic overlays
+;;; auto-overlay-flat.el --- flat start/end-delimited automatic overlays
-*- lexical-binding: t; -*-
;; Copyright (C) 2005-2015 Free Software Foundation, Inc
@@ -148,8 +148,7 @@
(t ;; if we're an end-match, look for next end-match...
- (let ((o-start (overlay-get o-parent 'start))
- (o-end (auto-o-next-flat-match o-self 'end)))
+ (let ((o-end (auto-o-next-flat-match o-self 'end)))
(cond
;; if there is one, match parent with it
(o-end
diff --git a/auto-overlay-line.el b/auto-overlay-line.el
index fd0dc4e..8afbb4e 100644
--- a/auto-overlay-line.el
+++ b/auto-overlay-line.el
@@ -1,4 +1,4 @@
-;;; auto-overlay-line.el --- automatic overlays for single lines
+;;; auto-overlay-line.el --- automatic overlays for single lines -*-
lexical-binding: t; -*-
;; Copyright (C) 2005-2015 Free Software Foundation, Inc
@@ -59,7 +59,7 @@
o-new))
-(defun auto-o-schedule-extend-line (o-self modified &rest unused)
+(defun auto-o-schedule-extend-line (o-self modified &rest _unused)
;; All line overlay modification hooks are set to this function, which
;; schedules `auto-o-extend-line' to run after any suicide functions have
;; been called, but before the overlays are updated.
diff --git a/auto-overlay-nested.el b/auto-overlay-nested.el
index f64f287..af23c25 100644
--- a/auto-overlay-nested.el
+++ b/auto-overlay-nested.el
@@ -1,4 +1,4 @@
-;;; auto-overlay-nested.el --- nested start/end-delimited automatic overlays
+;;; auto-overlay-nested.el --- nested start/end-delimited automatic overlays
-*- lexical-binding: t; -*-
;; Copyright (C) 2005-2015 Free Software Foundation, Inc
@@ -115,7 +115,7 @@
(cond
((eq (auto-o-edge o-match) 'start)
(setq pos (overlay-get o-match 'delim-end))
- (setq o-new (make-overlay pos pos nil nil 'rear-advance))
+ (setq o-new (make-overlay pos (if unmatched (point-max) pos) nil nil
'rear-advance))
(overlay-put o-new 'auto-overlay t)
(overlay-put o-new 'set-id (overlay-get o-match 'set-id))
(overlay-put o-new 'definition-id (overlay-get o-match 'definition-id))
@@ -123,7 +123,8 @@
((eq (auto-o-edge o-match) 'end)
(setq pos (overlay-get o-match 'delim-start))
- (setq o-new (make-overlay pos pos nil nil 'rear-advance))
+ (setq o-new (make-overlay (if unmatched (point-min) pos) pos nil nil
+ 'rear-advance))
(overlay-put o-new 'auto-overlay t)
(overlay-put o-new 'set-id (overlay-get o-match 'set-id))
(overlay-put o-new 'definition-id (overlay-get o-match 'definition-id))
diff --git a/auto-overlay-self.el b/auto-overlay-self.el
index 19df8a7..c2201a3 100644
--- a/auto-overlay-self.el
+++ b/auto-overlay-self.el
@@ -1,4 +1,4 @@
-;;; auto-overlay-self.el --- self-delimited automatic overlays
+;;; auto-overlay-self.el --- self-delimited automatic overlays -*-
lexical-binding: t; -*-
;; Copyright (C) 2005-2015 Free Software Foundation, Inc
@@ -296,19 +296,16 @@
;; is null, all overlays after O-START are included.
(when (null end) (setq end (point-max)))
- (let (overlay-list)
- ;; create list of all overlays corresponding to same entry between O-START
- ;; and END
- (setq overlay-list
- ;; Note: We subtract 1 from start and add 1 to end to catch overlays
- ;; that end at start or start at end. This seems to give the
- ;; same results as the old version of `auto-o-self-list'
- ;; (above) in all circumstances.
- (sort (auto-overlays-in
- (1- (overlay-get o-start 'delim-start)) (1+ end)
- `(eq set-id ,(overlay-get o-start 'set-id))
- `(eq definition-id ,(overlay-get o-start 'definition-id)))
- #'auto-overlay-<))))
+ ;; create list of all overlays corresponding to same entry between O-START
and END
+ ;; Note: We subtract 1 from start and add 1 to end to catch overlays that
+ ;; end at start or start at end. This seems to give the same results
+ ;; as the old version of `auto-o-self-list' (above) in all
+ ;; circumstances.
+ (sort (auto-overlays-in
+ (1- (overlay-get o-start 'delim-start)) (1+ end)
+ `(eq set-id ,(overlay-get o-start 'set-id))
+ `(eq definition-id ,(overlay-get o-start 'definition-id)))
+ #'auto-overlay-<))
;;; auto-overlay-self.el ends here
diff --git a/auto-overlay-word.el b/auto-overlay-word.el
index f3471d0..15637c7 100644
--- a/auto-overlay-word.el
+++ b/auto-overlay-word.el
@@ -1,4 +1,4 @@
-;;; auto-overlay-word.el --- automatic overlays for single "words"
+;;; auto-overlay-word.el --- automatic overlays for single "words" -*-
lexical-binding: t; -*-
;; Copyright (C) 2005-2015 Free Software Foundation, Inc
diff --git a/auto-overlays.el b/auto-overlays.el
index 9c165cb..a977854 100644
--- a/auto-overlays.el
+++ b/auto-overlays.el
@@ -1,4 +1,4 @@
-;;; auto-overlays.el --- Automatic regexp-delimited overlays
+;;; auto-overlays.el --- Automatic regexp-delimited overlays -*-
lexical-binding: t; -*-
;; Copyright (C) 2005-2015 Free Software Foundation, Inc
@@ -28,13 +28,13 @@
;;; Code:
+(require 'cl-lib)
+
(defvar auto-overlay-regexps nil)
(make-variable-buffer-local 'auto-overlay-regexps)
(defvar auto-overlay-load-hook nil)
(defvar auto-overlay-unload-hook nil)
-(eval-when-compile (require 'cl))
-
;; (defvar auto-overlay-list nil)
;; (make-variable-buffer-local 'auto-overlay-list)
@@ -590,7 +590,7 @@ Only overlays that satisfy all property tests are returned."
(auto-overlay-trigger-update start)
(unless (= start end) (auto-overlay-trigger-update end))
- (let (overlay-list function prop-list value-list result)
+ (let (overlay-list function prop-list value-list)
;; check properties of each overlay in region
(dolist (o (overlays-in start end))
(catch 'failed
@@ -927,7 +927,7 @@ assumed to be 'start. ID property is a symbol that can be
used to
uniquely identify REGEXP (see `auto-overlay-unload-regexp')."
(let ((defs (assq definition-id (auto-o-get-set set-id)))
- regexp-id rgxp edge exclusive props)
+ regexp-id)
(when (null defs)
(error "Definition \"%s\" not found in auto-overlay regexp set %s"
(symbol-name definition-id) (symbol-name set-id)))
@@ -1000,7 +1000,7 @@ from the current buffer. Returns the deleted definition."
`(eq definition-id ,definition-id)))))
;; delete definition
(let ((olddef (assq definition-id (auto-o-get-set set-id)))
- def-id class regexps regexp edge regexp-id props)
+ def-id class regexps)
;; safe to delete by side effect here because definition is guaranteed
;; not to be the first element of the list (the first two elements of a
;; regexp set are always the set-id and the buffer list)
@@ -1410,14 +1410,13 @@ overlays were saved."
-(defun auto-o-schedule-update (start &optional end unused set-id)
+(defun auto-o-schedule-update (start &optional end _unused _set-id)
;; Schedule `auto-overlay-update' of lines between positions START and END
- ;; (including lines containing START and END), optionally restricted to
- ;; SET-ID. If END is not supplied, schedule update for just line containing
- ;; START. The update will be run by `auto-o-run-after-change-functions'
- ;; after buffer modification is complete. This function is assigned to
- ;; `after-change-functions'.
-
+ ;; (including lines containing START and END). If END is not supplied,
+ ;; schedule update for just line containing START. The update will be run by
+ ;; `auto-o-run-after-change-functions' after buffer modification is
+ ;; complete. This function is assigned to `after-change-functions'.
+ ;; FIXME: Optionally allow argument to restrict to SET-ID?
(save-restriction
(widen) ; need to widen, since goto-line goes to absolute line
(setq start (line-number-at-pos start))
@@ -1477,7 +1476,7 @@ overlays were saved."
-(defun auto-o-schedule-suicide (o-self &optional modified &rest unused)
+(defun auto-o-schedule-suicide (o-self &optional modified &rest _unused)
;; Schedule `auto-o-suicide' to run after buffer modification is
;; complete. It will be run by `auto-o-run-after-change-functions'. Assigned
;; to overlay modification and insert in-front/behind hooks.
@@ -1501,7 +1500,7 @@ overlays were saved."
(save-restriction
(widen)
- (let (definition-id regexp-id class def regexp group priority
+ (let (definition-id regexp-id regexp group priority
o-match o-overlap o-new beg end)
(unless start-line (setq start-line (line-number-at-pos)))
(save-excursion
@@ -1528,8 +1527,8 @@ overlays were saved."
(setq definition-id (pop def))
(when (or (null definition-ids)
(memq definition-id definition-ids))
- (setq class (pop def))
-
+ (pop def)
+
;; check all regexps for current definition
(dotimes (rank (length def))
(setq regexp-id (car (nth rank def)))
- [elpa] externals/auto-overlays 8859d17 35/93: Minor bug fixes., (continued)
- [elpa] externals/auto-overlays 8859d17 35/93: Minor bug fixes., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 31a4d46 48/93: Bug-fixes in auto-overlay-load-overlays and auto-overlay-save-overlays, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 68c4640 59/93: Updated Package-Version, Package-Requires, and Keywords package headers., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 2860354 58/93: Fixed obsolete functions and other compiler warnings., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 216dbc9 55/93: Use 'push' instead of 'add-to-line' in auto-o-schedule-extend-line, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 9894591 63/93: Remove undo marker entry hacks, in the hope that things work correctly now!, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays c34178b 68/93: Add auto-overlays autoloads., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 276e955 75/93: Add auto-overlay-load-set convenience function., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 1d15f76 71/93: Do perform self-cascade on overlays overlapping but not strictly before point., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 02278f0 69/93: Fix direntry sections in texinfo files and dir file generation., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays f17a94b 88/93: Switch auto-overlays over to cl-lib and lexical binding.,
Stefan Monnier <=
- [elpa] externals/auto-overlays 19de2f7 02/93: Version 0.8 of the predictive completion package., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 6c24aa3 10/93: Fixed minor bug in auto-overlay-save-overlays., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 36efcfd 89/93: Handle empty group in auto-o-regexp-match., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 5996143 73/93: Refactor auto-overlays-(in|[highest-priority-]at-point) search functions:, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays c795dc2 81/93: Fix bug in auto-overlay-trigger-update., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 00fb155 91/93: * auto-overlay: Mark or remove unused vars, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays d207912 93/93: * docs/auto-overlay-manual.texinfo: Move as a consequence of the git split, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 0f1ee97 08/93: Version 0.12.2 of the predictive completion package., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 5b53236 09/93: Version 0.13.1 of the predictive completion package., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 2fabf34 19/93: Various small enhancements and bug-fixes, Stefan Monnier, 2020/12/14