Permalink
Browse files

lispy-pkg.el: Depend on zoutline

  • Loading branch information...
1 parent 7f27422 commit 2360ae987f8c7a10bfbd716592982777bf6745b3 @abo-abo committed Sep 6, 2016
Showing with 7 additions and 108 deletions.
  1. +2 −1 Cask
  2. +3 −2 lispy-pkg.el
  3. +2 −1 targets/install-deps.el
  4. +0 −104 zoutline.el
View
@@ -17,4 +17,5 @@
(depends-on "swiper")
(depends-on "hydra")
(depends-on "ace-window")
- (depends-on "undercover"))
+ (depends-on "undercover")
+ (depends-on "zoutline"))
View
@@ -1,7 +1,8 @@
-(define-package "lispy" "0.24.0"
+(define-package "lispy" "0.26.1"
"vi-like Paredit"
'((emacs "24.1")
(ace-window "0.9.0")
(iedit "0.9.9")
(swiper "0.7.0")
- (hydra "0.13.4")))
+ (hydra "0.13.4")
+ (zoutline "0.1.0")))
@@ -21,7 +21,8 @@
helm
projectile
find-file-in-project
- undercover))
+ undercover
+ zoutline))
(dolist (package lispy-dev-packages)
(unless (package-installed-p package)
View
@@ -1,104 +0,0 @@
-;;; zoutline.el --- Simple outline interface. -*- lexical-binding: t -*-
-
-;; Copyright (C) 2016 Oleh Krehel
-
-;; This file is not part of GNU Emacs
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-
-(require 'outline)
-
-(defun zo-up (arg)
- "Move ARG times up by outline."
- (interactive "p")
- (let ((i 0)
- out)
- (ignore-errors
- (while (<= (cl-incf i) arg)
- (outline-backward-same-level 1)
- t
- (setq out t)))
- out))
-
-(defun zo-down (arg)
- "Move ARG times down by outline.
-Return the amount of times moved.
-Return nil if moved 0 times."
- (interactive "p")
- (let ((pt 0)
- (i 0)
- (outline-ok t))
- (while (and outline-ok
- (<= (cl-incf i) arg)
- (> (point) pt))
- (setq pt (point))
- (condition-case nil
- (outline-forward-same-level 1)
- (error (setq outline-ok nil))))
- (cl-decf i)
- (unless (= 0 i)
- i)))
-
-(defvar zo-lvl-re [nil
- "\n\\* "
- "\n\\*\\{2\\} "
- "\n\\*\\{3\\} "
- "\n\\*\\{4\\} "
- "\n\\*\\{5\\} "
- "\n\\*\\{6\\} "
- "\n\\*\\{7\\} "])
-
-(defun zo-down-visible (&optional arg)
- "Move ARG times down by outline."
- (interactive "p")
- (setq arg (or arg 1))
- (let ((lvl (org-outline-level))
- res)
- (if (= lvl 1)
- (re-search-forward (aref zo-lvl-re lvl) nil t arg)
- (let ((end (save-excursion
- (or (re-search-forward (aref zo-lvl-re (1- lvl)) nil t)
- (point-max)))))
- (when (setq res (re-search-forward (aref zo-lvl-re lvl) end t arg))
- (reveal-post-command))))
- (when res
- (beginning-of-line)
- (point))))
-
-(defun zo-left (arg)
- (outline-up-heading arg))
-
-(defun zo-right-once ()
- (let ((pt (point))
- (lvl-1 (funcall outline-level))
- lvl-2)
- (if (outline-next-heading)
- (progn
- (setq lvl-2 (funcall outline-level))
- (if (> lvl-2 lvl-1)
- (progn
- (goto-char pt)
- nil)
- 1))
- (goto-char pt)
- nil)))
-
-(defun zo-right (arg)
- (let ((i 0))
- (while (and (< i arg)
- (zo-right-once))
- (cl-incf i))
- i))
-
-(provide 'zoutline)

0 comments on commit 2360ae9

Please sign in to comment.