(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)
(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
(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