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

helpful-command should have offer a "default" option of function under point #39

Closed
naclander opened this issue Sep 25, 2017 · 4 comments

Comments

@naclander
Copy link

Currently when I use find-function, the default parameter is the current function under the point. This way I can call find-function and immediately press RET to describe the function under the point.

I think helpful should also assume the default to be the current word under the point ( but obviously let the user type a different argument if the wish ).

Also, thanks for the awsome pacakge. I'm very excited to hopefully fix the few remaining issues so that I can start using this package full time.

@Dickby
Copy link

Dickby commented Sep 25, 2017

@naclander for me it already works that way, with either ivy-mode or helm-mode enabled it is more obvious, without the only difference to find-function is, that there is no (default 'function-name'). Just try to press enter

@naclander
Copy link
Author

@Dickby this is the case in some situations but not all, so I think it is a bug. FWIW I am also using helm-mode for this.

I can get helpful-function to correctly default, for exaple, when my point is on top of list-colors-disaply in (list-colors-disaply). However, when my point is above setq in (setq test 'test) setq is not suggested as the default. Can you confirm whether or not this is the case for you?

In all above cases, describe-function correctly suggests the function under point.

@Wilfred
Copy link
Owner

Wilfred commented Sep 27, 2017

setq is a macro, not a function. You can use helpful-callable if you want to search for both functions and macros, or helpful-symbol for any bound symbol.

helpful-command, helpful-function and helpful-macro are more specific, and won't offer the symbol at point if it isn't the right type.

The docs could definitely be clearer on this.

@naclander
Copy link
Author

@Wilfred thanks for the response. It makes sense why you implemented it this way.

However, I assumed that the helpful-* functions were analogous to their emacs equivalent, and would therefore act the same way. i.e. helpful-function maps to describe-function.

In this case, describe-function works on both macros and functions. I think from a usability perspective this is nicer for users as well, because if I'm calling describe-function/helpful-function on something, I probably have no idea what that thing is, let alone whether it's a macro or a function.

At a minimum, maybe the docs should say to use helpful-callable to replace describe-function, and helpful-variable to replace describe-variable.

@Wilfred Wilfred closed this as completed in 3b21419 Dec 6, 2017
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

3 participants