[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed 49e36fd 123/216: Change back to indentation behav
From: |
Stefan Monnier |
Subject: |
[elpa] externals/objed 49e36fd 123/216: Change back to indentation behavior |
Date: |
Tue, 8 Jan 2019 12:29:24 -0500 (EST) |
branch: externals/objed
commit 49e36fd916a6fe28db47a861a9351e79523331bd
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>
Change back to indentation behavior
---
objed.el | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/objed.el b/objed.el
index 884af42..70e1d37 100644
--- a/objed.el
+++ b/objed.el
@@ -301,7 +301,9 @@ See also `objed-disabled-p'"
(backward-sexp sexp defun bracket string symbol word)
(indent-pp-sexp bracket sexp)
;; just use inner line?
- (back-to-indentation section defun bracket string line)
+ ;; TODO: on second press check all these:
+ ;;section defun bracket string line)
+ (back-to-indentation . (line . inner))
(org-beginning-of-line . line)
(org-end-of-line . line)
(backward-sentence . sentence)
@@ -335,8 +337,10 @@ See also `objed-disabled-p'"
"Entry commands and associated objects.
If the `cdr' of an entry is a list, each of the objects in this
-list is tried and the first that matches will be used for
-initialization."
+list is tried and the first that matches (:atp returns non-nil)
+will be used for initialization. If the `cdr' is a cons cell use
+the `cdr' of it as initial object state which defaults to `whole'
+otherwise."
:group 'objed
:type '(alist :key-type sexp
:value-type (choice sexp
@@ -488,6 +492,7 @@ exit function is called after execution of the operation.")
(defvar objed--after-init-alist
'((move-end-of-line . objed--object-trailing-line)
(org-end-of-line . objed--object-trailing-line)
+ (back-to-indentation . objed--until-start)
(beginning-of-buffer . objed--until-start)
(end-of-buffer . objed--until-end)
(backward-sentence . objed--goto-start))
@@ -614,9 +619,16 @@ update to given object."
"Guess which object to use.
CMD is the command for which object should be guessed. Returns
-the guessed object."
- (let ((c (cdr (assq cmd objed-cmd-alist))))
- (if (consp c) (objed--at-p c) c)))
+cons of guessed object and its state."
+ (let ((c (cdr (assq cmd objed-cmd-alist)))
+ (o nil))
+ (cond ((consp c)
+ (if (symbolp (cdr c))
+ c
+ (when (setq o (objed--at-p c))
+ (cons o 'whole))))
+ (c
+ (cons c 'whole)))))
;; * Keymaps
@@ -1175,9 +1187,9 @@ SYM is a symbol (command or object symbol) used to
initialize."
(if (commandp sym)
(let* ((objed--block-p t)
(initf (cdr (assq sym objed--after-init-alist)))
- (o (objed--get-object-for-cmd sym)))
- (when o
- (objed--switch-to o))
+ (os (objed--get-object-for-cmd sym)))
+ (when os
+ (objed--switch-to (car os) (cdr os)))
(when initf (funcall initf objed--opoint)))
(objed--switch-to sym))
- [elpa] externals/objed a2df7ab 075/216: Stay active when using describe key in modal state, (continued)
- [elpa] externals/objed a2df7ab 075/216: Stay active when using describe key in modal state, Stefan Monnier, 2019/01/08
- [elpa] externals/objed b7fbf71 106/216: Fixes #12, collect no-skipping objects correctly, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 29bccb0 042/216: Whitespace cleanup, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 2e1e5c1 110/216: Run compilation as part of make test, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 433e92d 104/216: Block objed advices in object body codes, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 79ec8af 116/216: Fix boundary error, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 5a1c9f7 122/216: Improve char switching with objec-ace, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 38887bb 107/216: Adjust textblock object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed fc11d2b 119/216: Fix skipping ws if point is after the object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed d50117d 114/216: Fix kill-op error, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 49e36fd 123/216: Change back to indentation behavior,
Stefan Monnier <=
- [elpa] externals/objed ce608d8 115/216: Add symbol object back, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 051028c 129/216: Fix init for entry commands which use after-init-alist, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 4b21416 112/216: Fix endless textblock search, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 703d634 131/216: Move some op bindings to more emacsy bindings, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 92fd6e7 135/216: Fix marking instances in objects not surrounding point, Stefan Monnier, 2019/01/08
- [elpa] externals/objed b9866d6 101/216: Fix undo op behavior, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 0e1d041 105/216: Simplify object macro usage, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 69db302 126/216: Some mroe init changes, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 0c5a4e3 147/216: Version bump, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 7617799 136/216: Allow testing different emacs versions, Stefan Monnier, 2019/01/08