mirror of git://git.code.sf.net/p/zsh/code
23159 plus minor doc tweaks: leave BAUD parameter unset by default
This commit is contained in:
parent
6cf7a3ef11
commit
62b671f0d1
|
@ -1,3 +1,9 @@
|
|||
2007-02-08 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 23159 plus minor doc tweaks: Doc/Zsh/params.yo, Src/params.c,
|
||||
Src/utils.c, Src/Zle/zle_main.c: leave BAUD parameter unset
|
||||
by default.
|
||||
|
||||
2007-02-07 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 23153: Src/utils.c: put back old ztrcmp(), with a comment:
|
||||
|
|
|
@ -742,19 +742,20 @@ item(tt(ARGV0))(
|
|||
If exported, its value is used as the tt(argv[0]) of external commands.
|
||||
Usually used in constructs like `tt(ARGV0=emacs nethack)'.
|
||||
)
|
||||
cindex(editing over slow connection)
|
||||
cindex(slow connection, editing over)
|
||||
vindex(BAUD)
|
||||
item(tt(BAUD))(
|
||||
The baud rate of the current connection. Used by the line editor
|
||||
update mechanism to compensate for a slow terminal by delaying
|
||||
updates until necessary. This may be profitably set to a lower value
|
||||
in some circumstances, e.g.
|
||||
for slow modems dialing into a communications server which is connected
|
||||
to a host via a fast link; in this case, this variable
|
||||
would be set by default to the speed of the fast link, and not
|
||||
the modem.
|
||||
This parameter should be set to the baud
|
||||
rate of the slowest part of the link for best performance. The compensation
|
||||
mechanism can be turned off by setting the variable to zero.
|
||||
The rate in bits per second at which data reaches the terminal.
|
||||
The line editor will use this value in order to compensate for a slow
|
||||
terminal by delaying updates to the display until necessary. If the
|
||||
parameter is unset or the value is zero the compensation mechanism is
|
||||
turned off. The parameter is not set by default.
|
||||
|
||||
This parameter may be profitably set in some circumstances, e.g.
|
||||
for slow modems dialing into a communications server, or on a slow wide
|
||||
area network. It should be set to the baud
|
||||
rate of the slowest part of the link for best performance.
|
||||
)
|
||||
vindex(cdpath)
|
||||
vindex(CDPATH)
|
||||
|
|
|
@ -1074,6 +1074,7 @@ zleread(char **lp, char **rp, int flags, int context)
|
|||
Thingy initthingy;
|
||||
|
||||
#if defined(HAVE_POLL) || defined(HAVE_SELECT)
|
||||
/* may not be set, but that's OK since getiparam() returns 0 == off */
|
||||
baud = getiparam("BAUD");
|
||||
costmult = (baud) ? 3840000L / baud : 0;
|
||||
#endif
|
||||
|
|
13
Src/params.c
13
Src/params.c
|
@ -640,9 +640,16 @@ createparamtable(void)
|
|||
setiparam("LOGCHECK", 60);
|
||||
setiparam("KEYTIMEOUT", 40);
|
||||
setiparam("LISTMAX", 100);
|
||||
#ifdef HAVE_SELECT
|
||||
setiparam("BAUD", getbaudrate(&shttyinfo)); /* get the output baudrate */
|
||||
#endif
|
||||
/*
|
||||
* We used to get the output baud rate here. However, that's
|
||||
* pretty irrelevant to a terminal on an X display and can lead
|
||||
* to unnecessary delays if it's wrong (which it probably is).
|
||||
* Furthermore, even if the output is slow it's very likely
|
||||
* to be because of WAN delays, not covered by the output
|
||||
* baud rate.
|
||||
* So allow the user to set it in the special cases where it's
|
||||
* useful.
|
||||
*/
|
||||
setsparam("TMPPREFIX", ztrdup(DEFAULT_TMPPREFIX));
|
||||
setsparam("TIMEFMT", ztrdup(DEFAULT_TIMEFMT));
|
||||
setsparam("WATCHFMT", ztrdup(default_watchfmt));
|
||||
|
|
102
Src/utils.c
102
Src/utils.c
|
@ -3435,108 +3435,6 @@ gettygrp(void)
|
|||
return arg;
|
||||
}
|
||||
|
||||
/* Return the output baudrate */
|
||||
|
||||
#ifdef HAVE_SELECT
|
||||
/**/
|
||||
long
|
||||
getbaudrate(struct ttyinfo *shttyinfo)
|
||||
{
|
||||
long speedcode;
|
||||
|
||||
#ifdef HAS_TIO
|
||||
# if defined(HAVE_TCGETATTR) && defined(HAVE_TERMIOS_H)
|
||||
speedcode = cfgetospeed(&shttyinfo->tio);
|
||||
# else
|
||||
speedcode = shttyinfo->tio.c_cflag & CBAUD;
|
||||
# endif
|
||||
#else
|
||||
speedcode = shttyinfo->sgttyb.sg_ospeed;
|
||||
#endif
|
||||
|
||||
switch (speedcode) {
|
||||
case B0:
|
||||
return (0L);
|
||||
case B50:
|
||||
return (50L);
|
||||
case B75:
|
||||
return (75L);
|
||||
case B110:
|
||||
return (110L);
|
||||
case B134:
|
||||
return (134L);
|
||||
case B150:
|
||||
return (150L);
|
||||
case B200:
|
||||
return (200L);
|
||||
case B300:
|
||||
return (300L);
|
||||
case B600:
|
||||
return (600L);
|
||||
#ifdef _B900
|
||||
case _B900:
|
||||
return (900L);
|
||||
#endif
|
||||
case B1200:
|
||||
return (1200L);
|
||||
case B1800:
|
||||
return (1800L);
|
||||
case B2400:
|
||||
return (2400L);
|
||||
#ifdef _B3600
|
||||
case _B3600:
|
||||
return (3600L);
|
||||
#endif
|
||||
case B4800:
|
||||
return (4800L);
|
||||
#ifdef _B7200
|
||||
case _B7200:
|
||||
return (7200L);
|
||||
#endif
|
||||
case B9600:
|
||||
return (9600L);
|
||||
#ifdef B19200
|
||||
case B19200:
|
||||
return (19200L);
|
||||
#else
|
||||
# ifdef EXTA
|
||||
case EXTA:
|
||||
return (19200L);
|
||||
# endif
|
||||
#endif
|
||||
#ifdef B38400
|
||||
case B38400:
|
||||
return (38400L);
|
||||
#else
|
||||
# ifdef EXTB
|
||||
case EXTB:
|
||||
return (38400L);
|
||||
# endif
|
||||
#endif
|
||||
#ifdef B57600
|
||||
case B57600:
|
||||
return (57600L);
|
||||
#endif
|
||||
#ifdef B115200
|
||||
case B115200:
|
||||
return (115200L);
|
||||
#endif
|
||||
#ifdef B230400
|
||||
case B230400:
|
||||
return (230400L);
|
||||
#endif
|
||||
#ifdef B460800
|
||||
case B460800:
|
||||
return (460800L);
|
||||
#endif
|
||||
default:
|
||||
if (speedcode >= 100)
|
||||
return speedcode;
|
||||
break;
|
||||
}
|
||||
return (0L);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Escape tokens and null characters. Buf is the string which should be *
|
||||
* escaped. len is the length of the string. If len is -1, buf should be *
|
||||
|
|
Loading…
Reference in New Issue