Loading ...
Sorry, an error occurred while loading the content.

folding bash functions

Expand Messages
  • Dr. Detlef
    Hello, I tried to use foldable Bash functions. Item list is working but folding not. example shell-file example.sh: function echoerr { echo $@ 1 &2; } Here
    Message 1 of 3 , Mar 13 4:58 AM
    • 0 Attachment
      Hello,

      I tried to use foldable Bash functions. Item list is working but folding not.

      example shell-file example.sh:

      function echoerr {
      echo "$@" 1>&2;
      }


      Here is myshell.emf

      ; adding an f to the original setup-mask (for folding, collapse)
      set-variable .fhook-shell.setup-mask "aefghikmoptux"

      set-variable .fhook-shell.collapse-open "^function"
      set-variable .fhook-shell.collapse-close "^}"
      set-variable .fhook-shell.collapse-mclose "1"
      set-variable .fhook-shell.collapse-mnext "-1"


      set-variable .fhook-shell.item-list-s1 "^function \\(\\w+\\)"
      set-variable .fhook-shell.item-list-r1 "Func \ecB\\1\ecA"

      ;Any ideas to get folding support in bash-files?
      ; regards,
      ; Detlef
    • Jon Green
      Hi Detlef, Your myshell.emf is fine. The problem is that your folding state is saved in the registry and you need to enable it now that you have changed the
      Message 2 of 3 , Mar 14 2:39 PM
      • 0 Attachment
        Hi Detlef,

        Your myshell.emf is fine. The problem is that your folding state is
        saved in the registry and you need to enable it now that you have
        changed the mode, by default this is turned off because you have added a
        new mode.

        From within a .sh buffer (i.e. when editing file example.sh) then do

        M-x major-mode-setup

        Check the "Setup Folding"box. Then it should all be working,

        Regards
        Jon.

        On 13/03/2012 11:58, Dr. Detlef wrote:
        > Hello,
        >
        > I tried to use foldable Bash functions. Item list is working but folding not.
        >
        > example shell-file example.sh:
        >
        > function echoerr {
        > echo "$@" 1>&2;
        > }
        >
        >
        > Here is myshell.emf
        >
        > ; adding an f to the original setup-mask (for folding, collapse)
        > set-variable .fhook-shell.setup-mask "aefghikmoptux"
        >
        > set-variable .fhook-shell.collapse-open "^function"
        > set-variable .fhook-shell.collapse-close "^}"
        > set-variable .fhook-shell.collapse-mclose "1"
        > set-variable .fhook-shell.collapse-mnext "-1"
        >
        >
        > set-variable .fhook-shell.item-list-s1 "^function \\(\\w+\\)"
        > set-variable .fhook-shell.item-list-r1 "Func \ecB\\1\ecA"
        >
        > ;Any ideas to get folding support in bash-files?
        > ; regards,
        > ; Detlef
        >
      • Dr. Detlef
        Indeed major-mode-setup solved the problem with the old registry setting. Thanks Jon. regards, Detlef
        Message 3 of 3 , Mar 15 7:26 AM
        • 0 Attachment
          Indeed "major-mode-setup" solved the problem with the old registry setting.

          Thanks Jon.

          regards,
          Detlef

          --- In jasspa@yahoogroups.com, Jon Green <jon@...> wrote:
          >
          > Hi Detlef,
          >
          > Your myshell.emf is fine. The problem is that your folding state is
          > saved in the registry and you need to enable it now that you have
          > changed the mode, by default this is turned off because you have added a
          > new mode.
          >
          > From within a .sh buffer (i.e. when editing file example.sh) then do
          >
          > M-x major-mode-setup
          >
          > Check the "Setup Folding"box. Then it should all be working,
          >
          > Regards
          > Jon.
          >
          > On 13/03/2012 11:58, Dr. Detlef wrote:
          > > Hello,
          > >
          > > I tried to use foldable Bash functions. Item list is working but folding not.
          > >
          > > example shell-file example.sh:
          > >
          > > function echoerr {
          > > echo "$@" 1>&2;
          > > }
          > >
          > >
          > > Here is myshell.emf
          > >
          > > ; adding an f to the original setup-mask (for folding, collapse)
          > > set-variable .fhook-shell.setup-mask "aefghikmoptux"
          > >
          > > set-variable .fhook-shell.collapse-open "^function"
          > > set-variable .fhook-shell.collapse-close "^}"
          > > set-variable .fhook-shell.collapse-mclose "1"
          > > set-variable .fhook-shell.collapse-mnext "-1"
          > >
          > >
          > > set-variable .fhook-shell.item-list-s1 "^function \\(\\w+\\)"
          > > set-variable .fhook-shell.item-list-r1 "Func \ecB\\1\ecA"
          > >
          > > ;Any ideas to get folding support in bash-files?
          > > ; regards,
          > > ; Detlef
          > >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.