[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auto-overlays f268d75 42/93: Fixed bug in auto-overlay-
From: |
Stefan Monnier |
Subject: |
[elpa] externals/auto-overlays f268d75 42/93: Fixed bug in auto-overlay-unload-definition. |
Date: |
Mon, 14 Dec 2020 13:00:34 -0500 (EST) |
branch: externals/auto-overlays
commit f268d75c3a01021bcd9d0f3ceb8869da108eb4bb
Author: Toby Cubitt <toby-predictive@dr-qubit.org>
Commit: tsc25 <toby-predictive@dr-qubit.org>
Fixed bug in auto-overlay-unload-definition.
---
auto-overlays.el | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/auto-overlays.el b/auto-overlays.el
index 4e7204d..6da2969 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.2
+;; Version: 0.9.3
;; Keywords: automatic, overlays
;; URL: http://www.dr-qubit.org/emacs.php
@@ -30,7 +30,10 @@
;;; Change Log:
;;
-;; Version 0.9,2
+;; Version 0.9.3
+;; * fixed bug in `auto-overlay-unload-definition'
+;;
+;; Version 0.9.2
;; * allow SAVE-FILE argument of `auto-overlay-start/stop' to specify a
;; location to save to
;; * made corresponding modifications to `auto-overlay-save/load-overlays'
@@ -188,6 +191,11 @@
`(cddr (assq ,set-id auto-overlay-regexps)))
+;; (defmacro auto-o-set-regexps (set-id regexps)
+;; ;; Set the list of regexp definitions for regexp set SET-ID.
+;; `(setcdr (cdr (assq ,set-id auto-overlay-regexps)) ,regexps))
+
+
;; (defmacro auto-o-set-buffer-list (set-id list)
@@ -687,10 +695,13 @@ from the current buffer. Returns the deleted definition."
`((eq set-id ,set-id)
(eq definition-id ,definition-id))))))
;; delete definition
- (let* ((defs (auto-o-get-regexps set-id))
- (olddef (assq definition-id defs))
+ (let ((olddef (assq definition-id (auto-o-get-regexps set-id)))
def-id class regexps regexp edge regexp-id props)
- (assq-delete-all definition-id defs)
+ ;; 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)
+ (assq-delete-all definition-id (assq set-id auto-overlay-regexps))
+
;; massage deleted definition into form suitable for
;; `auto-overlay-load-definition'
@@ -733,6 +744,9 @@ Returns the deleted regexp."
(let* ((def (cdr (assq definition-id (auto-o-get-regexps set-id))))
(oldregexp (assq regexp-id def))
id edge regexp props)
+ ;; can safely delete by side effect here because the regexp definition
+ ;; is guaranteed not to be the first element of the list (the first two
+ ;; elements of a definition are always the :id and class)
(assq-delete-all regexp-id def)
;; massage deleted definition into form suitable for
@@ -1229,6 +1243,12 @@ overlays were saved."
(forward-line 0)
(while (let ((case-fold-search nil))
(re-search-forward regexp (line-end-position) t))
+ ;; sanity check regexp definition against match
+ (when (or (null (match-beginning group))
+ (null (match-end group)))
+ (error "Match for regexp \"%s\" has no group %d"
+ regexp group))
+
(cond
;; ignore match if it already has a match overlay
((auto-o-matched-p (match-beginning 0) (match-end 0)
- [elpa] externals/auto-overlays 2fabf34 19/93: Various small enhancements and bug-fixes, (continued)
- [elpa] externals/auto-overlays 2fabf34 19/93: Various small enhancements and bug-fixes, Stefan Monnier, 2020/12/14
- [elpa] externals/auto-overlays a530bba 29/93: Ensure properties due to match overlays that are being superceded are removed from overlays., Stefan Monnier, 2020/12/14
- [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 <=
- [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, 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