4
4
5
5
;; Author: Oleh Krehel <ohwoeowho@gmail.com>
6
6
;; URL: https://github.com/abo-abo/lispy
7
- ;; Version: 0.20 .0
7
+ ;; Version: 0.21 .0
8
8
;; Keywords: lisp
9
9
10
10
;; This file is not part of GNU Emacs
58
58
;; To move the point into a special position, use:
59
59
;; "]" - calls `lispy-forward'
60
60
;; "[" - 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
63
63
;; forwards, but self-insert in strings and comments)
64
64
;;
65
65
;; 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."
414
414
(defun lispy-forward (arg)
415
415
"Move forward list ARG times or until error.
416
416
Return t if moved at least once,
417
- otherwise call `lispy-out-forward ' and return nil."
417
+ otherwise call `lispy-right ' and return nil."
418
418
(interactive "p")
419
419
(when (= arg 0)
420
420
(setq arg 2000))
@@ -467,7 +467,7 @@ If couldn't move backward at least once, move up backward and return nil."
467
467
(backward-list))
468
468
(point))))
469
469
470
- (defun lispy-out-forward (arg)
470
+ (defun lispy-right (arg)
471
471
"Move outside list forwards ARG times.
472
472
Return nil on failure, t otherwise."
473
473
(interactive "p")
@@ -483,7 +483,14 @@ Return nil on failure, t otherwise."
483
483
(t
484
484
(lispy--out-forward arg))))
485
485
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)
487
494
"Call `lispy--out-forward' with ARG unless in string or comment.
488
495
Self-insert otherwise."
489
496
(interactive "p")
@@ -493,9 +500,9 @@ Self-insert otherwise."
493
500
(lispy--out-forward arg)))
494
501
495
502
(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 '.")
497
504
498
- (defun lispy-out-backward (arg)
505
+ (defun lispy-left (arg)
499
506
"Move outside list forwards ARG times.
500
507
Return nil on failure, t otherwise."
501
508
(interactive "p")
@@ -842,7 +849,7 @@ Return nil if can't move."
842
849
(delete-char arg))
843
850
844
851
((looking-at lispy-right)
845
- (lispy-out-backward 1))
852
+ (lispy-left 1))
846
853
847
854
((looking-at lispy-left)
848
855
(when (looking-back "\\(?:\\s-\\|^\\)[`',@]+")
@@ -1400,7 +1407,7 @@ to all the functions, while maintaining the parens in a pretty state."
1400
1407
((looking-back lispy-right))
1401
1408
((looking-at lispy-right)
1402
1409
(when (looking-back " ")
1403
- (lispy-out-forward 1)))
1410
+ (lispy-right 1)))
1404
1411
((looking-at lispy-left)
1405
1412
(lispy-different))
1406
1413
((looking-back "^ +")
@@ -1838,7 +1845,7 @@ When ARG is more than 1, pull ARGth expression to enclose current sexp."
1838
1845
(lispy-different)
1839
1846
(setq beg (point))
1840
1847
(setq end (lispy--out-forward arg))
1841
- (lispy-out-forward 1)
1848
+ (lispy-right 1)
1842
1849
(lispy--swap-regions (cons beg end)
1843
1850
(cons (point) (point)))
1844
1851
(lispy--reindent (1+ arg))))
@@ -1883,7 +1890,7 @@ When ARG is more than 1, pull ARGth expression to enclose current sexp."
1883
1890
(delete-char 1)
1884
1891
(lispy-save-excursion
1885
1892
(forward-char 1)
1886
- (lispy-out-backward 2)
1893
+ (lispy-left 2)
1887
1894
(lispy--normalize-1))))
1888
1895
((and (setq bnd (lispy--bounds-string))
1889
1896
(or (save-excursion
@@ -1917,7 +1924,7 @@ When ARG is more than 1, pull ARGth expression to enclose current sexp."
1917
1924
(lispy--out-forward 1))
1918
1925
(insert ")(")
1919
1926
(backward-char 2)
1920
- (lispy-out-forward 1))
1927
+ (lispy-right 1))
1921
1928
(newline-and-indent)
1922
1929
(when (looking-at lispy-left)
1923
1930
(indent-sexp))))))
@@ -2845,7 +2852,7 @@ With ARG, use the contents of `lispy-store-region-and-buffer' instead."
2845
2852
(if (looking-back lispy-right)
2846
2853
(progn (backward-list)
2847
2854
nil)
2848
- (lispy-out-backward 1))))
2855
+ (lispy-left 1))))
2849
2856
(bnd (lispy--bounds-list))
2850
2857
(str (lispy--string-dwim bnd))
2851
2858
(expr (lispy--read str))
@@ -2911,7 +2918,7 @@ With ARG, use the contents of `lispy-store-region-and-buffer' instead."
2911
2918
(lispy-move-down 1)
2912
2919
(iedit-mode)
2913
2920
(deactivate-mark)
2914
- (lispy-out-backward 1)
2921
+ (lispy-left 1)
2915
2922
(lispy-delete 1)
2916
2923
(save-excursion
2917
2924
(lispy--out-backward 1)
@@ -3076,7 +3083,7 @@ Second region and buffer are the current ones."
3076
3083
(interactive)
3077
3084
(if (bound-and-true-p edebug-active)
3078
3085
(save-excursion
3079
- (lispy-out-backward 99)
3086
+ (lispy-left 99)
3080
3087
(if (looking-at
3081
3088
"(\\(?:cl\\|\\)def\\(?:un\\|macro\\)\\s-+\\_<[^ ]+\\_>\\s-+(")
3082
3089
(progn
@@ -3549,7 +3556,7 @@ First, try to return `lispy--bounds-string'."
3549
3556
3550
3557
;;* Utilities: movement
3551
3558
(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.")
3553
3560
3554
3561
(defun lispy--out-forward (arg)
3555
3562
"Move outside list forwards ARG times.
@@ -5225,7 +5232,7 @@ FUNC is obtained from (`lispy--insert-or-call' DEF PLIST)"
5225
5232
;; ——— globals: navigation ——————————————————
5226
5233
(define-key map (kbd "]") 'lispy-forward)
5227
5234
(define-key map (kbd "[") 'lispy-backward)
5228
- (define-key map (kbd ")") 'lispy-out-forward -nostring)
5235
+ (define-key map (kbd ")") 'lispy-right -nostring)
5229
5236
;; ——— globals: kill-related ————————————————
5230
5237
(define-key map (kbd "C-k") 'lispy-kill)
5231
5238
(define-key map (kbd "C-y") 'lispy-yank)
@@ -5257,7 +5264,7 @@ FUNC is obtained from (`lispy--insert-or-call' DEF PLIST)"
5257
5264
(when lispy-use-ctrl-digits
5258
5265
(define-key map (kbd "C-1") 'lispy-describe-inline)
5259
5266
(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 )
5261
5268
(define-key map (kbd "C-4") lispy-mode-x-map)
5262
5269
(define-key map (kbd "C-7") 'lispy-cursor-down)
5263
5270
(define-key map (kbd "C-8") 'lispy-parens-down)
@@ -5271,8 +5278,8 @@ FUNC is obtained from (`lispy--insert-or-call' DEF PLIST)"
5271
5278
(define-key map (kbd "M-q") 'lispy-fill)
5272
5279
(define-key map (kbd "<backtab>") 'lispy-shifttab)
5273
5280
;; ——— 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 )
5276
5283
(lispy-define-key map "f" 'lispy-flow)
5277
5284
(lispy-define-key map "j" 'lispy-down)
5278
5285
(lispy-define-key map "k" 'lispy-up)
0 commit comments