zsh-workers
 help / color / mirror / code / Atom feed
* bindkey even worse
@ 1995-11-01 11:02 Peter William Stephenson
  1995-11-02  2:33 ` Richard Coleman
  0 siblings, 1 reply; 2+ messages in thread
From: Peter William Stephenson @ 1995-11-01 11:02 UTC (permalink / raw)
  To: Zsh hackers list

This time, printbinding() is looking for a string to print out when it
should be looking for a key name.

*** Src/zle_main.c.bk	Sun Oct 29 11:50:39 1995
--- Src/zle_main.c	Wed Nov  1 11:58:24 1995
***************
*** 824,833 ****
      Key k = (Key) hn;
      int len;
  
!     if (k->func == z_undefinedkey)
  	return;
      putc('\"', bindout);
!     printbind(k->str, (len = strlen(k->str)) ? len : 1);
      fprintf(bindout, "\"\t");
      if (k->func == z_sendstring) {
  	putc('\"', bindout);
--- 824,833 ----
      Key k = (Key) hn;
      int len;
  
!     if (!k || k->func == z_undefinedkey)
  	return;
      putc('\"', bindout);
!     printbind(k->nam, (len = strlen(k->nam)) ? len : 1);
      fprintf(bindout, "\"\t");
      if (k->func == z_sendstring) {
  	putc('\"', bindout);

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bindkey even worse
  1995-11-01 11:02 bindkey even worse Peter William Stephenson
@ 1995-11-02  2:33 ` Richard Coleman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Coleman @ 1995-11-02  2:33 UTC (permalink / raw)
  To: zsh-workers

> This time, printbinding() is looking for a string to print out when it
> should be looking for a key name.

Well, not worse, just different :-)

Actually the original problem with printbinding() was that
the order of the parameters didn't match with scanhashtable().
This was causing every Key value for multi-character bindings
to appear to be NULL when printing from `bindkey'.  The last
patch you sent about this added a test to ignored NULL values.
This had the effect of not printing any of the multi-character
bindings.  I discovered this and fixed it, but somehow used
k->str instead of k->nam.  This probably happened since the
previous code passed in k->nam using the parameter `str'.
So the result was that it still core dumped, but for a
different reason.

I'm glad you found it, because `bindkey' finally works.

rc




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-11-02  3:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-11-01 11:02 bindkey even worse Peter William Stephenson
1995-11-02  2:33 ` Richard Coleman

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).