Pressing the F1 key with a cursor/point at an elisp symbol in code I want to view the *Help*
related to this symbol, but pressing F1 does not result in rising the appropriate help buffer.
Is there a way to get the help on a symbol at cursor/point by pressing only F1? How?
Update considering given answers and provided comments:
Inspired by dalanicolais answer below an elisp one-liner providing the basic functionality I have asked for:
(global-set-key(kbd"<f1>")(lambda()(interactive)(describe-symbol(symbol-at-point))))
The problem with the up to now given answers (status 2023-04-06 15:34 ECT) is that these with short code lack appropriate user response in case there is no valid symbol giving the impression that the F1 key does not work and that with the longer code is writing unnecessary messages to the *Message*
and the minibuffer.
The reason for the necessity of writing unnecessary messages in case of success in showing help for a symbol is the fact that the function describe-symbol
returns 1
no matter if a symbol description was found or not.
In this context the original question leads to the question how to get in elisp code feedback about success/failure in finding HELP for symbol-at-point?
If there is no way (and it seems to be the case excluding fiddling with the elisp and C source code of Emacs) to get this feedback, writing unnecessary messages is the only solution allowing to give the user appropriate feedback about the requested information. Appropriate user feedback has in my eyes much higher priority compared to not messing up the *Message*
and the minibuffer with not true statements.