iens

Manager of links to read
git clone https://git.instinctive.eu/iens.git
Log | Files | Refs | README | LICENSE

commit 1381b3233d0730dd1884198f85c9c2fa64a441ab
parent cfbfdbdcd401c03cbff0e4cc1c58a3fee3f955ad
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date:   Sat,  6 Jan 2024 11:52:19 +0000

Command `without-protection!` temporarily sets current entry
Diffstat:
Msrc/iens.scm | 15+++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/iens.scm b/src/iens.scm @@ -311,12 +311,15 @@ (unprotect* (car args) (cadr args))))) (define (without-protection* entry-id proc) - (if (is-protected? entry-id) - (begin - (unprotect! entry-id) - (eval proc) - (protect! entry-id)) - (eval proc))) + (let ((prev-cur-entry-id cur-entry)) + (set! cur-entry entry-id) + (if (is-protected? entry-id) + (begin + (unprotect! entry-id) + (eval proc) + (protect! entry-id)) + (eval proc)) + (set! cur-entry prev-cur-entry-id))) (defcmd (without-protection! first . args) "[entry-id] '(...)" "Perform updates bypassing protection"