[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed 736c331 193/216: Improve undo, repeat will procee
From: |
Stefan Monnier |
Subject: |
[elpa] externals/objed 736c331 193/216: Improve undo, repeat will proceed undo in object region |
Date: |
Tue, 8 Jan 2019 12:29:37 -0500 (EST) |
branch: externals/objed
commit 736c331f91ce033ae4f643b93af7c8e6e4661d26
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>
Improve undo, repeat will proceed undo in object region
---
objed.el | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/objed.el b/objed.el
index 976706b..798b6dd 100644
--- a/objed.el
+++ b/objed.el
@@ -697,8 +697,8 @@ BEFORE and AFTER are forms to execute before/after calling
the command."
(define-key map "="
(objed-define-op nil objed-electric-pair))
;; all the usual quoting signs
- (define-key map "~"
- (objed-define-op nil objed-undo-op current))
+ (define-key map "~" 'objed-undo)
+
;; special commands
@@ -2570,13 +2570,19 @@ c: capitalize."
(capitalize-region beg end))))
-(defun objed-undo-op (_beg _end)
+(defun objed-undo ()
"Undo in current object range."
- (interactive "r")
- ;; region is created by `objed--create-op-from-rcmd'
- (if (fboundp 'undo-tree-undo)
- (undo-tree-undo '(4))
- (undo '(4))))
+ (interactive)
+ (unless (eq last-command 'undo)
+ (push-mark (objed--end) t)
+ (objed--update-current-object
+ (objed-make-object :beg (objed--beg)
+ :end (set-marker (make-marker)
+ (objed--end)))))
+ ;; move back to start on each turn
+ (goto-char (objed--beg))
+ (undo '(4)))
+
(defun objed-replace (beg end)
"Query replace narrowed to region BEG, END."
@@ -2589,7 +2595,7 @@ c: capitalize."
(deactivate-mark)
(if (fboundp 'anzu-query-replace-regexp)
(call-interactively 'anzu-query-replace-regexp)
- (call-interactively 'query-replace-regexp)))))
+ (call-interactively 'query-replace-regexp)))))
;; * Ipipe
- [elpa] externals/objed 30eb150 166/216: Improve exit minibuffer for ipipe, (continued)
- [elpa] externals/objed 30eb150 166/216: Improve exit minibuffer for ipipe, Stefan Monnier, 2019/01/08
- [elpa] externals/objed fa3b6db 161/216: Add include leading/trailing whitespace commands, Stefan Monnier, 2019/01/08
- [elpa] externals/objed de2d6e1 162/216: Toggle for repeating objed-extend, Stefan Monnier, 2019/01/08
- [elpa] externals/objed ec04ce3 182/216: Simplify exit-op logic, Stefan Monnier, 2019/01/08
- [elpa] externals/objed d0bc8c7 165/216: Update docs for ipipe, Stefan Monnier, 2019/01/08
- [elpa] externals/objed ee50345 170/216: Rephrase, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 76779dc 197/216: Adjust activation condition again, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 74b3595 181/216: Adjust textblock object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 3a983ab 205/216: Read arguments of rcmd after region is established, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 6092485 173/216: Ignore cases where object could not be found (range = nil), Stefan Monnier, 2019/01/08
- [elpa] externals/objed 736c331 193/216: Improve undo, repeat will proceed undo in object region,
Stefan Monnier <=
- [elpa] externals/objed 723fe2c 204/216: Adjust objed-activate again, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 7c2bc2f 206/216: Inline eval-rspec, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 3c8f74d 186/216: Make forward-word work like the other commands for extend, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 47ff6db 207/216: Provide default for replace-op, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 9ddefdb 172/216: Fix empty buffer error for exit-op, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 3096642 001/216: Initial commit, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 9225e77 194/216: Improve objed-extend, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 5d7bda7 200/216: Fix typo (lexical binding), Stefan Monnier, 2019/01/08
- [elpa] externals/objed 8fc9649 199/216: Fix markup, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 806c681 209/216: Improve objed-activate conditions, Stefan Monnier, 2019/01/08