branch: externals/objed commit fef16214800e6b8b2688d39643f29a00d2667126 Author: Clemens Radermacher <clem...@posteo.net> Commit: Clemens Radermacher <clem...@posteo.net>
Reorder few defuns by topic --- objed.el | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/objed.el b/objed.el index 95ed149..1f59b81 100644 --- a/objed.el +++ b/objed.el @@ -1802,6 +1802,34 @@ postitive prefix argument ARG move to the nth next object." (objed--update-current-object bot) (objed--goto-char (objed--beg))))))) +(defun objed-toggle-side () + "Move to other side of object. + +Default to sexp at point." + (interactive) + (if (use-region-p) + (exchange-point-and-mark) + (let ((sdiff (abs (- (point) (objed--beg)))) + (ediff (abs (- (point) (objed--end))))) + (cond ((> ediff sdiff) + (goto-char (objed--end))) + (t + (goto-char (objed--beg))))))) + +(defun objed-toggle-state () + "Toggle state of object." + (interactive) + (when (eq objed--object 'sexp) + (save-excursion + (objed-context-object))) + (let ((sdiff (abs (- (point) (objed--beg)))) + (ediff (abs (- (point) (objed--end))))) + (objed--reverse) + (goto-char (cond ((> ediff sdiff) + (objed--beg)) + (t + (objed--end)))))) + (defun objed-expand-context () "Expand to objects based on context. @@ -2028,19 +2056,6 @@ bindings." (objed--switch-to 'identifier) (goto-char (objed--beg)))) -(defun objed-toggle-side () - "Move to other side of object. - -Default to sexp at point." - (interactive) - (if (use-region-p) - (exchange-point-and-mark) - (let ((sdiff (abs (- (point) (objed--beg)))) - (ediff (abs (- (point) (objed--end))))) - (cond ((> ediff sdiff) - (goto-char (objed--end))) - (t - (goto-char (objed--beg))))))) (defun objed-exchange-point-and-mark () "Exchange point and mark. @@ -2057,21 +2072,6 @@ Update to object at current side." (objed--update-current-object))) -(defun objed-toggle-state () - "Toggle state of object." - (interactive) - (when (eq objed--object 'sexp) - (save-excursion - (objed-context-object))) - (let ((sdiff (abs (- (point) (objed--beg)))) - (ediff (abs (- (point) (objed--end))))) - (objed--reverse) - (goto-char (cond ((> ediff sdiff) - (objed--beg)) - (t - (objed--end)))))) - - (defvar objed--extend-cookie nil) (defun objed-extend ()