[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auto-overlays 7ca8286 50/93: Added auto-o-schedule-dele
From: |
Stefan Monnier |
Subject: |
[elpa] externals/auto-overlays 7ca8286 50/93: Added auto-o-schedule-delete-in-front-or-behind-suicide |
Date: |
Mon, 14 Dec 2020 13:00:36 -0500 (EST) |
branch: externals/auto-overlays
commit 7ca82869abc80c27efb7a71a0562e3e9aaf9db8e
Author: Toby Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Added auto-o-schedule-delete-in-front-or-behind-suicide
to simulate missing delete-in-front/behind-hooks overlay properties,
allowing
in particular regexps matching beginning/end of line to work properly.
---
auto-overlay-common.el | 11 ++++++-----
auto-overlays.el | 39 ++++++++++++++++++++++++++++-----------
2 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/auto-overlay-common.el b/auto-overlay-common.el
index d7ec335..d9aa6b1 100644
--- a/auto-overlay-common.el
+++ b/auto-overlay-common.el
@@ -45,10 +45,11 @@
(defun auto-overlays-at-point (&optional point prop-test inactive)
- "Return overlays overlapping POINT (or the point, if POINT is
-null). If PROP-TEST is supplied, it should be a list which
-specifies a property test with one of the following forms (or a
-list of such lists if more than one property test is required):
+ "Return overlays overlapping POINT
+(or the point, if POINT is null). If PROP-TEST is supplied, it
+should be a list which specifies a property test with one of the
+following forms (or a list of such lists if more than one
+property test is required):
(FUNCTION PROPERTY)
@@ -59,7 +60,7 @@ list of such lists if more than one property test is
required):
where PROPERTY indicates an overlay property name (a symbol), and
VALUE indicates an arbitrary value or lisp expression.
-For each overlay between START and END, first the values
+For each overlay overlapping POINT, first the values
corresponding to the property names are retrieved from the
overlay, then FUNCTION is called with the properties values
followed by the other values as its arguments. The test is
diff --git a/auto-overlays.el b/auto-overlays.el
index a35c245..bb35b34 100644
--- a/auto-overlays.el
+++ b/auto-overlays.el
@@ -5,7 +5,7 @@
;; Copyright (C) 2005-2008 Toby Cubitt
;; Author: Toby Cubitt <toby-predictive@dr-qubit.org>
-;; Version: 0.9.6
+;; Version: 0.9.7
;; Keywords: automatic, overlays
;; URL: http://www.dr-qubit.org/emacs.php
@@ -30,6 +30,11 @@
;;; Change Log:
;;
+;; Version 0.9.7
+;; * added `auto-o-schedule-delete-in-front-or-behind-suicide' to simulate
+;; missing `delete-in-front-hooks' and `delete-behind-hooks' overlay
+;; properties
+;;
;; Version 0.9.6
;; * bug-fix in `auto-overlay-load-definition'
;;
@@ -815,12 +820,16 @@ refinitions are the same as when the overlays were saved."
(when buffer (set-buffer buffer))
;; run initialisation hooks
(run-hooks 'auto-overlay-load-hook)
- ;; add hook to runs all the various functions scheduled be run after a
+ ;; add hook to run all the various functions scheduled be run after a
;; buffer modification
(add-hook 'after-change-functions 'auto-o-run-after-change-functions
nil t)
;; add hook to schedule an update after a buffer modification
(add-hook 'after-change-functions 'auto-o-schedule-update nil t)
+ ;; add hook to simulate missing `delete-in-front-hooks' and
+ ;; `delete-behind-hooks' overlay properties
+ (add-hook 'after-change-functions
+ 'auto-o-schedule-delete-in-front-or-behind-suicide nil t)
;; set enabled flag for regexp set, and make sure buffer is in buffer list
;; for the regexp set
@@ -842,9 +851,8 @@ refinitions are the same as when the overlays were saved."
(+ i 1) lines))
(auto-overlay-update nil nil set-id)
(forward-line 1))
- (message "Scanning for auto-overlays...done"))
- ))
-)
+ (message "Scanning for auto-overlays...done")))
+ ))
@@ -1183,8 +1191,18 @@ overlays were saved."
(>= (1+ (cdar pending)) (car (cadr pending))))
(setcdr (car pending) (max (cdar pending) (cdr (cadr pending))))
(setcdr pending (cddr pending)))
- ))
-)
+ )))
+
+
+
+(defun auto-o-schedule-delete-in-front-or-behind-suicide (start end len)
+ ;; Schedule `auto-o-suicide' for any overlay that has had characters deleted
+ ;; in front or behind it, to simulate missing `delete-in-front-hooks' and
+ ;; `delete-behind-hooks' overlay properties
+ (unless (= len 0)
+ (dolist (o (auto-overlays-at-point nil '(identity auto-overlay-match)))
+ (when (or (= (overlay-end o) start) (= (overlay-start o) end))
+ (add-to-list 'auto-o-pending-suicides o)))))
@@ -1192,8 +1210,7 @@ overlays were saved."
;; 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.
- (unless modified (add-to-list 'auto-o-pending-suicides o-self))
-)
+ (unless modified (add-to-list 'auto-o-pending-suicides o-self)))
@@ -1330,8 +1347,8 @@ overlays were saved."
;; same one again, it will just be ignored)
(goto-char (+ (match-beginning 0) 1)))))
(forward-line 1))
- ))))))
-)
+ )))
+ ))))
- [elpa] externals/auto-overlays 8108af9 33/93: Replaced a couple of cl functions that had crept in., (continued)
- [elpa] externals/auto-overlays 8108af9 33/93: Replaced a couple of cl functions that had crept in., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays b08e944 23/93: Changes related to new LaTeX functionality:, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 5db4a85 32/93: Fixed bug in auto-o-match-overlay that incorrectly set parent property, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 67776d2 25/93: Parse functions must set basic overlay properties themselves, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays c40d2a5 20/93: Shared regexp sets can once again be enabled and disabled independently in each buffer., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 105a69b 34/93: Simplified predictive-define-all-prefixes., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays a21ba4b 44/93: Fix auto-overlay bug related to overlapping overlays., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays dbf21cb 47/93: minor corrections auto-overlay docs, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays f268d75 42/93: Fixed bug in auto-overlay-unload-definition., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 9448575 40/93: Updated documentation to reflect changes to auto-overlay-start/stop/save/load functions., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 7ca8286 50/93: Added auto-o-schedule-delete-in-front-or-behind-suicide,
Stefan Monnier <=
- [elpa] externals/auto-overlays a73aeff 51/93: Use eq for comparison when adding to auto-o-pending-suicides, instead of equal, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 0947366 52/93: Modified auto-o-run-after-change-functions to ignore changes other than, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays de1bddf 53/93: Added hack to delete marker update entries from buffer-undo-list, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 41ed50e 60/93: Remove ChangeLogs from library headers., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 85c2bbd 61/93: Switched license to GPL3+., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 11cc17f 62/93: Bump version numbers and copyright years., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 0529dfa 64/93: Add @direntry to info files and generate dir files., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 5edcad0 65/93: Makefile rules and utilities for ELPA packaging., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays fad8e4a 72/93: Reenable auto-overlay updates triggered by undo., Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays bd7d56d 67/93: Refactor auto-overlays manual into a single source file., Stefan Monnier, 2020/12/14