[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8212110 15/90: Handle symbol-at-point better in non-Elisp
From: |
Oleh Krehel |
Subject: |
[elpa] master 8212110 15/90: Handle symbol-at-point better in non-Elisp buffers |
Date: |
Tue, 30 Jun 2015 07:28:06 +0000 |
branch: master
commit 8212110101bd080481840dda027e8b007dfef9d2
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Handle symbol-at-point better in non-Elisp buffers
* counsel.el (counsel-symbol-at-point): New defun.
(counsel-describe-variable): Update.
(counsel-describe-function): Update.
Fixes #126
---
counsel.el | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/counsel.el b/counsel.el
index f27095e..6be445f 100644
--- a/counsel.el
+++ b/counsel.el
@@ -80,6 +80,14 @@
(defvar counsel-describe-symbol-history nil
"History for `counsel-describe-variable' and `counsel-describe-function'.")
+(defun counsel-symbol-at-point ()
+ "Return current symbol at point as a string."
+ (let ((s (thing-at-point 'symbol)))
+ (and (stringp s)
+ (if (string-match "\\'\\(.*\\)'\\'" s)
+ (match-string 1 s)
+ s))))
+
(defun counsel-describe-variable ()
"Forward to `describe-variable'."
(interactive)
@@ -94,7 +102,7 @@
(push (symbol-name vv) cands))))
cands)
:keymap counsel-describe-map
- :preselect (thing-at-point 'symbol)
+ :preselect (counsel-symbol-at-point)
:history 'counsel-describe-symbol-history
:require-match t
:sort t
@@ -114,7 +122,7 @@
(push (symbol-name x) cands))))
cands)
:keymap counsel-describe-map
- :preselect (thing-at-point 'symbol)
+ :preselect (counsel-symbol-at-point)
:history 'counsel-describe-symbol-history
:require-match t
:sort t
- [elpa] master 856e1bd 02/90: ivy.el (ivy-next-line): Fix wraparound at end of candidates, (continued)
- [elpa] master 856e1bd 02/90: ivy.el (ivy-next-line): Fix wraparound at end of candidates, Oleh Krehel, 2015/06/30
- [elpa] master 04b5734 03/90: swiper.el (swiper-avy): Don't start on empty input, Oleh Krehel, 2015/06/30
- [elpa] master 23ffd5c 04/90: swiper.el (swiper--ivy): Don't double-quote preselect, Oleh Krehel, 2015/06/30
- [elpa] master d975e1a 06/90: Avoid ensuring font lock when magit-blame-mode is active, Oleh Krehel, 2015/06/30
- [elpa] master 5fdb7de 05/90: Allow to open an Info file on the file system, Oleh Krehel, 2015/06/30
- [elpa] master f899a22 08/90: Add info lookup binding to counsel-describe-map, Oleh Krehel, 2015/06/30
- [elpa] master a0347d8 09/90: counsel.el (counsel-info-lookup-symbol): Add a require, Oleh Krehel, 2015/06/30
- [elpa] master 3256d68 07/90: Change the :matcher interface, Oleh Krehel, 2015/06/30
- [elpa] master 5f7c787 11/90: counsel.el (counsel-find-file-at-point): New defcustom, Oleh Krehel, 2015/06/30
- [elpa] master efd74b8 10/90: counsel.el (counsel-find-file): Extend `find-file', Oleh Krehel, 2015/06/30
- [elpa] master 8212110 15/90: Handle symbol-at-point better in non-Elisp buffers,
Oleh Krehel <=
- [elpa] master fe057eb 14/90: Swiper should preserve column for empty input, Oleh Krehel, 2015/06/30
- [elpa] master 1a193b0 16/90: ivy.el (ivy--done): Set ivy--current, Oleh Krehel, 2015/06/30
- [elpa] master 97abd3c 17/90: ivy.el (ivy-virtual): New defface, Oleh Krehel, 2015/06/30
- [elpa] master 3c8daba 19/90: Fixup compilation warnings, Oleh Krehel, 2015/06/30
- [elpa] master ecb93a6 18/90: Regexp-quote name of candidate buffer to be preselected, Oleh Krehel, 2015/06/30
- [elpa] master 40a938b 21/90: ivy.el (ivy-minibuffer-map): Bind ivy-yank-word to "M-j", Oleh Krehel, 2015/06/30
- [elpa] master 00a1b02 22/90: counsel-git-grep should quote strings better, Oleh Krehel, 2015/06/30
- [elpa] master 52a083e 13/90: ivy.el (ivy-yank-word): New command, Oleh Krehel, 2015/06/30
- [elpa] master 9ae55b4 12/90: ivy.el (ivy-recentf): New command, Oleh Krehel, 2015/06/30
- [elpa] master ed60d31 20/90: Make counsel-git-grep fully async, Oleh Krehel, 2015/06/30