[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auto-overlays 0947366 52/93: Modified auto-o-run-after-
From: |
Stefan Monnier |
Subject: |
[elpa] externals/auto-overlays 0947366 52/93: Modified auto-o-run-after-change-functions to ignore changes other than |
Date: |
Mon, 14 Dec 2020 13:00:36 -0500 (EST) |
branch: externals/auto-overlays
commit 09473666f21ed6b91762417402478012dc6023d9
Author: tsc25 <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Modified auto-o-run-after-change-functions to ignore changes other than
insertions or deletions. (Was this behind some of the undo-related bugs?)
---
auto-overlays.el | 69 +++++++++++++++++++++++++++++++-------------------------
1 file changed, 38 insertions(+), 31 deletions(-)
diff --git a/auto-overlays.el b/auto-overlays.el
index 2146b77..aaa145f 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.7
+;; Version: 0.9.8
;; Keywords: automatic, overlays
;; URL: http://www.dr-qubit.org/emacs.php
@@ -30,6 +30,11 @@
;;; Change Log:
;;
+;; Version 0.9.8
+;; * modified `auto-o-run-after-change-functions' to ignore all changes that
+;; aren't either insertions or deletions (was this behind some of the
+;; undo-related bugs?!?)
+;;
;; 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
@@ -1101,40 +1106,42 @@ overlays were saved."
;;;=============================================================
;;; auto-overlay overlay functions
-(defun auto-o-run-after-change-functions (&rest unused)
+(defun auto-o-run-after-change-functions (beg end len)
;; Assigned to the `after-change-functions' hook. Run all the various
;; functions that should run after a change to the buffer, in the correct
;; order.
- ;; repeat until all the pending functions have been cleared (it may be
- ;; necessary to run multiple times since the pending functions may
- ;; themselves cause more functions to be added to the pending lists)
- (while (or auto-o-pending-pre-suicide auto-o-pending-suicides
- auto-o-pending-post-suicide auto-o-pending-updates
- auto-o-pending-post-update)
- ;; run pending pre-suicide functions
- (when auto-o-pending-pre-suicide
- (mapc (lambda (f) (apply (car f) (cdr f))) auto-o-pending-pre-suicide)
- (setq auto-o-pending-pre-suicide nil))
- ;; run pending suicides
- (when auto-o-pending-suicides
- (mapc 'auto-o-suicide auto-o-pending-suicides)
- (setq auto-o-pending-suicides nil))
- ;; run pending post-suicide functions
- (when auto-o-pending-post-suicide
- (mapc (lambda (f) (apply (car f) (cdr f))) auto-o-pending-post-suicide)
- (setq auto-o-pending-post-suicide nil))
- ;; run updates
- (when auto-o-pending-updates
- (mapc (lambda (l) (auto-overlay-update (car l) (cdr l)))
- auto-o-pending-updates)
- (setq auto-o-pending-updates nil))
- ;; run pending post-update functions
- (when auto-o-pending-post-update
- (mapc (lambda (f) (apply (car f) (cdr f))) auto-o-pending-post-update)
- (setq auto-o-pending-post-update nil))
- )
-)
+ ;; ignore changes that aren't either insertions or deletions
+ (when (or (and (/= beg end) (= len 0)) ; insertion
+ (and (= beg end) (/= len 0))) ; deletion
+ ;; repeat until all the pending functions have been cleared (it may be
+ ;; necessary to run multiple times since the pending functions may
+ ;; themselves cause more functions to be added to the pending lists)
+ (while (or auto-o-pending-pre-suicide auto-o-pending-suicides
+ auto-o-pending-post-suicide auto-o-pending-updates
+ auto-o-pending-post-update)
+ ;; run pending pre-suicide functions
+ (when auto-o-pending-pre-suicide
+ (mapc (lambda (f) (apply (car f) (cdr f))) auto-o-pending-pre-suicide)
+ (setq auto-o-pending-pre-suicide nil))
+ ;; run pending suicides
+ (when auto-o-pending-suicides
+ (mapc 'auto-o-suicide auto-o-pending-suicides)
+ (setq auto-o-pending-suicides nil))
+ ;; run pending post-suicide functions
+ (when auto-o-pending-post-suicide
+ (mapc (lambda (f) (apply (car f) (cdr f))) auto-o-pending-post-suicide)
+ (setq auto-o-pending-post-suicide nil))
+ ;; run updates
+ (when auto-o-pending-updates
+ (mapc (lambda (l) (auto-overlay-update (car l) (cdr l)))
+ auto-o-pending-updates)
+ (setq auto-o-pending-updates nil))
+ ;; run pending post-update functions
+ (when auto-o-pending-post-update
+ (mapc (lambda (f) (apply (car f) (cdr f))) auto-o-pending-post-update)
+ (setq auto-o-pending-post-update nil))
+ )))
- [elpa] externals/auto-overlays 5db4a85 32/93: Fixed bug in auto-o-match-overlay that incorrectly set parent property, (continued)
- [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, 2020/12/14
- [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 <=
- [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
- [elpa] externals/auto-overlays 888cba4 74/93: Refactor auto-overlay-(common|compat) into auto-overlays.el, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays 3eeb95a 78/93: Fix bug in delim-start and delim-end property updating., Stefan Monnier, 2020/12/14