diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | Doc/Zsh/params.yo | 7 | ||||
-rw-r--r-- | Doc/Zsh/zle.yo | 8 | ||||
-rw-r--r-- | Src/Zle/zle_keymap.c | 10 | ||||
-rw-r--r-- | Src/Zle/zle_main.c | 3 |
5 files changed, 33 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog index 7903bb68c..f3d91b5c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-09-08 Peter Stephenson <pws@csr.com> + + * 28241: Doc/Zsh/zle.yo, Src/Zle/zle_keymap.c: don't list .safe + keymap with "bindkey -lL", you don't get there from here. + + * 28237: Doc/Zsh/params.yo, Doc/Zsh/zle.yo, Src/Zle/zle_main.c: + set ZLE_LINE_ABORTED to line so far when ZLE aborts on an error. + 2010-09-06 Peter Stephenson <pws@csr.com> * unposted: Doc/Zsh/zle.yo: small typo. @@ -13604,5 +13612,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5071 $ +* $Revision: 1.5072 $ ***************************************************** diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo index b78896020..5d85f58e3 100644 --- a/Doc/Zsh/params.yo +++ b/Doc/Zsh/params.yo @@ -1448,6 +1448,13 @@ item(tt(ZDOTDIR))( The directory to search for shell startup files (.zshrc, etc), if not tt($HOME). ) +vindex(ZLE_LINE_ABORTED) +item(tt(ZLE_LINE_ABORTED))( +This parameter is set by the line editor when an error occurs. It +contains the line that was being edited at the point of the error. +`tt(print -zr -- $ZLE_LINE_ABORTED)' can be used to recover the line. +Only the most recent line of this kind is remembered. +) vindex(ZLE_REMOVE_SUFFIX_CHARS) vindex(ZLE_SPACE_SUFFIX_CHARS) xitem(tt(ZLE_REMOVE_SUFFIX_CHARS)) diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 37b8187c1..87933b93d 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -185,7 +185,10 @@ those keymaps. If the tt(-L) option is also used, list in the form of tt(bindkey) commands to create or link the keymaps. `tt(bindkey -lL main)' shows which keymap is linked to `tt(main)', if any, and hence if -the standard emacs or vi emulation is in effect. +the standard emacs or vi emulation is in effect. This option does +not show the tt(.safe) keymap because it cannot be created in that +fashion; however, neither is `tt(bindkey -lL .safe)' reported as an +error, it simply outputs nothing. ) item(tt(-d))( Delete all existing keymaps and reset to the default state. @@ -2057,7 +2060,8 @@ tindex(send-break) item(tt(send-break) (^G ESC-^G) (unbound) (unbound))( Abort the current editor function, e.g. tt(execute-named-command), or the editor itself, e.g. if you are in tt(vared). Otherwise abort the parsing of -the current line. +the current line; in this case the aborted line is available in the shell +variable tt(ZLE_LINE_ABORTED). ) tindex(run-help) item(tt(run-help) (ESC-H ESC-h) (unbound) (unbound))( diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index 8fa8e9883..0531c18ca 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -829,12 +829,18 @@ bin_bindkey_lsmaps(char *name, UNUSED(char *kmname), UNUSED(Keymap km), char **a /**/ static void -scanlistmaps(HashNode hn, int list) +scanlistmaps(HashNode hn, int list_verbose) { KeymapName n = (KeymapName) hn; - if (list) { + if (list_verbose) { Keymap km = n->keymap; + /* + * Don't list ".safe" as a bindkey command; we can't + * actually create it that way. + */ + if (!strcmp(n->nam, ".safe")) + return; fputs("bindkey -", stdout); if (km->primary && km->primary != n) { KeymapName pn = km->primary; diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 5c6b65db3..641880ccf 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -1226,6 +1226,9 @@ zleread(char **lp, char **rp, int flags, int context) zlecore(); + if (errflag) + setsparam("ZLE_LINE_ABORTED", zlegetline(NULL, NULL)); + if (done && !exit_pending && !errflag && (initthingy = rthingy_nocreate("zle-line-finish"))) { int saverrflag = errflag; |