syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.9k forks source link

Feature Request: Insert function definition (at point) into the buffer #2560

Closed xged closed 4 years ago

syl20bnr commented 9 years ago

I'm not sure to understand the feature, can you provide more info on the feature and a use case to be sure there is no missunderstanding ?

xged commented 9 years ago

E.g. Without the feature I get a list of faces (defined by defface) in my .spacemacs file/buffer and for each one of them >> go to their definition (gd) >> copy the definition >> go back to .spacemacs buffer >> paste the definition in it >> modify the definition. (Definitions are scattered).

I would use the feature even just for exploring for the convenience of not leaving the current buffer (and not creating a new one).

tuhdo commented 9 years ago

If you add emacs-lisp layer, it will show you the definition at point in the echo area without doing anything.

xged commented 9 years ago

@tuhdo Isn't that too much of a visual noise and a performance penalty to have it all the time? But I would prob use it as a toggle when heavy exploring.

tuhdo commented 9 years ago

@xged nope. It is because if a symbol is shown, it is already loaded into Emacs, and is only triggered when you place point on a symbol. I don't think it's a visual noise since it's only shown at the bottom and only when you place point on a symbol.

This is Emacs, not Vim :)

xged commented 9 years ago

@tuhdo The point can be moved very fast :-), but it probably waits a second or a half for the definition to show up as most of the similar tools do, so that solves my silly 'concerns'. Still a very different problem then pasting.

tuhdo commented 9 years ago

For your problem, I think it's easier to create a window that is clone of the current window (by simply splitting with :vs or :sp, then move point there and jump to function definition).

xged commented 9 years ago

@tuhdo I did it fast enough with macros. Nonetheless, I think the feature is important (because function definitions in general are super important).

sooheon commented 9 years ago

Take a look at lispy. Specifically these features, as well as M-. and M-,.

syl20bnr commented 9 years ago

That's nice :-)

delaanthonio commented 7 years ago

This issue appears to have been resolved.

d12frosted commented 7 years ago

I don't agree that the initial feature request was satisfied. But I don't see much traction here. So I am not sure what to do. 😸 😿

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!