Skip to content

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

Closed

Description

@maxfl

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.

Activity

  1. ridiculousfish commented on Dec 2, 2012

    @ridiculousfish
    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.

  2. krader1961 commented on Dec 12, 2016

    @krader1961
    Contributor

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

  3. krader1961 commented on Jan 10, 2017

    @krader1961
    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.

  4. added a commit that references this issue on Jul 10, 2021
    a071c0c
  5. added 2 commits that reference this issue on Jul 11, 2021
    0d05ae9
    a6d3956
  6. added a commit that references this issue on Jul 21, 2021
    7eb4d87
  7. added a commit that references this issue on Aug 16, 2021
    8dd4c67
  8. locked as resolved and limited conversation to collaborators on Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions