[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 315be36 31/67: counsel.el: Add
From: |
Oleh Krehel |
Subject: |
[elpa] master 315be36 31/67: counsel.el: Add |
Date: |
Sun, 22 Mar 2015 17:33:59 +0000 |
branch: master
commit 315be361d904e33e8a9693f423ac72711307ebbf
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el: Add
---
counsel.el | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/counsel.el b/counsel.el
new file mode 100644
index 0000000..ecb183b
--- /dev/null
+++ b/counsel.el
@@ -0,0 +1,54 @@
+;;; consel.el --- Elisp completion at point -*- lexical-binding: t -*-
+
+;; Copyright (C) 2015 Oleh Krehel
+
+;; Author: Oleh Krehel <address@hidden>
+;; URL: https://github.com/abo-abo/swiper
+;; Version: 0.1.0
+;; Package-Requires: ((emacs "24.1"))
+;; Keywords: completion
+
+;; 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/>.
+
+;;; Commentary:
+;;
+;; Just call `counsel' to start completing the `obarray'.
+;; The initial (optional) input is thing-at-point.
+
+;;; Code:
+
+(require 'ivy)
+
+(defun counsel ()
+ "Elisp completion at point."
+ (interactive)
+ (let* ((bnd (bounds-of-thing-at-point 'symbol))
+ (str (if bnd
+ (buffer-substring-no-properties
+ (car bnd) (cdr bnd))
+ ""))
+ (candidates (all-completions str obarray))
+ (ivy-height 7)
+ (res (ivy-read (format "pattern (%s): " str)
+ candidates)))
+ (when (stringp res)
+ (when bnd
+ (delete-region (car bnd) (cdr bnd)))
+ (insert res))))
+
+(provide 'counsel)
+
+;;; counsel.el ends here
- [elpa] master f268cc8 21/67: Reveal invisible overlays, (continued)
- [elpa] master f268cc8 21/67: Reveal invisible overlays, Oleh Krehel, 2015/03/22
- [elpa] master 835208a 20/67: Inherit standard faces by default, Oleh Krehel, 2015/03/22
- [elpa] master f148a94 24/67: Fix use of cl-incf, Oleh Krehel, 2015/03/22
- [elpa] master 2ed9ee2 23/67: Require delsel for `minibuffer-keyboard-quit', Oleh Krehel, 2015/03/22
- [elpa] master 1ca1660 22/67: swiper.el: Save position before last search, Oleh Krehel, 2015/03/22
- [elpa] master 02ca7a1 25/67: Add anchoring, Oleh Krehel, 2015/03/22
- [elpa] master b1ac649 26/67: Don't recenter unless necessary, Oleh Krehel, 2015/03/22
- [elpa] master a07c2e4 27/67: swiper.el: Make ivy the default back end, Oleh Krehel, 2015/03/22
- [elpa] master baa9df7 30/67: Truncate candidates to window width in the minibuffer, Oleh Krehel, 2015/03/22
- [elpa] master 7c6d00d 32/67: ivy.el (ivy-read): Return immediately for less than 2 candidates, Oleh Krehel, 2015/03/22
- [elpa] master 315be36 31/67: counsel.el: Add,
Oleh Krehel <=
- [elpa] master 0772929 29/67: Add some rudimentary history handling, Oleh Krehel, 2015/03/22
- [elpa] master 045fb60 28/67: ivy.el (ivy-previous-line): Change to `cl-decf', Oleh Krehel, 2015/03/22
- [elpa] master e1cdb29 37/67: counsel.el: Add Clojure completion at point, Oleh Krehel, 2015/03/22
- [elpa] master 7ff3dd9 35/67: Need to check value of variable, Oleh Krehel, 2015/03/22
- [elpa] master c78cc15 34/67: swiper.el: Clean up overlays better on "C-g", Oleh Krehel, 2015/03/22
- [elpa] master e7b560c 38/67: swiper.el (swiper--opoint): Fix bad defvar, Oleh Krehel, 2015/03/22
- [elpa] master d78caee 33/67: Open invisible overlays using isearch, Oleh Krehel, 2015/03/22
- [elpa] master 8818a01 36/67: swiper.el: Fix error for empty buffer, Oleh Krehel, 2015/03/22
- [elpa] master 984346c 40/67: swiper.el (swiper-font-lock-ensure): Exclude a few modes, Oleh Krehel, 2015/03/22
- [elpa] master cb26121 41/67: ivy.el: Fix ivy-history recording the full text instead of input, Oleh Krehel, 2015/03/22