44
55;; Author: Oleh Krehel <
[email protected] >
66;; URL: https://github.com/abo-abo/lispy
7- ;; Version: 0.20 .0
7+ ;; Version: 0.21 .0
88;; Keywords: lisp
99
1010;; This file is not part of GNU Emacs
5858;; To move the point into a special position, use:
5959;; "]" - calls `lispy-forward'
6060;; "[" - calls `lispy-backward'
61- ;; "C-3" - calls `lispy-out-forward ' (exit current list forwards)
62- ;; ")" - calls `lispy-out-forward -nostring' (exit current list
61+ ;; "C-3" - calls `lispy-right ' (exit current list forwards)
62+ ;; ")" - calls `lispy-right -nostring' (exit current list
6363;; forwards, but self-insert in strings and comments)
6464;;
6565;; These are the few Lispy commands that don't care whether the point
@@ -414,7 +414,7 @@ Use the command `%s' to change this variable."
414414(defun lispy-forward (arg)
415415 "Move forward list ARG times or until error.
416416Return t if moved at least once,
417- otherwise call `lispy-out-forward ' and return nil."
417+ otherwise call `lispy-right ' and return nil."
418418 (interactive "p")
419419 (when (= arg 0)
420420 (setq arg 2000))
@@ -467,7 +467,7 @@ If couldn't move backward at least once, move up backward and return nil."
467467 (backward-list))
468468 (point))))
469469
470- (defun lispy-out-forward (arg)
470+ (defun lispy-right (arg)
471471 "Move outside list forwards ARG times.
472472Return nil on failure, t otherwise."
473473 (interactive "p")
@@ -483,7 +483,14 @@ Return nil on failure, t otherwise."
483483 (t
484484 (lispy--out-forward arg))))
485485
486- (defun lispy-out-forward-nostring (arg)
486+ (define-obsolete-function-alias 'lispy-out-forward
487+ 'lispy-right "0.21.0")
488+ (define-obsolete-function-alias 'lispy-out-backward
489+ 'lispy-left "0.21.0")
490+ (define-obsolete-function-alias 'lispy-out-forward-nostring
491+ 'lispy-right-nostring "0.21.0")
492+
493+ (defun lispy-right-nostring (arg)
487494 "Call `lispy--out-forward' with ARG unless in string or comment.
488495Self-insert otherwise."
489496 (interactive "p")
@@ -493,9 +500,9 @@ Self-insert otherwise."
493500 (lispy--out-forward arg)))
494501
495502(defvar lispy-pre-outline-pos 1
496- "Point position before moving to outline with `lispy-out-backward '.")
503+ "Point position before moving to outline with `lispy-left '.")
497504
498- (defun lispy-out-backward (arg)
505+ (defun lispy-left (arg)
499506 "Move outside list forwards ARG times.
500507Return nil on failure, t otherwise."
501508 (interactive "p")
@@ -842,7 +849,7 @@ Return nil if can't move."
842849 (delete-char arg))
843850
844851 ((looking-at lispy-right)
845- (lispy-out-backward 1))
852+ (lispy-left 1))
846853
847854 ((looking-at lispy-left)
848855 (when (looking-back "\\(?:\\s-\\|^\\)[`',@]+")
@@ -1400,7 +1407,7 @@ to all the functions, while maintaining the parens in a pretty state."
14001407 ((looking-back lispy-right))
14011408 ((looking-at lispy-right)
14021409 (when (looking-back " ")
1403- (lispy-out-forward 1)))
1410+ (lispy-right 1)))
14041411 ((looking-at lispy-left)
14051412 (lispy-different))
14061413 ((looking-back "^ +")
@@ -1838,7 +1845,7 @@ When ARG is more than 1, pull ARGth expression to enclose current sexp."
18381845 (lispy-different)
18391846 (setq beg (point))
18401847 (setq end (lispy--out-forward arg))
1841- (lispy-out-forward 1)
1848+ (lispy-right 1)
18421849 (lispy--swap-regions (cons beg end)
18431850 (cons (point) (point)))
18441851 (lispy--reindent (1+ arg))))
@@ -1883,7 +1890,7 @@ When ARG is more than 1, pull ARGth expression to enclose current sexp."
18831890 (delete-char 1)
18841891 (lispy-save-excursion
18851892 (forward-char 1)
1886- (lispy-out-backward 2)
1893+ (lispy-left 2)
18871894 (lispy--normalize-1))))
18881895 ((and (setq bnd (lispy--bounds-string))
18891896 (or (save-excursion
@@ -1917,7 +1924,7 @@ When ARG is more than 1, pull ARGth expression to enclose current sexp."
19171924 (lispy--out-forward 1))
19181925 (insert ")(")
19191926 (backward-char 2)
1920- (lispy-out-forward 1))
1927+ (lispy-right 1))
19211928 (newline-and-indent)
19221929 (when (looking-at lispy-left)
19231930 (indent-sexp))))))
@@ -2845,7 +2852,7 @@ With ARG, use the contents of `lispy-store-region-and-buffer' instead."
28452852 (if (looking-back lispy-right)
28462853 (progn (backward-list)
28472854 nil)
2848- (lispy-out-backward 1))))
2855+ (lispy-left 1))))
28492856 (bnd (lispy--bounds-list))
28502857 (str (lispy--string-dwim bnd))
28512858 (expr (lispy--read str))
@@ -2911,7 +2918,7 @@ With ARG, use the contents of `lispy-store-region-and-buffer' instead."
29112918 (lispy-move-down 1)
29122919 (iedit-mode)
29132920 (deactivate-mark)
2914- (lispy-out-backward 1)
2921+ (lispy-left 1)
29152922 (lispy-delete 1)
29162923 (save-excursion
29172924 (lispy--out-backward 1)
@@ -3076,7 +3083,7 @@ Second region and buffer are the current ones."
30763083 (interactive)
30773084 (if (bound-and-true-p edebug-active)
30783085 (save-excursion
3079- (lispy-out-backward 99)
3086+ (lispy-left 99)
30803087 (if (looking-at
30813088 "(\\(?:cl\\|\\)def\\(?:un\\|macro\\)\\s-+\\_<[^ ]+\\_>\\s-+(")
30823089 (progn
@@ -3549,7 +3556,7 @@ First, try to return `lispy--bounds-string'."
35493556
35503557;;* Utilities: movement
35513558(defvar lispy-ignore-whitespace nil
3552- "When set to t, `lispy-out-forward ' will not clean up whitespace.")
3559+ "When set to t, `lispy-right ' will not clean up whitespace.")
35533560
35543561(defun lispy--out-forward (arg)
35553562 "Move outside list forwards ARG times.
@@ -5225,7 +5232,7 @@ FUNC is obtained from (`lispy--insert-or-call' DEF PLIST)"
52255232 ;; ——— globals: navigation ——————————————————
52265233 (define-key map (kbd "]") 'lispy-forward)
52275234 (define-key map (kbd "[") 'lispy-backward)
5228- (define-key map (kbd ")") 'lispy-out-forward -nostring)
5235+ (define-key map (kbd ")") 'lispy-right -nostring)
52295236 ;; ——— globals: kill-related ————————————————
52305237 (define-key map (kbd "C-k") 'lispy-kill)
52315238 (define-key map (kbd "C-y") 'lispy-yank)
@@ -5257,7 +5264,7 @@ FUNC is obtained from (`lispy--insert-or-call' DEF PLIST)"
52575264 (when lispy-use-ctrl-digits
52585265 (define-key map (kbd "C-1") 'lispy-describe-inline)
52595266 (define-key map (kbd "C-2") 'lispy-arglist-inline)
5260- (define-key map (kbd "C-3") 'lispy-out-forward )
5267+ (define-key map (kbd "C-3") 'lispy-right )
52615268 (define-key map (kbd "C-4") lispy-mode-x-map)
52625269 (define-key map (kbd "C-7") 'lispy-cursor-down)
52635270 (define-key map (kbd "C-8") 'lispy-parens-down)
@@ -5271,8 +5278,8 @@ FUNC is obtained from (`lispy--insert-or-call' DEF PLIST)"
52715278 (define-key map (kbd "M-q") 'lispy-fill)
52725279 (define-key map (kbd "<backtab>") 'lispy-shifttab)
52735280 ;; ——— locals: navigation ———————————————————
5274- (lispy-define-key map "l" 'lispy-out-forward )
5275- (lispy-define-key map "h" 'lispy-out-backward )
5281+ (lispy-define-key map "l" 'lispy-right )
5282+ (lispy-define-key map "h" 'lispy-left )
52765283 (lispy-define-key map "f" 'lispy-flow)
52775284 (lispy-define-key map "j" 'lispy-down)
52785285 (lispy-define-key map "k" 'lispy-up)
0 commit comments