emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/objed 36ff680 087/166: Adjust bindings and add addition


From: Clemens Radermacher
Subject: [elpa] externals/objed 36ff680 087/166: Adjust bindings and add additional custom user map binding
Date: Sun, 29 Dec 2019 08:21:06 -0500 (EST)

branch: externals/objed
commit 36ff6805fe341d2a4a596b98749e0963948058bf
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Adjust bindings and add additional custom user map binding
---
 README.asc | 18 +++++++++++-------
 objed.el   | 25 +++++++++++++++++--------
 2 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/README.asc b/README.asc
index 2514af4..237e3f9 100644
--- a/README.asc
+++ b/README.asc
@@ -153,7 +153,9 @@ stay the same. The following gives an overview of available 
keys and commands.
 If commands allow for numeric arguments you can input them without the use of
 kbd:[Ctrl] or kbd:[Meta]. kbd:[0] can be used as an alternative for the
 universal argument (kbd:[C-u]). To add custom commands to the modal state you
-can use `objed-user-map` which is available under prefix key kbd:['].
+can use `objed-user-map` which is available under prefix key kbd:['] and
+`objed-other-user-map` bound to kbd:[-]. It's recommended to use one of these
+map for custom object bindings and the other one for additional operations.
 
 In addition to the commands configured in `objed-cmd-alist` you can use the
 following commands to enter objed (those bindings are only active if you are
@@ -296,7 +298,6 @@ Indent/Move objects around:
 |Switch to line object and move it forward/backward.
 |===
 
-
 Commands to edit objects (applying operations to them). When the region is
 active the operation acts on the current region. To act on multiple objects at
 once you can mark them first (see the "Misc commands" below):
@@ -427,17 +428,20 @@ You can add your own prefix bindings using 
`objed-define-dispatch`.
 |kbd:[#]
 |Switch to another object using `avy`.
 
-|kbd:[+]
+|kbd:[=]
+|Switch to another object inside the current one using `avy`.
+
+|kbd:[`]
 |Activate part from point forward until boundary of some object.
 
-|kbd:[-]
+|kbd:[´]
 |Activate part from point backward until boundary of some object.
 
 |kbd:[@]
-|Extend current object by including trailing whitespace.
-
-|kbd:[`]
 |Extend current object by including leading whitespace.
+
+|kbd:[_]
+|Extend current object by including trailing whitespace.
 |===
 
 
diff --git a/objed.el b/objed.el
index 13cd883..bbfca15 100644
--- a/objed.el
+++ b/objed.el
@@ -741,11 +741,16 @@ selected one."
     ;; mark upwards
     (define-key map "M" 'objed-toggle-mark-backward)
     ;; (define-key map "M" 'objed-unmark-all)
+    ;; Use h block expansion now
+    ;; TODO: bind l to something else
+    (define-key map "l" 'objed-line-object)
+
 
     ;; "visual"
     (define-key map "v" 'objed-extend)
-    (define-key map "@" 'objed-include-trailing-ws)
-    (define-key map "`" 'objed-include-leading-ws)
+    ;; TODO: more general include expansion?
+    (define-key map "@" 'objed-include-leading-ws)
+    (define-key map "_" 'objed-include-trailing-ws)
 
     ;; basic edit ops
     (define-key map "k" 'objed-kill)
@@ -762,8 +767,6 @@ selected one."
     (define-key map ";"
       (objed-define-op nil objed-comment-or-uncomment-region))
 
-
-
     (define-key map "$"
       (objed-define-op nil flyspell-region))
 
@@ -776,14 +779,15 @@ selected one."
     ;; direct object switches
     (define-key map "." 'objed-goto-next-identifier)
     (define-key map "," 'objed-goto-prev-identifier)
-    (define-key map "_" 'objed-toggle-indentifier-place)
-    (define-key map "l" 'objed-line-object)
+    ;; (define-key map "_" 'objed-toggle-indentifier-place)
     ;;(define-key map "%" 'objed-contents-object)
 
     ;; prefix keys
     (define-key map "x" 'objed-op-map)
     (define-key map "c" 'objed-object-map)
+    ;; for custom user object and op commands
     (define-key map "'" 'objed-user-map)
+    (define-key map "-" 'objed-other-user-map)
 
     (define-key map (kbd "M-g o") 'objed-occur)
 
@@ -934,6 +938,11 @@ To define new operations see `objed-define-op'.")
     map)
   "Keymap for custom user bindings.")
 
+(defvar objed-other-user-map
+  (let ((map (objed--define-prefix "-" 'objed-user-map)))
+    map)
+  "Keymap for custom user bindings.")
+
 
 (defvar objed-object-map
   (let ((map (objed--define-prefix "c" 'objed-object-map)))
@@ -990,8 +999,8 @@ 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)
+(objed-define-dispatch "`" objed--backward-until)
+(objed-define-dispatch "´" objed--forward-until)
 
 (defun objed--backward-until (name)
   "Activate part from point backward until object NAME."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]