[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9db8308 103/272: counsel.el: Organize the file with outlin
From: |
Oleh Krehel |
Subject: |
[elpa] master 9db8308 103/272: counsel.el: Organize the file with outlines |
Date: |
Mon, 25 Apr 2016 10:13:19 +0000 |
branch: master
commit 9db8308c2b2fe9c6a5e4ba673a226df591c0a4a5
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el: Organize the file with outlines
---
counsel.el | 81 +++++++++++++++++++++++++++++++++---------------------------
1 file changed, 45 insertions(+), 36 deletions(-)
diff --git a/counsel.el b/counsel.el
index 4432b61..b3549b1 100644
--- a/counsel.el
+++ b/counsel.el
@@ -4,7 +4,6 @@
;; Author: Oleh Krehel <address@hidden>
;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.1.0
;; Package-Requires: ((emacs "24.1") (swiper "0.4.0"))
;; Keywords: completion, matching
@@ -35,6 +34,8 @@
(require 'swiper)
(require 'etags)
+;;* Completion at point
+;;** Elisp
;;;###autoload
(defun counsel-el ()
"Elisp completion at point."
@@ -76,6 +77,7 @@
:initial-input str
:action #'ivy-completion-in-region-action)))
+;;** Common Lisp
(declare-function slime-symbol-start-pos "ext:slime")
(declare-function slime-symbol-end-pos "ext:slime")
(declare-function slime-contextual-completions "ext:slime-c-p-c")
@@ -92,6 +94,7 @@
ivy-completion-end))
:action #'ivy-completion-in-region-action))
+;;** Python
(declare-function deferred:sync! "ext:deferred")
(declare-function jedi:complete-request "ext:jedi-core")
(declare-function jedi:ac-direct-matches "ext:jedi")
@@ -130,6 +133,44 @@
(move-marker (make-marker) (point)))
(backward-char 1)))))
+;;** Clojure
+(declare-function cider-sync-request:complete "ext:cider-client")
+;;;###autoload
+(defun counsel-clj ()
+ "Clojure completion at point."
+ (interactive)
+ (counsel--generic
+ (lambda (str)
+ (mapcar
+ #'cl-caddr
+ (cider-sync-request:complete str ":same")))))
+
+;;** Unicode
+(defvar counsel-unicode-char-history nil
+ "History for `counsel-unicode-char'.")
+
+;;;###autoload
+(defun counsel-unicode-char ()
+ "Insert a Unicode character at point."
+ (interactive)
+ (let ((minibuffer-allow-text-properties t))
+ (setq ivy-completion-beg (point))
+ (setq ivy-completion-end (point))
+ (ivy-read "Unicode name: "
+ (mapcar (lambda (x)
+ (propertize
+ (format "% -6X% -60s%c" (cdr x) (car x) (cdr x))
+ 'result (cdr x)))
+ (ucs-names))
+ :action (lambda (char)
+ (with-ivy-window
+ (delete-region ivy-completion-beg ivy-completion-end)
+ (setq ivy-completion-beg (point))
+ (insert-char (get-text-property 0 'result char))
+ (setq ivy-completion-end (point))))
+ :history 'counsel-unicode-char-history)))
+
+;;* Describe symbol variants
(defvar counsel-describe-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-.") #'counsel-find-symbol)
@@ -277,41 +318,8 @@
(require 'info-look)
(info-lookup 'symbol symbol mode))
-(defvar counsel-unicode-char-history nil
- "History for `counsel-unicode-char'.")
-
-;;;###autoload
-(defun counsel-unicode-char ()
- "Insert a Unicode character at point."
- (interactive)
- (let ((minibuffer-allow-text-properties t))
- (setq ivy-completion-beg (point))
- (setq ivy-completion-end (point))
- (ivy-read "Unicode name: "
- (mapcar (lambda (x)
- (propertize
- (format "% -6X% -60s%c" (cdr x) (car x) (cdr x))
- 'result (cdr x)))
- (ucs-names))
- :action (lambda (char)
- (with-ivy-window
- (delete-region ivy-completion-beg ivy-completion-end)
- (setq ivy-completion-beg (point))
- (insert-char (get-text-property 0 'result char))
- (setq ivy-completion-end (point))))
- :history 'counsel-unicode-char-history)))
-
-(declare-function cider-sync-request:complete "ext:cider-client")
-;;;###autoload
-(defun counsel-clj ()
- "Clojure completion at point."
- (interactive)
- (counsel--generic
- (lambda (str)
- (mapcar
- #'cl-caddr
- (cider-sync-request:complete str ":same")))))
-
+;;* Git completion
+;;** Find file in git project
(defvar counsel--git-dir nil
"Store the base git directory.")
@@ -336,6 +344,7 @@
(let ((default-directory counsel--git-dir))
(find-file x))))
+;;** Grep for a line in git project
(defvar counsel--git-grep-dir nil
"Store the base git directory.")
- [elpa] master 26c8246 131/272: counsel.el (counsel-recoll): add unwind, (continued)
- [elpa] master 26c8246 131/272: counsel.el (counsel-recoll): add unwind, Oleh Krehel, 2016/04/25
- [elpa] master 87da3a2 132/272: counsel.el (counsel-async-split-string-re): New defvar, Oleh Krehel, 2016/04/25
- [elpa] master 9ffa9c7 121/272: ivy.el (ivy--regex): Don't consider \\(?...\) a group, Oleh Krehel, 2016/04/25
- [elpa] master 71bb1c0 144/272: ivy.el (ivy-alt-done): Simplify, Oleh Krehel, 2016/04/25
- [elpa] master e12ff84 125/272: counsel.el (counsel-list-processes-action-switch): Improve, Oleh Krehel, 2016/04/25
- [elpa] master 1737ced 064/272: ivy.el (ivy-inhibit-action): New variable, Oleh Krehel, 2016/04/25
- [elpa] master 05a7b61 070/272: ivy.el (ivy--reset-state): Support a list of symbols as collection, Oleh Krehel, 2016/04/25
- [elpa] master 65ec32c 080/272: README.md: mention the manual more prominently, Oleh Krehel, 2016/04/25
- [elpa] master 4af5c2e 115/272: Add `counsel-locate-cmd-mdfind`, Oleh Krehel, 2016/04/25
- [elpa] master 022e658 090/272: When in prog-mode, "M-n" should wrap input with "\b", Oleh Krehel, 2016/04/25
- [elpa] master 9db8308 103/272: counsel.el: Organize the file with outlines,
Oleh Krehel <=
- [elpa] master 1c04fb8 126/272: Add ivy-fixed-height-minibuffer, Oleh Krehel, 2016/04/25
- [elpa] master 7a0b243 130/272: Give ivy-read-read-action enough minibuffer space, Oleh Krehel, 2016/04/25
- [elpa] master 708ca11 141/272: ivy.el: Fix a few face declarations, Oleh Krehel, 2016/04/25
- [elpa] master f647bca 136/272: Simplify the ivy-format-function interface, Oleh Krehel, 2016/04/25
- [elpa] master c2b330b 091/272: doc/ivy.org: Add @vindex and @kindex automatically, Oleh Krehel, 2016/04/25
- [elpa] master 4c99ec6 107/272: counsel.el: Shuffle functions, Oleh Krehel, 2016/04/25
- [elpa] master 0fd6a75 142/272: Move switch-to-buffer to :display-transformer-fn, Oleh Krehel, 2016/04/25
- [elpa] master f5a21db 157/272: ivy.el: define setq-local and defvar-local unless defined, Oleh Krehel, 2016/04/25
- [elpa] master 71644d9 190/272: ivy.el (ivy-read): Remove code that sets action index to 1, Oleh Krehel, 2016/04/25
- [elpa] master 220fd38 079/272: doc/ivy.org: Improve the markup, Oleh Krehel, 2016/04/25