From: Zefram <zefram@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu
Subject: zed and bindkey
Date: Sat, 22 Mar 1997 16:36:41 GMT [thread overview]
Message-ID: <13323.199703221636@stone.dcs.warwick.ac.uk> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
This patch updates zed's handling of key bindings. By using bindkey's
new -L option, it can more accurately restore those key bindings that
it changes. Also, by using the -M option, it can add the appropriate
accept-line key binding for the user's preferred keymap, rather than
blindly using ^X^W.
-zefram
*** Functions/zed 1996/08/02 22:38:40 1.1.1.3
--- Functions/zed 1997/03/21 22:55:26
***************
*** 7,13 ****
# Completion: use
# compctl -f -x 'w[1,-f]' -F -- zed
! local var fun ctrl_W_bind="$(bindkey '^W')"
# We do not want timeout while we are editing a file
integer TMOUT=0
--- 7,13 ----
# Completion: use
# compctl -f -x 'w[1,-f]' -F -- zed
! local var fun cleanup
# We do not want timeout while we are editing a file
integer TMOUT=0
***************
*** 17,38 ****
[[ -z "$1" ]] && echo 'Usage: "zed filename" or "zed -f function"' && return 1
# catch interrupts
! cleanup () {
! bindkey "^M" accept-line
! bindkey "^X^W" undefined-key
! bindkey "^W" "$ctrl_W_bind"
! trap - INT
! }
!
! trap 'cleanup ; return 130' INT
# don't mangle !'s
setopt localoptions nobanghist
bindkey "^M" self-insert-unmeta
# Depending on your stty's, you may be able to use ^J as accept-line, else:
! bindkey "^X^W" accept-line
! bindkey "^W" kill-region
if ((fun)) then
var="$(functions $1)"
--- 17,34 ----
[[ -z "$1" ]] && echo 'Usage: "zed filename" or "zed -f function"' && return 1
# catch interrupts
! cleanup="$(bindkey -L "^M"; bindkey -L -M emacs "^X^W"; bindkey -aL "ZZ"
! echo "trap - INT EXIT"; trap)"
! trap "return 130" INT
! trap "$cleanup" EXIT
# don't mangle !'s
setopt localoptions nobanghist
bindkey "^M" self-insert-unmeta
# Depending on your stty's, you may be able to use ^J as accept-line, else:
! bindkey -M emacs "^X^W" accept-line
! bindkey -a "ZZ" accept-line
if ((fun)) then
var="$(functions $1)"
***************
*** 53,65 ****
fi
vared var
fun=$?
- cleanup
(( fun == 0 )) && eval function "$var"
else
[[ -f $1 ]] && var="$(<$1)"
vared var
fun=$?
- cleanup
(( fun == 0 )) && print -r -- "$var" >| $1
fi
--- 49,59 ----
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: ascii
iQCVAwUBMzMUxHD/+HJTpU/hAQFwhgP/eg4DFVHjmiqzQ/N3fsYdv7kHr3ev33fN
GLzgdzhF+BHLBXAl8wgosIQ0kbzC79FUPOK12+sN1vV4CAnn7UNdbaDdqtoQtxtx
NHdAa/zVpxAKjdA8OjvfpYvHLxpSPqukwa182VQKLcKmhIZyq31qHM6cX2pRwC+m
357MHqov1qo=
=OXyk
-----END PGP SIGNATURE-----
reply other threads:[~1997-03-22 16:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13323.199703221636@stone.dcs.warwick.ac.uk \
--to=zefram@dcs.warwick.ac.uk \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).