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

Function location of spacemacs/ functions is missing #3430

Closed
Profpatsch opened this issue Oct 16, 2015 · 15 comments
Closed

Function location of spacemacs/ functions is missing #3430

Profpatsch opened this issue Oct 16, 2015 · 15 comments
Labels

Comments

@Profpatsch
Copy link
Contributor

When you describe-function a function that spacemacs defines, the link in the help buffer points to the wrong location.

Example:
spacemacs/helm-project-smart-do-search-region-or-symbol is an interactive Lisp function ininit.el'.`

A click on init.el leads to the spacemacs initialization file instead of the line where the function is defined (which is the behaviour for normal emacs functions).

@justbur
Copy link
Contributor

justbur commented Oct 16, 2015

Technically, that function is not defined where you think it is, because the defun in inside another defun (the init function), which is not called right away. This is probably the reason emacs is not "finding it". There are a couple of ways to correct this, but I'm not sure what (if anything) @syl20bnr will want to do about it.

@syl20bnr
Copy link
Owner

This is the case when the functions are defined by macros, Emacs does not go to the macro location. This can confuse the user. Not much we can do on our side except explicitly define the functions outside of a macro which is not practical in most cases depending on the usefulness of the macro (I.e. How many times it is really used ?).

@d12frosted
Copy link
Collaborator

What if we use some naming policy for macros functions, so users can distinguish macros and regular functions? For example, spacemacs-macro/xxx.

@TheBB
Copy link
Collaborator

TheBB commented Oct 19, 2015

You mean functions created in macros as opposed to functions created normally? I don't see that adding much value. (And it's verbose as hell.) If you mean a naming policy for macros, we have that already.

I think this is just something we have to live with. It's Emacs' problem.

@justbur
Copy link
Contributor

justbur commented Oct 19, 2015

Here's a simple way to change the way functions are defined so that they are discoverable
In "layers/+distribution/spacemacs/packages.el":

(defun spacemacs/init-foo ()
  (use-package foo
    :config
    (require 'spacemacs-foo-funcs)))

In "layers/+distribution/spacemacs/extra-funcs/spacemacs-foo-funcs.el":

(defun spacemacs/foo-do-bar ())

@StreakyCobra
Copy link
Contributor

Is this issue a Wontfix or a Enhancement?

@StreakyCobra
Copy link
Contributor

@syl20bnr Up

@nixmaniack
Copy link
Contributor

justbur's way sounds good to me, I've always faced issues when functions are defined inside use-package and gd doesn't work in that case.

@olejorgenb
Copy link
Contributor

olejorgenb commented Apr 22, 2016

Sorry for the spam, but I want to voice my support for this issue. Quick access to help and easy navigation into the code depths are one of the reasons emacs is great. It's also much easier to contribute to projects where the source code is easily navigable.

Meanwhile SPC s p is quick enough to be workable for me.

For discoverability: elisp-slime-nav-find-elisp-thing-at-point

@github-actions
Copy link

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!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
@Profpatsch
Copy link
Contributor Author

yeah

@nixmaniack
Copy link
Contributor

Let's keep this open? This is still an issue and would be better if all code becomes navigable with standard emacs tooling.

@duianto duianto removed the stale marked as a stale issue/pr (usually by a bot) label Mar 15, 2020
@github-actions
Copy link

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!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Mar 15, 2021
@syl20bnr
Copy link
Owner

Mmhhh do we still have this issue ? We moved all the functions to funcs.el files to avoid the issue where Emacs could not locate the function's definition. If we still encounter functions with no location we should move them to funcs.el.

@JAremko JAremko added the updated This issue has been updated since becoming stale label Apr 14, 2021
@lebensterben lebensterben removed - Bug tracker - stale marked as a stale issue/pr (usually by a bot) updated This issue has been updated since becoming stale labels Mar 14, 2022
@lebensterben
Copy link
Collaborator

Not able to reproduce at current develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests