Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
counsel "find-X" commands worse at default guessing than the corresponding builtins #1088
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
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
Well, of course the cases you mention are covered by the builtins, too, unless I'm missing something. I guess the fact I messed up find- and describe- in the OP didn't help, but it's related. A concrete example: In the form (setq ivy-on-del-error-function 'ignore) With point on "ignore" or "setq", both describe-function and counsel-describe-function will do the (same) right thing. With point somewhere else, e.g. on "ivy-on-del-error-function", describe-function still suggests "setq" as the function (macro) being called at point, while counsel-describe-function doesn't suggest anything. I've found that behaviour utterly frustrating. You really think it's better? I hope not, but if you do, what about counsel-find-library, which fails to even suggest the name of loaded feature at point (e.g. with point at "ivy" in "(use-package ivy)"). Again, find-library does the right thing.