Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

counsel "find-X" commands worse at default guessing than the corresponding builtins #1088

Closed
stepnem opened this issue Jun 30, 2017 · 3 comments

Comments

@stepnem
Copy link

stepnem commented Jun 30, 2017

I would expect the counsel replacements to be at least as smart as the builtin commands they purport to supersede, but they're not (in this respect at least).

E.g., the builtin find-function guesses the right default anywhere inside the function call. Counsel had better make use of the preexisting and well-tried builtin guessing functions, e.g. the patch below seems to fix the find-function case. There are equivalents for find-variable, find-library...

diff --git a/counsel.el b/counsel.el
index 6bd25a7..3ec8c6e 100644
--- a/counsel.el
+++ b/counsel.el
@@ -524,7 +524,8 @@ (defun counsel-describe-function ()
                      (push (symbol-name x) cands))))
                 cands)
               :keymap counsel-describe-map
-              :preselect (ivy-thing-at-point)
+              :preselect (when-let (fn (function-called-at-point))
+                           (symbol-name fn))
               :history 'counsel-describe-symbol-history
               :require-match t
               :sort t
@abo-abo
Copy link
Owner

abo-abo commented Jun 30, 2017

I disagree with the proposed change, it's better the way it is now.

There's value of looking up specifically the symbol at point. There's also value in seeing it's not bound. You can always press C-M-u if you want to describe the containing function.

@abo-abo abo-abo closed this as completed Jun 30, 2017
@stepnem
Copy link
Author

stepnem commented Jun 30, 2017 via email

@abo-abo
Copy link
Owner

abo-abo commented Jun 30, 2017

You really think it's better?

Yes, since it gives me info that the symbol at point isn't bound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants