[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed 042c3bb 051/216: Change some bindings
From: |
Stefan Monnier |
Subject: |
[elpa] externals/objed 042c3bb 051/216: Change some bindings |
Date: |
Tue, 8 Jan 2019 12:29:10 -0500 (EST) |
branch: externals/objed
commit 042c3bb1e86edfff4964c86580968fbbb02665fc
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>
Change some bindings
---
README.asc | 22 +++++++++++++++++-----
objed-objects.el | 13 +++++++------
objed.el | 4 +++-
3 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/README.asc b/README.asc
index 93e6f11..b4a4ca6 100644
--- a/README.asc
+++ b/README.asc
@@ -74,7 +74,7 @@ now continue to the end of the paragraph by pressing kbd:[e]
again.
Now s?he is able to proceed even further by pressing kbd:[e] again OR
to continue by adding new text to the end of the paragraph OR to
continue by acting on the text moved over, for example killing it by
-pressing kbd:[k].
+pressing kbd:[k].
To kill text from point upto a closing parentheses or string quote
etc. you would use kbd:[u] followed by kbd:[k]
@@ -156,6 +156,19 @@ Although some features are still experimental the basic
user interface
will stay the same. The following gives an overview of available keys
and commands.
+In addition to the commands configured in `objed-cmd-alist` you can
+use the following commands.
+
+|===
+|Shortcut |Purpose
+|kbd:[M-n/p]
+|Move to next/prev identifier. Not bound by default, recommended to bind in
`global-map`.
+
+|kbd:[M-SPC]
+|Activate objed with `objed-initial-object`. Bound in `objed-mode-map` by
default.
+|===
+
+
Basic movement commands (switch the object type on movement):
[`objed-map`]
@@ -357,7 +370,7 @@ Misc commands:
|kbd:[Ctrl - Space]
|Set mark.
-|kbd:[Ctrl - h]
+|kbd:[?]
|Get key binding help (uses `which-key` if available).
|kbd:[g/Ctrl - g]
@@ -401,8 +414,8 @@ Add this to your init file:
```elisp
(add-to-list 'load-path "/<path-to>/objed")
(require 'objed)
-;; activating the mode is optional, you can activate objed
-;; always manually using `objed-activate'
+;; activating the mode is optional, you can activate objed
+;; always manually using `objed-activate'
(objed-mode)
```
@@ -417,4 +430,3 @@ aren't to many problems using modes for other languages, I
tried my
best to write text objects in a language agnostic way by using Emacs
syntax information. Testing this and writing tests in general would be
an important next step.
-
diff --git a/objed-objects.el b/objed-objects.el
index 453ac28..6b416ab 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1775,12 +1775,13 @@ non-nil the indentation block can contain empty lines."
(re-search-forward "\\_<" nil t)
(let ((sym (and (or bds (setq bds (bounds-of-thing-at-point 'symbol)))
(buffer-substring (car bds) (cdr bds)))))
- (unless (looking-at "\\_<")
+ (when bds
(goto-char (cdr bds)))
(if (re-search-forward (format "\\_<%s\\_>" sym) nil t)
(goto-char (match-beginning 0))
(goto-char (car bds))
- (when (eq real-this-command #'objed-current-or-next-context)
+ (when (or (eq real-this-command #'objed-current-or-next-context)
+ (eq real-this-command #'objed-next-identifier))
(run-at-time 0 nil (apply-partially #'message "Last one!"))))))))
(defun objed-prev-identifier ()
@@ -1792,14 +1793,14 @@ non-nil the indentation block can contain empty lines."
(let ((sym (and (or bds (setq bds (bounds-of-thing-at-point 'symbol)))
(buffer-substring (car bds) (cdr bds)))))
(when bds
- (unless (looking-back "\\_>" 1)
+ (when (looking-back "\\_>" 1)
(goto-char (car bds)))
(if (re-search-backward (format "\\_<%s\\_>" sym) nil t)
(goto-char (match-beginning 0))
(goto-char (car bds))
- (when (eq real-this-command #'objed-current-or-previous-context)
- (run-at-time 0 nil
- (apply-partially #'message "First one!")))))))))
+ (when (or (eq real-this-command
#'objed-current-or-previous-context)
+ (eq real-this-command #'objed-prev-identifier))
+ (run-at-time 0 nil (apply-partially #'message "First
one!")))))))))
(objed-define-object nil section
diff --git a/objed.el b/objed.el
index 95de977..547087c 100644
--- a/objed.el
+++ b/objed.el
@@ -362,6 +362,8 @@ See also `objed-disabled-p'"
(org-previous-visible-heading . section)
(comint-previous-prompt . output)
(comint-next-prompt . output)
+ (objed-next-identifier . identifier)
+ (objed-prev-identifier . identifier)
;; editing entry commands
(delete-char . char)
(kill-line . char)
@@ -642,7 +644,7 @@ object as an argument."
;; common emacs keys
(define-key map (kbd "C-g") 'objed-quit)
(define-key map "g" 'objed-quit)
- (define-key map (kbd "C-h") 'objed-show-top-level)
+ (define-key map (kbd "?") 'objed-show-top-level)
;; TODO: support repeated invokation
(define-key map (kbd "C-u") 'universal-argument)
(define-key map (kbd "C-SPC") 'set-mark-command)
- [elpa] externals/objed 8c3ba86 040/216: Add note about changing bindings, (continued)
- [elpa] externals/objed 8c3ba86 040/216: Add note about changing bindings, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 95503ca 046/216: Fix syntax object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 7ad08e2 052/216: Set C-h to work as usual, Stefan Monnier, 2019/01/08
- [elpa] externals/objed dc8c569 033/216: Improve surround op, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 1f09072 064/216: Improve file object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 96c6b8f 065/216: Add DEL key for in buffer replacement, fixes #6, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 41be963 054/216: Adjust textblock and block object order, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 843d843 059/216: Remove textblock from context objects, Stefan Monnier, 2019/01/08
- [elpa] externals/objed de241e3 048/216: Start to support mc, Stefan Monnier, 2019/01/08
- [elpa] externals/objed ebad1ac 061/216: Fix face object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 042c3bb 051/216: Change some bindings,
Stefan Monnier <=
- [elpa] externals/objed f605604 057/216: Rename syntax object to face object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed e94dc45 049/216: Remove :get-inner, Stefan Monnier, 2019/01/08
- [elpa] externals/objed ad88f19 074/216: Fix markup!!!, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 37449f5 063/216: Update link, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 975a8f3 082/216: Rewording, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 4badbe8 047/216: Simplify object macro usage (allow to use bounds of thing etc.), Stefan Monnier, 2019/01/08
- [elpa] externals/objed fc0da6e 079/216: Don't produce messages for tests, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 809c834 072/216: Fix markup, Stefan Monnier, 2019/01/08
- [elpa] externals/objed cd7c738 053/216: Undo C-h remapping, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 45eb117 087/216: Add alternative bindings, Stefan Monnier, 2019/01/08