[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-real 639ee73 069/160: Using save-excursion when app
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-real 639ee73 069/160: Using save-excursion when applying changes |
Date: |
Wed, 6 Oct 2021 16:58:17 -0400 (EDT) |
branch: externals/org-real
commit 639ee7376d981eab924233dba88c035b1764ef47
Author: Tyler Grinn <tylergrinn@gmail.com>
Commit: Tyler Grinn <tylergrinn@gmail.com>
Using save-excursion when applying changes
---
org-real.el | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/org-real.el b/org-real.el
index b778d48..3d7d208 100644
--- a/org-real.el
+++ b/org-real.el
@@ -304,8 +304,7 @@ ORIG is `org-insert-link', ARGS are the arguments passed to
it."
(replace-link (org-real--to-link
(reverse
(append (cl-subseq
old-containers 0 old-index)
- new-containers))))
- (old-desc ""))
+ new-containers)))))
(when (catch 'conflict
(if (not (= (length new-containers) (- (length
old-containers) old-index)))
(throw 'conflict t))
@@ -318,15 +317,19 @@ ORIG is `org-insert-link', ARGS are the arguments passed
to it."
(setq new-index (+ 1 new-index))
(setq old-index (+ 1 old-index)))
nil)
- (goto-char begin)
- (if (org-in-regexp org-link-bracket-re 1)
- (setq old-desc (when (match-end 2)
(match-string-no-properties 2))))
- (push
- `(lambda ()
- (delete-region ,begin ,end)
- (goto-char ,begin)
- (insert (org-real--link-make-string ,replace-link
,old-desc)))
- changes))))))
+ (let* ((old-desc (save-excursion
+ (and (goto-char begin)
+ (org-in-regexp
org-link-bracket-re 1)
+ (match-end 2)
+ (match-string-no-properties 2))))
+ (new-link (org-real--link-make-string
replace-link old-desc)))
+ (push
+ `(lambda ()
+ (save-excursion
+ (delete-region ,begin ,end)
+ (goto-char ,begin)
+ (insert ,new-link)))
+ changes)))))))
(when (and changes
(or replace-all (let ((response
(read-char-choice
- [elpa] externals/org-real 900f96a 129/160: Added is-plural, (continued)
- [elpa] externals/org-real 900f96a 129/160: Added is-plural, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real fb056dc 078/160: Reuse window if org real diagram already visible, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 4cc110c 086/160: Added document container to org-real-headlines, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 4246089 096/160: Rotate locations of box when cycling, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 193f14d 138/160: Refactoring, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 7e51167 128/160: Linting/documentation, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 0c93bd8 141/160: Updated readme, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 186830b 060/160: Detect return and backspace without gui, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real f80251e 116/160: Merge branch 'next' into 'main', ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 20d9631 147/160: Added boxy dependency, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 639ee73 069/160: Using save-excursion when applying changes,
ELPA Syncer <=