[421] in Zephyr_Bugs
@color(), @font(), and @expire() vs. Zephyr users on ttys
daemon@ATHENA.MIT.EDU (Rod Hoon)
Thu Oct 22 23:51:03 1992
To: bug-zephyr@Athena.MIT.EDU
From: Rod Hoon <radish@iastate.edu>
Date: Thu, 22 Oct 92 22:50:49 CDT
When I log into my Vincent account through a dial-up terminal,
I tend to think of zwgc's @color, @font, and @expire commands
as more of a nuisance than a feature. I don't really need to
know that someone's signature would happen to print out in
`-adobe-new century schoolbook-bold-i-normal--20-*' if I wasn't
at a text-only terminal, so I think the right thing to do is
to not display any text within those commands.
I modified a copy of zwgc to do this; a diff of my changes is below.
--Rod
--
Rod Hoon radish@iastate.edu // hzl04@isuvax.iastate.edu
"Don't laugh now, wait until you see it in real life." -- Rob Pike
*** tty_filter.c.orig Tue Oct 20 13:30:00 1992
--- tty_filter.c Thu Oct 22 21:08:05 1992
***************
*** 195,200 ****
--- 195,201 ----
int bold_p;
int italic_p;
int bell_p;
+ int munch_p; /* non-zero: discard the contents of this environment */
} tty_str_info;
static void free_info(info)
***************
*** 235,241 ****
else if (fixed_string_eq("roman", text, text_length)) {
current_mode_p->bold_p = 0;
current_mode_p->italic_p = 0;
! } else if (fixed_string_eq("beep", text, text_length)) {
current_mode_p->bell_p = 1;
return 1;
}
--- 236,249 ----
else if (fixed_string_eq("roman", text, text_length)) {
current_mode_p->bold_p = 0;
current_mode_p->italic_p = 0;
! }
! /* X-driver-specific environments: */
! else if (fixed_string_eq("font", text, text_length) ||
! fixed_string_eq("color", text, text_length) ||
! fixed_string_eq("expire", text, text_length))
! current_mode_p->munch_p = 1;
! /* beep: */
! else if (fixed_string_eq("beep", text, text_length)) {
current_mode_p->bell_p = 1;
return 1;
}
***************
*** 249,255 ****
/* This is needed due to a bug in saber */
tty_str_info current_mode;
#else
! tty_str_info current_mode = { NULL, "", 0, 'l', 0 , 0, 0};
#endif
tty_str_info *temp;
tty_str_info *result = NULL;
--- 257,263 ----
/* This is needed due to a bug in saber */
tty_str_info current_mode;
#else
! tty_str_info current_mode = { NULL, "", 0, 'l', 0, 0, 0, 0};
#endif
tty_str_info *temp;
tty_str_info *result = NULL;
***************
*** 264,269 ****
--- 272,278 ----
current_mode.bold_p = 0;
current_mode.italic_p = 0;
current_mode.bell_p = 0;
+ current_mode.munch_p = 0;
#endif
for (; desc->code!=DT_EOF; desc=desc->next) {
***************
*** 312,319 ****
if (desc->code == DT_STR) {
/* just combine string info with current mode: */
*temp = current_mode;
! temp->str = desc->str;
! temp->len = desc->len;
} else if (desc->code == DT_NL) {
/* make the new block a ' ' alignment block with an empty string */
temp->alignment = ' ';
--- 321,333 ----
if (desc->code == DT_STR) {
/* just combine string info with current mode: */
*temp = current_mode;
! if (temp->munch_p) {
! temp->str = "";
! temp->len = 0;
! } else {
! temp->str = desc->str;
! temp->len = desc->len;
! }
} else if (desc->code == DT_NL) {
/* make the new block a ' ' alignment block with an empty string */
temp->alignment = ' ';
***************
*** 412,421 ****
if (zwgc_debug)
{ tty_str_info *ptr;
for (ptr=info; ptr; ptr=ptr->next) {
! printf("%c: %s %s %s <%s>\n", ptr->alignment,
ptr->bold_p ? "(bold)" : "",
ptr->italic_p ? "(italic)" : "",
ptr->bell_p ? "(bell)" : "",
string_CreateFromData(ptr->str, ptr->len));
}
}
--- 426,436 ----
if (zwgc_debug)
{ tty_str_info *ptr;
for (ptr=info; ptr; ptr=ptr->next) {
! printf("%c: %s %s %s %s <%s>\n", ptr->alignment,
ptr->bold_p ? "(bold)" : "",
ptr->italic_p ? "(italic)" : "",
ptr->bell_p ? "(bell)" : "",
+ ptr->munch_p ? "(munch)" : "",
string_CreateFromData(ptr->str, ptr->len));
}
}