From: Peter Stephenson <pws@ifh.de>
To: zsh-workers@math.gatech.edu (Zsh hackers list), zsh@peak.org
Subject: PATCH: 3.1.2: keyboard macros (2) [needed]
Date: Mon, 13 Oct 1997 17:35:46 +0200 [thread overview]
Message-ID: <199710131535.RAA14039@hydra.ifh.de> (raw)
Somehow I forgot to include the zle_keymap.c segment of the last
patch, with the bindkey changes. This also includes a bugfix: if zle
read a complete key sequence but didn't need it, such as when in
isearch the next sequence wasn't one of the ones specially handled,
you got it twice.
*** Src/Zle/zle_keymap.c.km2 Mon Oct 13 17:18:42 1997
--- Src/Zle/zle_keymap.c Mon Oct 13 17:24:06 1997
***************
*** 581,586 ****
--- 581,587 ----
{ 'A', 0, bin_bindkey_link, 2, 2 },
{ 'N', 0, bin_bindkey_new, 1, 2 },
{ 'm', 1, bin_bindkey_meta, 0, 0 },
+ { 'k', 1, bin_bindkey_bind, 1, 1 },
{ 'r', 1, bin_bindkey_bind, 1, -1 },
{ 's', 1, bin_bindkey_bind, 2, -1 },
{ 0, 1, bin_bindkey_bind, 0, -1 },
***************
*** 815,821 ****
int len;
Thingy fn;
! if(func == 'r') {
fn = refthingy(t_undefinedkey);
str = NULL;
} else if(func == 's') {
--- 816,829 ----
int len;
Thingy fn;
! if(func == 'k') {
! if (!last_macro) {
! zwarnnam(name, "no keyboard macro defined", NULL, 0);
! return 1;
! }
! fn = NULL;
! str = metafy(last_macro, last_mlen, META_DUP);
! } else if(func == 'r') {
fn = refthingy(t_undefinedkey);
str = NULL;
} else if(func == 's') {
***************
*** 1175,1180 ****
--- 1183,1192 ----
ungetkeycmd(void)
{
ungetkeys(keybuf, keybuflen);
+ /* So we don't do this twice when recording a macro, delete the
+ * first occurrence
+ */
+ macro_del(keybuflen);
}
/* read a command from the current keymap, with widgets */
*** Src/Zle/zle_utils.c.km2 Mon Oct 13 17:20:45 1997
--- Src/Zle/zle_utils.c Mon Oct 13 17:28:16 1997
***************
*** 653,658 ****
--- 653,670 ----
/**/
void
+ macro_del(int nc)
+ {
+ if (!macro_record)
+ return;
+ if (nc > macro_ptr - cur_macro)
+ cur_startseq = macro_ptr = cur_macro;
+ else
+ macro_ptr -= nc;
+ }
+
+ /**/
+ void
macro_startseq(void)
{
cur_startseq = macro_ptr;
--
Peter Stephenson <pws@ifh.de> Tel: +49 33762 77366
WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, Platanenallee 6, 15738 Zeuthen, Germany.
reply other threads:[~1997-10-13 15:42 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=199710131535.RAA14039@hydra.ifh.de \
--to=pws@ifh.de \
--cc=zsh-workers@math.gatech.edu \
--cc=zsh@peak.org \
/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).