[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep 29fd924 107/110: Move overlay face to a differen
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep 29fd924 107/110: Move overlay face to a different overlay |
Date: |
Sat, 7 Aug 2021 09:18:12 -0400 (EDT) |
branch: elpa/macrostep
commit 29fd92496449eadee8d5d1bb5559588298ab2adb
Author: Fice T <fice-t@protonmail.com>
Commit: Fice T <fice-t@protonmail.com>
Move overlay face to a different overlay
This different overlay has a negative priority, which lets the region
face work with macrostep.
---
macrostep.el | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index b301497..bccc0ea 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -602,14 +602,18 @@ behaviors."
(macrostep-collapse-overlays-in (point) end)
(delete-region (point) end)
;; Create a new overlay
- (let ((overlay
- (make-overlay start
- (if (looking-at "\n")
- (1+ (point))
- (point)))))
+ (let* ((overlay
+ (make-overlay start
+ (if (looking-at "\n")
+ (1+ (point))
+ (point))))
+ (highlight-overlay (unless macrostep-expansion-buffer
+ (copy-overlay overlay))))
(unless macrostep-expansion-buffer
;; Highlight the overlay in original source buffers only
- (overlay-put overlay 'face
'macrostep-expansion-highlight-face))
+ (overlay-put highlight-overlay 'face
'macrostep-expansion-highlight-face)
+ (overlay-put highlight-overlay 'priority -1)
+ (overlay-put overlay 'macrostep-highlight-overlay
highlight-overlay))
(overlay-put overlay 'priority priority)
(overlay-put overlay 'macrostep-original-text text)
(overlay-put overlay 'macrostep-gensym-depth
macrostep-gensym-depth)
@@ -708,6 +712,8 @@ Also removes the overlay from `macrostep-overlays'."
;; Remove overlay from the list and delete it
(setq macrostep-overlays
(delq overlay macrostep-overlays))
+ (let ((highlight-overlay (overlay-get overlay
'macrostep-highlight-overlay)))
+ (when highlight-overlay (delete-overlay highlight-overlay)))
(delete-overlay overlay)))
(defun macrostep-collapse-overlays-in (start end)
@@ -715,10 +721,11 @@ Also removes the overlay from `macrostep-overlays'."
Will not collapse overlays that begin at START and end at END."
(dolist (ol (overlays-in start end))
- (if (and (> (overlay-start ol) start)
- (< (overlay-end ol) end)
- (overlay-get ol 'macrostep-original-text))
- (macrostep-collapse-overlay ol t))))
+ (when (and (overlay-buffer ol) ; collapsing may delete other
overlays
+ (> (overlay-start ol) start)
+ (< (overlay-end ol) end)
+ (overlay-get ol 'macrostep-original-text))
+ (macrostep-collapse-overlay ol t))))
;;; Emacs Lisp implementation
- [nongnu] elpa/macrostep b1c1230 079/110: More tests, (continued)
- [nongnu] elpa/macrostep b1c1230 079/110: More tests, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 4b382cd 088/110: Identify Elisp compiler-macros more selectively, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep a3338d3 104/110: Make test script exit non-zero on failure, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep e537612 106/110: compmiler-macro changed to compiler-macro, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep a5b980e 035/110: Update readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep fbd61eb 030/110: Tests for macrolet/cl-macrolet support, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep afed3cf 072/110: MARKER-CHAR-POSITION => MARKER-CHAR-ID, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2390cec 075/110: slime-sexp-at-point may return nil, deal with it, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2c5bda2 090/110: Update README, bump version number, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 6c8ae5b 098/110: Remove call to `define-error` for Emacs <24.4, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 29fd924 107/110: Move overlay face to a different overlay,
ELPA Syncer <=
- [nongnu] elpa/macrostep d459ded 024/110: bump version number, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 96e0c02 041/110: WIP: Add generic interface for other languages, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep e9a95f4 049/110: Fix `macrostep--macro-form-info`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep e35b61d 047/110: Add compiler-macro support for SLIME, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 3766ffb 043/110: Hack to propertize macros in SLIME expansions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 522226f 050/110: Improve `macrostep-slime-macro-form-p`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 059dda6 066/110: Also hook into slime-repl-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep e582ca7 078/110: Fix trivial bug printing a single non-list form, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 84e5bfa 086/110: Make tests pass again, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2dd3447 004/110: Fix bug with output of macros that expand to a string (e.g. `rx'), ELPA Syncer, 2021/08/07