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

funced the whole .fish file contents, not only function body #391

Closed
maxfl opened this issue Nov 14, 2012 · 3 comments · Fixed by #8130
Closed

funced the whole .fish file contents, not only function body #391

maxfl opened this issue Nov 14, 2012 · 3 comments · Fixed by #8130

Comments

@maxfl
Copy link
Contributor

maxfl commented Nov 14, 2012

Sometime the .fish file contains not only the function definition, but some variable definitions. Sometimes the function definition depends on a system, so there is if/function/else/function construction.

When funced is invoked it let you edit only the function name, options and body. After applying funcsave all the other information is lost.

It would be very helpful if function could contain the whole contents of the .fish file instead. So when you type funced, you can also modify the preceeding variables, conditions and comments.

@ridiculousfish
Copy link
Member

This is a good idea, but is nontrivial to implement because the functions builtin would have to determine whether the function came from a file, and funced would have to be taught how to use it.

@krader1961
Copy link
Contributor

This should be easy to do after issue #3295 is implemented.

@krader1961
Copy link
Contributor

As discussed in issue #3701 we should do two things:

  1. Make it possible to edit the file in which the function was originally defined using the funced command.

  2. Warn the user about losing their edits if they don't invoke funced with the --save or --perm flag (the flag name is still open for discussion).

To be determined is whether we can, or should, attempt to protect the user from doing funcsave $func_name when the file in which the function was defined contains other statements and comments.

zanchey added a commit to zanchey/fish-shell that referenced this issue Jul 10, 2021
Many functions ship in files with helper functions, and it is useful to
edit those too.

Closes fish-shell#391.
@zanchey zanchey linked a pull request Jul 10, 2021 that will close this issue
3 tasks
zanchey added a commit to zanchey/fish-shell that referenced this issue Jul 11, 2021
Many functions ship in files with helper functions, and it is useful to
edit those too.

Closes fish-shell#391.
zanchey added a commit to zanchey/fish-shell that referenced this issue Jul 11, 2021
Many functions ship in files with helper functions, and it is useful to
edit those too.

Closes fish-shell#391.
zanchey added a commit to zanchey/fish-shell that referenced this issue Jul 21, 2021
Many functions ship in files with helper functions, and it is useful to
edit those too.

Closes fish-shell#391.
@zanchey zanchey modified the milestones: fish-future, fish 3.4.0 Aug 16, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants