[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed 74204af 037/166: Add ability to jump to objects i
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/objed 74204af 037/166: Add ability to jump to objects inside current one |
Date: |
Sun, 29 Dec 2019 08:20:57 -0500 (EST) |
branch: externals/objed
commit 74204afda8ed92717a25ffc979533e8c916e22f2
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Add ability to jump to objects inside current one
---
objed-objects.el | 16 +++++++++-------
objed.el | 21 +++++++++++++++------
2 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/objed-objects.el b/objed-objects.el
index dfe831c..d24c0ad 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -603,13 +603,15 @@ and after current object.
The resulting list contains cons cells of the start positions of
the objects and the current window."
- (append (objed--collect-backward
- (or fromp (objed--min))
- beg)
- (objed--collect-forward
- (or fromp (if (objed--no-skipper-p)
- (objed--min) (objed--max)))
- end)))
+ (save-restriction
+ (narrow-to-region beg end)
+ (append (objed--collect-backward
+ (or fromp (objed--min))
+ beg)
+ (objed--collect-forward
+ (or fromp (if (objed--no-skipper-p)
+ (objed--min) (objed--max)))
+ end))))
(defun objed--collect-object-lines ()
diff --git a/objed.el b/objed.el
index e6ca0ec..1a772c2 100644
--- a/objed.el
+++ b/objed.el
@@ -987,6 +987,7 @@ Use `objed-define-dispatch' to define a dispatch command.")
(objed-define-dispatch "#" objed--ace-switch-object)
+(objed-define-dispatch "=" objed--ace-switch-in-current)
(objed-define-dispatch "-" objed--backward-until)
(objed-define-dispatch "+" objed--forward-until)
@@ -1082,6 +1083,11 @@ Use `objed-define-dispatch' to define a dispatch
command.")
"Switch to objed NAME using avy."
(objed-ace name))
+(defun objed--ace-switch-in-current (obj)
+ "Ace for OBJ inside current object."
+ (let ((reg (objed--current)))
+ (apply #'objed-ace (cons obj reg))))
+
(defun objed--until (n &optional back)
"Get object N and move point accordingly.
@@ -2232,10 +2238,12 @@ textual content of an object via the content object."
(defvar avy-all-windows)
(defvar avy-action)
-(defun objed-ace (&optional obj)
+(defun objed-ace (&optional obj beg end)
"Jump to an object with `avy'.
-OBJ defaults to current object."
+OBJ defaults to current object. BEG and END limit the region
+which should be searched for candidates and default to
+`window-start' and `window-end.'"
(interactive)
(if (eq objed--object 'char)
(progn (call-interactively #'avy-goto-char)
@@ -2246,11 +2254,12 @@ OBJ defaults to current object."
(let* ((avy-action #'goto-char)
(avy-style 'at-full)
(avy-all-windows t)
- (posns (let* ((oo objed--object)
- (objed--object (or obj objed--object)))
+ (posns (let* ((objed--object (or obj objed--object))
+ (beg (or beg (window-start)))
+ (end (or end (window-end))))
(objed--collect-object-positions
- (window-start) (window-end)
- (unless (eq oo objed--object)
+ beg end
+ (when obj
(point))))))
(cond (posns
(if (> (length posns) 1)
- [elpa] externals/objed be2c78c 027/166: Fix word object for subword-mode, (continued)
- [elpa] externals/objed be2c78c 027/166: Fix word object for subword-mode, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 0956db5 029/166: Don't add additional undo bounds for numeric repeats, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 781f0ee 031/166: Make word object behave correctly with superword/subword-mode, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed a16418c 040/166: Refactor object-toggle-state, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed f9c3819 020/166: Tweak sexp object again, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 2701f73 026/166: Fix backward kill for continuation, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed bddcb432 032/166: Fix dosctring, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 8babcfc 030/166: Make obj state buffer local and keep it on movement, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed e6d306b 033/166: Don't exclude current object for objed-ace, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 32221a6 041/166: Remember object type for marked object, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 74204af 037/166: Add ability to jump to objects inside current one,
Clemens Radermacher <=
- [elpa] externals/objed 87cdeee 039/166: Improve toggle state, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 6ae9bff 042/166: When repeating backward/forward until proceed to object boundary, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 1b50645 048/166: Update docstring, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed db01e08 046/166: Undo last commit, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 25714dc 060/166: Don't try to be smart with electric wrap, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 06f4abc 043/166: Improve repeat behavior for backward/forward until context, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 2a634b8 054/166: Make append mode global, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 828037d 045/166: Improve init/reset checks, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 7d51f03 058/166: Merge branch 'master' of github.com:clemera/objed, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed ceeff84 057/166: Allow defining objects by regex, Clemens Radermacher, 2019/12/29