[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-real 5363249fc7 069/188: Using save-excursion when
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-real 5363249fc7 069/188: Using save-excursion when applying changes |
Date: |
Sun, 5 May 2024 22:55:54 -0400 (EDT) |
branch: externals/org-real
commit 5363249fc756bc438a452f9b85e084d782d370a3
Author: Amy Grinn <grinn.amy@gmail.com>
Commit: Amy Grinn <grinn.amy@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 b778d48307..3d7d208131 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 51bbcc313a 028/188: Cleaned up hooks, (continued)
- [elpa] externals/org-real 51bbcc313a 028/188: Cleaned up hooks, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 101d6c9899 034/188: Added org-real-pkg for multifile package, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real d84a2a83f8 046/188: Updated readme, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real b0f741198d 044/188: Rearranging, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 6edfdeca01 049/188: Whitespace cleanup, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real c49cce501d 037/188: Check for compiler warnings in CI/CD pipeline, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real de8dc5a6c9 051/188: Added children when following a link, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 38dff3d9fe 055/188: More edge cases, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 68f4ecfc29 071/188: org-real-headlines; Added more keys to Org Real mode, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 24124c2d5b 067/188: Typos, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 5363249fc7 069/188: Using save-excursion when applying changes,
ELPA Syncer <=
- [elpa] externals/org-real b980851142 074/188: Org real headlines takes over current window, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 839b953a2f 087/188: Removed reference to org-collect-keywords, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 8321f7feff 088/188: # `org-real-headlines`, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real f260ca8e21 098/188: Bump version, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real e61d7ae333 102/188: Fully expand siblings when toggling global visibility, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real c9a9646e2e 104/188: Relationship defaults to "in" if omitted in link, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 1e5434a318 107/188: Added popup library, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 00b02f8968 118/188: Reworked flexible layout, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real d61adfc93b 103/188: Refactoring, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 99fb9277c1 116/188: Merge branch 'next' into 'main', ELPA Syncer, 2024/05/05