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

Use thing-at-point for proper word recognition #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tuhdo
Copy link

@tuhdo tuhdo commented Oct 24, 2014

So it can be used in code buffer as well. (current-word) only returns a
symbol, so look up fails most of the times.

So it can be used in code buffer as well. (current-word) only returns a
symbol, so look up fails most of the times.
@myrkr
Copy link
Owner

myrkr commented Oct 24, 2014

On my emacs 24.3.1 thing-at-point has a single parameter so your code fails. BTW: the function word-at-point meaning (thing-at-point 'word) might be a good replacement here.

I also notified that in a lot of case (current-word) is more suitable thant (word-at-point).

For example, compound words (with hyphens) are returned by current-word but not by word-at-point. current-word also tries harder to find a valid word, word-at-point will more likely return nil.

I prefer the behaviour of current-word.

@tuhdo
Copy link
Author

tuhdo commented Oct 24, 2014

Maybe we can add prefix argument to it. The default behavior is for only one word and with prefix argument, use (current-word). Otherwise we cannot look up for word, i.e. I want to look up for the word thing in thing-at-point, but current word returns the whole thing-at-point word and result in word not found. Maybe we can change at least dictionary-lookup-definition command? It should look for a single word by default.

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

Successfully merging this pull request may close these issues.

2 participants