[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed 5fbacd4 050/216: Cleanup
From: |
Stefan Monnier |
Subject: |
[elpa] externals/objed 5fbacd4 050/216: Cleanup |
Date: |
Tue, 8 Jan 2019 12:29:10 -0500 (EST) |
branch: externals/objed
commit 5fbacd42f1407c1411b417f568a2879eeda438f2
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>
Cleanup
---
objed-objects.el | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/objed-objects.el b/objed-objects.el
index e744a8e..453ac28 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -83,9 +83,10 @@ Code to run which returns object positions as a list of the
form:
The function `objed-make-object' can be used to create such a
list. For convenience it is also possible that the code returns a
cons cell of the bounds of object (like what the built-in
-`bounds-of-thing-at-point' return). If inner positions are
-omitted they are determined by `objed--inner-default'. If there
-is no object at point the code should return nil.
+`bounds-of-thing-at-point' variations return). If inner positions
+are omitted they are determined by `objed--inner-default'. If
+there is no object at point the code should return nil.
+
:try-next (optional)
@@ -95,6 +96,7 @@ the current one if any. This will called until :get-obj
returns
non-nil. To indicate that search needs to be stopped, throw an
error.
+
:try-prev (optional)
Code to run which moves point to the previous available object.
@@ -106,9 +108,10 @@ be stopped, throw an error.
:mode (optional)
Object defintions which don't use this keyword apply to all
-modes. If given it should be a symbol of a `major-mode'. The
-object defintion used for this object will then override the
-default one when in this mode."
+modes. If given it should be a symbol of a `major-mode'. Any
+keyword definitions used for this object will then override the
+default ones when in this mode. Keywords not used fallback to use
+the general definition."
(declare (indent 2))
(let* ((mode (plist-get args :mode))
(fname (if mode
@@ -157,6 +160,7 @@ default one when in this mode."
cbody))
(cond (mode
+ ;; catch all return arg if not present
(push `(t ,arg) cbody)
`(defun ,fname (,arg)
,doc
@@ -532,6 +536,7 @@ specific versions of object."
(overriding-terminal-local-map nil)
(res (objed--handle-query query objf)))
(if (keywordp res)
+ ;; basic inheritence...
(objed--object res obj t)
res)))
@@ -868,7 +873,7 @@ a cons cell."
(cons (region-beginning) (region-end)))))
(defun objed--inner-default (beg end)
- "Return positions for inner range at runtime.
+ "Return positions for inner range.
BEG and END are the positions of the whole object.
@@ -1377,9 +1382,6 @@ Ignores simple structured expressions like words or
symbols."
:get-obj
(objed-bounds-from-region-cmd #'mark-defun)
:try-next
- ;; does not work for adjacent toplevel parens in lisp becaus try
- ;; next is called after moving beyond the current one
- ;; (beginning-of-defun -1)
(beginning-of-defun -1)
:try-prev
(beginning-of-defun 1))
@@ -1838,10 +1840,10 @@ non-nil the indentation block can contain empty lines."
(forward-symbol -1)
'identifier
:try-next
+ ;; (beginning-of-defun -1) does not work for adjacent toplevel
+ ;; parens in lisp becaus try next is called after moving beyond the
(end-of-defun 1)
(beginning-of-defun 1)
- :try-prev
- (beginning-of-defun 1)
:get-obj
(let ((bounds (objed-bounds-from-region-cmd #'mark-defun)))
(when bounds
- [elpa] externals/objed 4badbe8 047/216: Simplify object macro usage (allow to use bounds of thing etc.), (continued)
- [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
- [elpa] externals/objed 1c7d142 086/216: Add more tests, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 8d6732e 094/216: Improve description, Stefan Monnier, 2019/01/08
- [elpa] externals/objed a090ada 056/216: Stop object search at buffer boundaries earlier, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 8764254 081/216: Add note about tests to contribute, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 3eb73e0 060/216: Adjust indent op and tab commands, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 5fbacd4 050/216: Cleanup,
Stefan Monnier <=
- [elpa] externals/objed 5f23c05 070/216: Fixup advice code, Stefan Monnier, 2019/01/08
- [elpa] externals/objed bd6a50c 092/216: Change bindings for surroundings, undo in region, Stefan Monnier, 2019/01/08
- [elpa] externals/objed aa8ba7b 093/216: Change DEL to behave as normal for char object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 21ca995 069/216: Cleanup malformed object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed d21fd72 073/216: Fix makup again, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 7c41d13 076/216: Fixup which-key paging commands, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 204ea88 095/216: Change surroundings binding, Stefan Monnier, 2019/01/08
- [elpa] externals/objed b54fa1a 077/216: Add more tests, Stefan Monnier, 2019/01/08
- [elpa] externals/objed deb059e 100/216: Update bindings, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 53cafee 085/216: Add new commands to move to first/last instance, Stefan Monnier, 2019/01/08