(error "Couldn't fild definition of %s"
sym))))))))
-(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))))
+(define-obsolete-function-alias 'counsel-symbol-at-point
+ 'ivy-thing-at-point "0.7.0")
(defun counsel-variable-list ()
"Return the list of all currently bound variables."
"Describe variable: "
(counsel-variable-list)
:keymap counsel-describe-map
- :preselect (counsel-symbol-at-point)
+ :preselect (ivy-thing-at-point)
:history 'counsel-describe-symbol-history
:require-match t
:sort t
(push (symbol-name x) cands))))
cands)
:keymap counsel-describe-map
- :preselect (counsel-symbol-at-point)
+ :preselect (ivy-thing-at-point)
:history 'counsel-describe-symbol-history
:require-match t
:sort t
(defsubst ivy-set-action (action)
(setf (ivy-state-action ivy-last) action))
+(defun ivy-thing-at-point ()
+ "Return a string that corresponds to the current thing at point."
+ (or
+ (thing-at-point 'url)
+ (let (s)
+ (cond ((stringp (setq s (thing-at-point 'symbol)))
+ (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
+ (match-string 1 s)
+ s))
+ ((looking-at "(+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
+ (match-string-no-properties 1))
+ (t
+ "")))))
+
(defvar ivy-history nil
"History list of candidates entered in the minibuffer.
(buffer-substring
(region-beginning)
(region-end))
- (or
- (thing-at-point 'url)
- (thing-at-point 'symbol)
- "")))
+ (ivy-thing-at-point)))
(setq ivy--prompt
(cond ((string-match "%.*d" prompt)
prompt)