#88 Can't create a RW local copy of KEYMAP

feature_requests
closed-wont-fix
None
5
2013-01-26
2013-01-26
ELIPTUS
No

This is how I'm attempting to create a RW local copy of KEYMAP:

zle-keymap-select()
{
    local +hr KEYMAP=${KEYMAP}

    # some work
}
zle -N zle-keymap-select

This is the error I get:

zle-keymap-select:local:2: KEYMAP: can't change type of a special parameter

Discussion

  • Bart Schaefer

    Bart Schaefer - 2013-01-26

    This has to do with the semantics of ZLE parameters. They're implicitly already local to the widget, so you can't make them local again in the same scope. Workaround is to use an anonymous function scope:

    zle-keymap-select()
    {
      (){
        local -h +r KEYMAP=${KEYMAP}
        : ...
      }
    }
    
     
  • Bart Schaefer

    Bart Schaefer - 2013-01-26
    • status: open --> closed-wont-fix
    • assigned_to: Bart Schaefer
     
  • ELIPTUS

    ELIPTUS - 2013-01-26

    Appreciate the workaround.

    Thanks.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks