Thread View: news.software.nn
1 messages
1 total messages
Started by Kim F. Storm
Mon, 09 Jul 1990 16:33
nn 6.4 - Official patch #7
Author: Kim F. Storm
Date: Mon, 09 Jul 1990 16:33
Date: Mon, 09 Jul 1990 16:33
2185 lines
60377 bytes
60377 bytes
This is an official patch to nn release 6.4
-------------------------------------------
PATCH #7
Priority: LOW
These patches fix a few minor bugs in the 6.4 release, and add some
new features based on patches and suggestions sent to me.
Specifically, it fixes a bug introduced in patch #6 with the new
reading mode prompt style, where the array holding the prompt could be
too small causing undefined behaviour (include core dumps).
Major new features are:
- User defined keymaps which can be bound to "prefix" keys, e.g.
make map ctl-x # create a new keymap named ctl-x
map both ^X prefix ctl-x # bind it to ^X
map ctl-x x macro 1 # bind macro 1 to ^X x
- Printed and saved headers can now be fully costumized just like the
reading mode headers via two new variables: print-header-lines and
save-header-lines which use the same syntax as the header-lines
variable.
- On colour displays, overlapping text when scrolling through an
article in reading mode can now be "shaded" using any colour or
other display attribute you like, e.g.
on term ti924-colour
set shading-on ^[ [ 3 2 m
set shading-off ^[ [ 3 7 m
set mark-overlap-shading
unset mark-overlap
end
As usual, all changes are described in the updated RELEASE_NOTES file
(read that for more details about this patch). Thanks to all who
reported bugs and provided fixes.
To apply this patch, use nn's :patch command, or run this command from
the shell in the root of the nn source tree:
patch -p0 < this-article
++Kim Storm
*** ./LAST/account.c Mon Jun 25 15:46:36 1990
--- account.c Thu Jul 5 23:45:07 1990
***************
*** 273,279 ****
putchar(NL);
}
! printf("%-8.8s %4ld.%02ld %5d %s ",
ac->ac_user,
ac->ac_total/60, ac->ac_total%60,
ac->ac_quota,
--- 273,279 ----
putchar(NL);
}
! printf("%-8.8s %4ld.%02ld %5d %-12.12s ",
ac->ac_user,
ac->ac_total/60, ac->ac_total%60,
ac->ac_quota,
*** ./LAST/aux.sh Mon Jun 25 15:46:38 1990
--- aux.sh Tue Jul 3 11:17:53 1990
***************
*** 29,34 ****
--- 29,36 ----
# MAILER_PIPE [mailer-pipe-input]
# DFLT_ANSW [response-default-answer]
+ CC=""
+
. ${HOME}/.nn/.param
# first argument is operation to be performed:
*** ./LAST/doc/PROBLEMS Sat May 5 16:16:28 1990
--- doc/PROBLEMS Thu Jul 5 21:33:10 1990
***************
*** 307,312 ****
--- 307,318 ----
are stripped to 7 bits, but articles displayed on the screen can be
shown either in 7 or 8 bit mode via the data-bits variable.
+ With patch #6 installed, nn does indeed support 8 bit input if
+ data-bits = 8. However, the positions 0x80 through 0x9f are reserved
+ for internal use, so only the various ISO 8859/* character sets are
+ *fully* supported, while some PC code pages may overlay some national
+ characters with function keys.
+
MAIL RECORDS
------------
*** ./LAST/doc/RELEASE_NOTES Mon Jun 25 15:46:39 1990
--- doc/RELEASE_NOTES Mon Jul 9 16:57:35 1990
***************
*** 883,889 ****
--- 883,930 ----
From: KFS
Fixed: Patch #6 [account.c execute.c]
+ Prog: nn
+ Title: Syntax error if MALLOC_GRAIN is defined
+ From: olson%anchor.esd@sgi.com (Dave Olson) + fix
+ Fixed: Patch #7 [nn.c]
+
+ Prog: nn
+ Title: May crash in reading mode if prompt is too long
+ From: root@ttank.ttank.com (Karl Bunch)
+ Fixed: Patch #7 [more.c (pr_fmt overflow)]
+
+ Prog: nn
+ Title: show-purpose-mode is ignored in auto-read-mode
+ From: KFS
+ Fixed: Patch #7 [menu.c]
+
+ Prog: nn
+ Title: All multi keys are named #A
+ From: dean%coplex@relay.EU.net (Dean Brooks)
+ Fixed: Patch #7 [keymap.c]
+
+ Prog: aux
+ Title: The CC variable conflicts with "standard" CC variable
+ From: Greg Christy <greg@mickey.imsd.contel.com>
+ scs@iti.org (Steve Simmons) +fix
+ Fixed: Patch #7 [aux.sh]
+
+ Prog: nnmaster expire - nntp
+ Title: nnmaster terminates if nntp server is down when expire -E1 starts.
+ From: pete@eleazar.dartmouth.edu (Pete Schmitt)
+ Fixed: Patch #7 [nntp.c]
+
+ Prog: nnacct
+ Title: AUTHORIZE without ACCOUNTING does not work
+ From: Peter J Nilsson <pjn@IDA.LiU.SE> + fix
+ Fixed: Patch #7 [account.c proto.c]
+ Prog: nn
+ Title: ~OLD~FOLDER~ is not removed when folder is compressed.
+ From: conrad@zeno.mmwb.ucsf.EDU (Conrad Huang)
+ Fixed: Patch #7 [folder.c]
+
+
New features since initial 6.4.0 release
----------------------------------------
***************
*** 1052,1054 ****
--- 1093,1137 ----
Title: Header printed by :print now configurable via print-header-type
From: KFS on request from Mikael.C.Kjaerulff@copenhagen.ncr.dk
Added: Patch #6 [save.c variable.c nn.1]
+
+ Prog: nn
+ Title: Saved/printed short headers are now fully configureable
+ via save-header-lines and print-header-lines variables.
+ From: KFS on request from leo@aai.com
+ Added: Patch #7 [save.c variable.c nn.1]
+
+ Prog: nn
+ Title: show-purpose-mode support on nntp clients.
+ From: olson%anchor.esd@sgi.com (Dave Olson)
+ Added: Patch #7 [nntp.c menu.c]
+
+ Prog: nn
+ Title: Overlap can now be "shaded" using "any" attribute (including colour)
+ via the variables: mark-overlap-shading, shading-on, sharing-off
+ From: KFS on request from Uwe Doering
+ Added: Patch #7 [more.c variable.c nn.1]
+
+ Prog: nn
+ Title: Additional keymaps can now be created and bound to "prefix key".
+ From: KFS on request from rock@Sun.COM (Bill "Rock" Petro)
+ Added: Patch #7 [init.c keymap.c keymap.h menu.c more.c variable.c nn.1]
+
+ set echo-prefix-key # echo prefix key
+ make map ctl-x # create a new keymap named ctl-x
+ map both ^X prefix ctl-x # bind it to ^X
+ map ctl-x x macro 1 # bind macro 1 to ^X x
+
+ Prog: nn
+ Title: Path: line is used in "From " line when use-path-in-from is set.
+ From: KFS on request from Bill Gaines <gatech!iccdev!bill>
+ Added: Patch #7 [save.c variable.c nn.1]
+
+ Prog: nn
+ Title: New "clear" command to clear screen (e.g. at top of init file)
+ From: KFS on request from paul@uxc.cso.uiuc.edu (Paul Pomes)
+ Added: Patch #7 [init.c]
+
+ Prog: nn
+ Title: New interactive :load command to reload init file (sequence is ignored)
+ From: KFS
+ Added: Patch #7 [init.c]
*** ./LAST/folder.c Mon Jun 25 15:46:40 1990
--- folder.c Mon Jul 9 14:51:12 1990
***************
*** 464,469 ****
--- 464,470 ----
fclose(dst);
goto move_back;
}
+ unlink(oldfile);
return;
move_back:
*** ./LAST/group.c Mon Jun 25 15:46:41 1990
--- group.c Thu Jul 5 18:06:18 1990
***************
*** 381,386 ****
--- 381,388 ----
if ((re = regcomp(name)) == NULL) return NULL;
y = any = 0;
+ if (pr && (flag & 1)) m_advinput();
+
if (flag & 1)
Loop_Groups_Sequence(gh) {
if (gh->last_db_article == 0) continue;
*** ./LAST/init.c Mon Jun 25 15:46:42 1990
--- init.c Mon Jul 9 17:10:35 1990
***************
*** 238,251 ****
"decode", 6, 0,
"define", 6, 0,
"help", 4, 2,
"local", 5, 3,
"man", 3, 0,
! "map", 3, -1,
! "map #", 5, -2,
! "map both", 8, 4,
! "map key", 7, 0,
! "map menu", 8, 4,
! "map show", 8, 4,
"mkdir", 5, 1,
"patch", 5, 0, /* QUICK HACK */
"post", 4, 0, /* QUICK HACK */
--- 238,249 ----
"decode", 6, 0,
"define", 6, 0,
"help", 4, 2,
+ "load", 4, 0,
"local", 5, 3,
+ "make", 4, -1,
+ "make map ", 9, -2,
"man", 3, 0,
! "map", 3, 4,
"mkdir", 5, 1,
"patch", 5, 0, /* QUICK HACK */
"post", 4, 0, /* QUICK HACK */
***************
*** 291,296 ****
--- 289,295 ----
int temp;
register char *p, *q;
extern int file_completion(), var_completion(), cmd_completion();
+ extern int keymap_completion();
extern int list_offset;
if (other_compl) {
***************
*** 369,380 ****
head = p;
temp++;
}
! if (temp != 1) return -1;
- other_compl = cmd_completion;
tail = NULL;
len = p - head;
! temp = cmd_completion(head, len);
break;
}
if (temp <= 0) other_compl = NULL;
--- 368,383 ----
head = p;
temp++;
}
! if (temp == 0)
! other_compl = keymap_completion;
! else if (temp == 2)
! other_compl = cmd_completion;
! else
! return -1;
tail = NULL;
len = p - head;
! temp = CALL(other_compl)(head, len);
break;
}
if (temp <= 0) other_compl = NULL;
***************
*** 565,580 ****
dump_global_map();
break;
}
! CASE( "menu" ) {
! clrdisp();
! dump_key_map(menu_key_map, "menu", K_ONLY_MENU);
! break;
! }
! CASE( "show" ) {
! clrdisp();
! dump_key_map(more_key_map, "show", K_ONLY_MORE);
break;
- }
init_message("unknown map '%s'", argv(mode_arg));
goto err;
--- 568,575 ----
dump_global_map();
break;
}
! if (dump_key_map(name) >= 0)
break;
init_message("unknown map '%s'", argv(mode_arg));
goto err;
***************
*** 629,744 ****
{
int code, map_menu, map_show, must_redraw = 0;
key_type bind_to;
!
! SWITCH( argv(1) ) {
!
! CASE( "key" ) {
! if (argv(3) == NULL) break;
! global_key_map[parse_key(argv(2))] = parse_key(argv(3));
! goto out;
}
!
! if (argv(1)[0] == '#') {
! key_type multi_buffer[16], *mb;
! int i;
!
! if (argv(1)[1] == NUL) break;
! if (isdigit(argv(1)[1]))
! bind_to = K_function(argv(1)[1] - '0');
! else {
! bind_to = parse_key(argv(1) + 1);
! if (bind_to < K_up_arrow || bind_to > K_right_arrow) break;
! }
!
! for (i = 2, mb = multi_buffer; argv(i); i++)
! *mb++ = parse_key(argv(i));
! *mb = NUL;
!
! enter_multi_key(bind_to, (key_type *)copy_str((char *)multi_buffer));
!
! goto out;
}
!
! code = K_UNBOUND;
! map_menu = map_show = 0;
!
! CASE( "menu" ) {
! map_menu++;
! }
! CASE( "show" ) {
! map_show++;
! }
! CASE( "both" ) {
! map_menu++;
! map_show++;
! }
!
! if (ARG(3, "(")) {
! extern char *m_define();
!
! code = (int)m_define("-2", initf);
! must_redraw = 1;
! if (code == K_UNBOUND) goto mac_err;
! }
!
! if (map_menu) {
! if (code == K_UNBOUND && argv(3))
! code = lookup_command(argv(3), K_ONLY_MENU);
!
! if (code == K_EQUAL_KEY) {
! if (argv(4))
! code = menu_key_map[parse_key(argv(4))];
! else
! goto mac_err;
! } else
! if (code == K_MACRO || code == K_ARTICLE_ID)
! if (argv(4))
! code |= atoi(argv(4));
! else
! goto mac_err;
!
! if (code != K_INVALID) {
! bind_to = parse_key(argv(2));
! if (code & K_MACRO && orig_menu_map[bind_to] == 0)
! orig_menu_map[bind_to] = menu_key_map[bind_to];
! menu_key_map[bind_to] = code;
! if (!map_show) goto out;
! }
! }
!
! if (map_show) {
! if (code == K_UNBOUND && argv(3))
! code = lookup_command(argv(3), K_ONLY_MORE);
!
! if (code == K_EQUAL_KEY) {
! if (argv(4))
! code = more_key_map[parse_key(argv(4))];
! else
! goto mac_err;
! } else
! if (code == K_MACRO)
! if (argv(4))
! code |= atoi(argv(4));
! else
! goto mac_err;
!
! if (code != K_INVALID) {
! more_key_map[parse_key(argv(2))] = code;
! goto out;
! }
! }
!
! if (argv(4)) break;
!
! if (code == K_INVALID) {
! init_message("unknown key command: %s", argv(3));
goto out;
}
}
!
! print_command("syntax error");
goto out;
!
mac_err:
print_command("map argument missing");
out:
--- 624,727 ----
{
int code, map_menu, map_show, must_redraw = 0;
key_type bind_to;
! register struct key_map_def *map_def;
! register int *map;
!
! code = lookup_keymap(argv(1));
! if (code < 0) {
! print_command("unknown map");
! goto out;
! }
! map_def = &keymaps[code];
!
! if (map_def->km_flag & K_GLOBAL_KEY_MAP) {
! if (argv(3) == NULL) goto mac_err;
! if (argv(2) == NULL) {
! dump_global_map();
! return 1;
}
! global_key_map[parse_key(argv(2))] = parse_key(argv(3));
! return 0;
! }
!
! if (map_def->km_flag & K_MULTI_KEY_MAP) {
! key_type multi_buffer[16], *mb;
! int i;
!
! if (argv(1)[1] == NUL) {
! dump_multi_keys();
! return 1;
}
!
! if (isdigit(argv(1)[1]))
! bind_to = K_function(argv(1)[1] - '0');
! else {
! bind_to = parse_key(argv(1) + 1);
! if (bind_to < K_up_arrow || bind_to > K_right_arrow) goto mac_err;
! }
!
! for (i = 2, mb = multi_buffer; argv(i); i++)
! *mb++ = parse_key(argv(i));
! *mb = NUL;
!
! enter_multi_key(bind_to, (key_type *)copy_str((char *)multi_buffer));
! return 0;
! }
!
! code = K_UNBOUND;
! map = map_def->km_map;
! map_show = map_def->km_flag & K_BOTH_MAPS;
! map_menu = map_def->km_flag & K_BIND_ORIG;
!
! if (ARG(3, "(")) {
! extern char *m_define();
!
! code = (int)m_define("-2", initf);
! must_redraw = 1;
! if (code == K_UNBOUND) goto mac_err;
! }
!
! if (code == K_UNBOUND && argv(3))
! code = lookup_command(argv(3), K_ONLY_MENU);
!
! switch (code) {
! case K_EQUAL_KEY:
! if (argv(4) == NULL) goto mac_err;
! code = map[parse_key(argv(4))];
! break;
!
! case K_MACRO:
! case K_ARTICLE_ID:
! if (argv(4) == NULL) goto mac_err;
! code |= atoi(argv(4));
! break;
!
! case K_PREFIX_KEY:
! if (argv(4) == NULL) goto mac_err;
! code = lookup_keymap(argv(4));
! if (code < 0) {
! print_command("unknown prefix map");
goto out;
}
+ code |= K_PREFIX_KEY;
+ break;
}
!
! if (code == K_INVALID) {
! init_message("unknown key command: %s", argv(3));
! goto out;
! }
!
! bind_to = parse_key(argv(2));
! if (map_menu) {
! if (code & K_MACRO && orig_menu_map[bind_to] == 0)
! orig_menu_map[bind_to] = map[bind_to];
! }
! map[bind_to] = code;
! if (map_show)
! more_key_map[bind_to] = code;
goto out;
!
mac_err:
print_command("map argument missing");
out:
***************
*** 946,951 ****
--- 929,951 ----
break;
}
+ CASE("make") {
+ if (ARG(1, "map") && argv(2)) {
+ switch (make_keymap(argv(2))) {
+ case -1:
+ init_message("map %s already exists", argv(2));
+ break;
+ case -2:
+ init_message("cannot make %s: too many maps", argv(2));
+ break;
+ }
+ break;
+ }
+
+ print_command("invalid make command");
+ break;
+ }
+
CASE( "cd" ) {
if (change_dir(argv(1), in_init))
init_message("chdir %s FAILED", argv(1));
***************
*** 953,958 ****
--- 953,963 ----
break;
}
+ CASE( "clear" ) {
+ clrdisp();
+ break;
+ }
+
if (in_init) {
CASE( "load" ) {
***************
*** 998,1003 ****
--- 1003,1018 ----
}
return AC_KEYCMD;
}
+ }
+
+ CASE( "load" ) {
+ clrdisp();
+ in_init = 1;
+ init_err = 0;
+ load_init_file(argv(1) ? argv(1) : "init", (FILE **)NULL, 0);
+ in_init = 0;
+ if (init_err) any_key(0);
+ return AC_REDRAW;
}
CASE( "q" ) {
*** ./LAST/keymap.c Mon Jun 25 15:46:43 1990
--- keymap.c Thu Jul 5 19:09:32 1990
***************
*** 503,508 ****
--- 503,509 ----
"patch", K_PATCH, 0,
"post", K_POST, 0,
+ "prefix", K_PREFIX_KEY, 0,
"preview", K_PREVIEW, 0,
"previous", K_PREVIOUS, 0,
"print", K_PRINT, 0,
***************
*** 536,542 ****
};
static int name_map_size;
! static int max_cmd_name_length = 14; /* recalculate if table is changed */
export key_type global_key_map[KEY_MAP_SIZE];
--- 537,543 ----
};
static int name_map_size;
! #define max_cmd_name_length 16 /* recalculate if table is changed */
export key_type global_key_map[KEY_MAP_SIZE];
***************
*** 635,640 ****
--- 636,642 ----
if (index > 0) break;
if (cmd->cmd_code == K_MACRO ||
cmd->cmd_code == K_ARTICLE_ID ||
+ cmd->cmd_code == K_PREFIX_KEY ||
cmd->cmd_code == K_EQUAL_KEY)
sprintf(tail, "%s ", cmd->cmd_name + len);
else
***************
*** 739,745 ****
default:
buf[0] = '#';
buf[1] = (c - K_function(0))
! + (c >= NORMAL_KEYS+ARROW_KEYS+MULTI_KEYS) ? 'A' : '0';
buf[2] = NUL;
goto out;
}
--- 741,747 ----
default:
buf[0] = '#';
buf[1] = (c - K_function(0))
! + (c >= K_function(MULTI_KEYS) ? 'A'-K_function(MULTI_KEYS) : '0');
buf[2] = NUL;
goto out;
}
***************
*** 793,807 ****
}
! dump_key_map(map, where, restriction)
! int map[];
char *where;
- int restriction;
{
register struct command_name_map *cnmp;
register key_type c;
register int code, first_prt;
clrdisp();
so_printf("\1KEY BINDINGS (%s)\1\n\n", where);
--- 795,812 ----
}
! dump_key_map(where)
char *where;
{
register struct command_name_map *cnmp;
register key_type c;
register int code, first_prt;
+ int *map, restriction;
+ if ((code = lookup_keymap(where)) < 0) return -1;
+ map = keymaps[code].km_map;
+ restriction = keymaps[code].km_flag & (K_ONLY_MENU | K_ONLY_MORE);
+
clrdisp();
so_printf("\1KEY BINDINGS (%s)\1\n\n", where);
***************
*** 841,847 ****
--- 846,948 ----
if (map == menu_key_map && orig_menu_map[c] != K_UNBOUND)
printf(" (%s)", command_name(orig_menu_map[c]));
}
+ else if (map[c] & K_PREFIX_KEY) {
+ if (pg_next() < 0) goto out;
+ printf("prefix %s: %s",
+ keymaps[(map[c] & ~K_PREFIX_KEY)].km_name, key_name(c));
+ }
out:
pg_end();
+ }
+
+ #define MAX_KEYMAPS 17
+
+ struct key_map_def keymaps[MAX_KEYMAPS+1] = {
+ "#", NULL, K_MULTI_KEY_MAP,
+ "key", NULL, K_GLOBAL_KEY_MAP,
+ "menu", menu_key_map, K_BIND_ORIG | K_ONLY_MENU,
+ "show", more_key_map, K_ONLY_MORE,
+ "both", menu_key_map, K_BOTH_MAPS | K_BIND_ORIG,
+ "more", more_key_map, K_ONLY_MORE,
+ "read", more_key_map, K_ONLY_MORE,
+ NULL,
+ };
+
+ lookup_keymap(name)
+ char *name;
+ {
+ register struct key_map_def *m;
+
+ if (name[0] == '#') return 0;
+
+ for (m = keymaps; m->km_name; m++) {
+ if (strcmp(name, m->km_name) == 0) return m - keymaps;
+ }
+ return keymaps - m;
+ }
+
+ make_keymap(name)
+ char *name;
+ {
+ register struct key_map_def *m;
+ register int *kp;
+ int ix;
+
+ ix = lookup_keymap(name);
+ if (ix >= 0) return -1;
+ ix = -ix;
+ if (ix == MAX_KEYMAPS) return -2;
+
+ m = &keymaps[ix];
+ m->km_name = copy_str(name);
+ m->km_map = newobj(int, KEY_MAP_SIZE);
+ m->km_flag = 0;
+ for (kp = m->km_map; kp < &(m->km_map)[KEY_MAP_SIZE]; ) *kp++ = K_UNBOUND;
+
+ return ix;
+ }
+
+ keymap_completion(buf, ix)
+ char *buf;
+ int ix;
+ {
+ static char *head, *tail = NULL;
+ static int len;
+ static struct key_map_def *map, *help_map;
+
+ if (ix < 0) return 0;
+
+ if (buf) {
+ head = buf;
+ tail = buf + ix;
+ while (*head && isspace(*head)) head++;
+ help_map = map = keymaps;
+ len = tail - head;
+
+ return 1;
+ }
+
+ if (ix) {
+ list_completion((char *)NULL);
+
+ if (help_map->km_name == NULL)
+ help_map = keymaps;
+
+ for (;help_map->km_name; help_map++) {
+ if (strncmp(help_map->km_name, head, len)) continue;
+ if (list_completion(help_map->km_name) == 0) break;
+ }
+ fl;
+ return 1;
+ }
+
+ for (; map->km_name; map++) {
+ if (len && strncmp(map->km_name, head, len)) continue;
+ strcpy(tail, map->km_name + len);
+ if (map != keymaps) strcat(tail, " ");
+ map++;
+ return 1;
+ }
+ return 0;
}
*** ./LAST/keymap.h Mon Jun 25 15:46:43 1990
--- keymap.h Thu Jul 5 17:29:40 1990
***************
*** 103,108 ****
--- 103,109 ----
#define K_MACRO 0x0100 /* call macro */
#define K_ARTICLE_ID 0x0200 /* article id in lower part */
+ #define K_PREFIX_KEY 0x0400 /* key map number in lower part */
/* keymap definitions from keymap.c */
***************
*** 112,117 ****
--- 113,122 ----
#define K_ONLY_MENU 0x0001
#define K_ONLY_MORE 0x0002
+ #define K_BOTH_MAPS 0x0004 /* map flag: for "both" */
+ #define K_BIND_ORIG 0x0008 /* map flag: must maintain orig_menu_map */
+ #define K_GLOBAL_KEY_MAP 0x0010 /* "key" */
+ #define K_MULTI_KEY_MAP 0x0020 /* "#..." */
typedef unsigned char key_type;
***************
*** 123,125 ****
--- 128,139 ----
extern char *key_name();
extern key_type parse_key();
+
+ struct key_map_def {
+ char *km_name; /* key map name */
+ int *km_map; /* key map table */
+
+ int km_flag; /* flags */
+ };
+
+ extern struct key_map_def keymaps[];
*** ./LAST/macro.c Mon Jun 25 15:46:43 1990
--- macro.c Fri Jun 29 23:46:47 1990
***************
*** 453,458 ****
--- 453,460 ----
if (m_level == 0)
no_advance = 0;
+ else if (m == NULL)
+ m_level--;
else {
if (m_level > MSTACK) {
msg("Macro stack overflow");
*** ./LAST/man/nn.1.B Mon Jun 25 15:46:45 1990
--- man/nn.1.B Mon Jul 9 17:17:28 1990
***************
*** 741,746 ****
--- 741,751 ----
Change current working directory. If the directory argument is not provided,
\fInn\fP will prompt for it.
.TP
+ \fB:clear\fP
+ Clear the screen (without redraw). This may be useful at the
+ beginning of the init file (possibly guarded by "on program nn"), or
+ in some macros.
+ .TP
\fB:compile\fP
Recompile the \fIkill\fP file. This is not necessary under normal
operation since \fInn\fP automatically compiles the file on start-up
***************
*** 761,766 ****
--- 766,776 ----
\fB:help\fP [ \fIsubject\fP ]
Provide online help on the specified subject. If you omit the
subject, a list of the available topics will be given.
+ .TP
+ \fB:load\fP [ \fIfile\fP ]
+ Load the specified \fIfile\fP. If the \fIfile\fP argument is omitted,
+ the init file is reloaded.
+ The \fBsequence\fP part (if present) is ignored.
.TP
\fB:local\fP \fIvariable\fP [ \fIvalue\fP ]
Make the variable local to the current group. Subsequent changes to
*** ./LAST/man/nn.1.C Mon Jun 25 15:46:46 1990
--- man/nn.1.C Mon Jul 9 17:17:28 1990
***************
*** 377,382 ****
--- 377,387 ----
\fInn\fP will prompt for another extended command instead of redrawing
the screen (hit \fBreturn\fP to redraw).
.TP
+ \fBecho-prefix-key\fP (boolean, default true)
+ When true, hitting a prefix key (see the section on key mapping below)
+ will cause the prefix key to be echoed in the message line to indicate
+ that another key is expected.
+ .TP
\fBedit-patch-command\fP (boolean, default true)
When true, the \fB:patch\fP command will show the current
\fBpatch-command\fP and give you a chance to edit it before applying
***************
*** 631,636 ****
--- 636,648 ----
of the terminal if possible) to indicate the end of the overlap (see the
\fBoverlap\fP variable).
.TP
+ \fBmark-overlap-shading\fP (boolean, default false)
+ When set, \fInn\fP will \fIshade\fP overlapping lines (see the
+ \fBoverlap\fP variable) using the attributes defined by the
+ \fBshading-on\fP and \fBshading-off\fP variables (of if not set, with
+ the underline attribute). This is typically used to give overlapping
+ lines a different colour on terminals which have this capability.
+ .TP
\fBmessage-history\fP \fIN\fP (integer, default 15)
Specifies the maximum number, \fIN\fP, of older messages which can be
recalled with the \fB^P\fP {\fBmessage\fP} command.
***************
*** 781,786 ****
--- 793,805 ----
\fBpreview-mark-read\fP (boolean, default true)
When set, previewing an article will mark the article as read.
.TP
+ \fBprint-header-lines\fP \fIfields\fP (string, default "FDGS")
+ Specifies the list of header fields that are output when
+ an article is printed via the \fB:print\fP command and
+ \fBprint-header-type\fP is 1 (short header). The \fIfields\fP
+ specification is desctribed
+ in the section on Customized Article Headers below.
+ .TP
\fBprint-header-type\fP \fIN\fP (integer, default 1)
Specifies what kind of header is printed by the \fB:print\fP command,
corresponding to the three \fBsave-*\fP commands: \fI0\fP prints only
***************
*** 882,887 ****
--- 901,912 ----
substitute the \fI*\fP with successive numbers starting from one.
Setting this variable will cause these numbers to start from \fIN\fP+1.
.TP
+ \fBsave-header-lines\fP \fIfields\fP (string, default "FDNS")
+ Specifies the list of header fields that are saved when
+ an article is saved via the \fBO\fP {\fBsave-short\fP} command.
+ The \fIfields\fP specification is desctribed
+ in the section on Customized Article Headers below.
+ .TP
\fBsave-report\fP (boolean, default true)
When set, a message reporting the number of lines written is shown
after saving an article. Since messages are shown for a few seconds,
***************
*** 902,907 ****
--- 927,952 ----
Specifies whether the \fBfind\fP (=) command in article selection mode
will match on the subject or the sender.
.TP
+ \fBshading-on\fP \fIcode\fP... (control string, default not set)
+ Specifies the escape code to be sent to the terminal to cause
+ "shading" of the following output to the screen. This is used if the
+ \fBmark-overlap-shading\fP is set, and by the `+' attribute in the
+ \fBheader-lines\fP variable.
+ .TP
+ \fBshading-off\fP \fIcode\fP... (control string, default not set)
+ Specifies the escape code to be sent to the terminal to turn off the
+ shading defined by \fBshading-on\fP. Shading will typically
+ be done by changing the foreground colour to change, e.g.
+ .sp 0.5v
+ .nf
+ on term ti924-colour
+ set shading-on ^[ [ 3 2 m
+ set shading-off ^[ [ 3 7 m
+ set mark-overlap-shading
+ unset mark-overlap
+ end
+ .fi
+ .TP
\fBshell\fP \fIprogram\fP (string, default $SHELL)
The shell program used to execute shell escapes.
.TP
***************
*** 1078,1083 ****
--- 1123,1138 ----
Specifies how many changes need to be done to the .newsrc or select
files before they are written back to disk. The default setting
causes .newsrc to be updated every time a group has been read.
+ .TP
+ \fBuse-path-in-from\fP (boolean, default false)
+ When \fBmail-format\fP is set, saved articles will be preceded by a
+ specially formatted \&"From\ " line:
+ .br
+ From origin date
+ .br
+ Normally, the origin will be the name of the news group where the
+ article appeared, but if \fBuse-path-in-from\fP is set, the contents
+ of the "Path:" header will be used as the origin.
.TP
\fBuse-selections\fP (boolean, default true)
When set, \fInn\fP uses the selections and other article attributes
*** ./LAST/man/nn.1.D Mon Jun 25 15:46:47 1990
--- man/nn.1.D Mon Jul 9 17:17:28 1990
***************
*** 15,23 ****
customized headers will then contain exactly these header lines
\fIin the specified order\fP.
.LP
The following header line identifiers are recognized in the
! .B header-lines
! variable:
.LP
.in +8n
.ta 5m
--- 15,28 ----
customized headers will then contain exactly these header lines
\fIin the specified order\fP.
.LP
+ The same specifications are also used by the \fB:print\fP and
+ \fBsave-short\fP commands via the \fBprint-header-lines\fP and
+ \fBsave-header-lines\fP variables.
+ .LP
The following header line identifiers are recognized in the
! \fBheader-lines\fP,
! \fBprint-header-lines\fP,
! and \fBsave-header-lines\fP variables:
.LP
.in +8n
.ta 5m
***************
*** 25,30 ****
--- 30,37 ----
.br
\fBA\fP Approved:
.br
+ \fBa\fP Spool-File: (path of spool file containing the article)
+ .br
\fBB\fP Distribution:
.br
\fBD\fP Date:
***************
*** 55,60 ****
--- 62,69 ----
.br
\fBS\fP Subject:
.br
+ \fBv\fP Save-File: (the default save file for this article)
+ .br
\fBW\fP Followup-To:
.br
\fBX\fP References:
***************
*** 65,73 ****
--- 74,95 ----
.in -8n
.DT
.LP
+ The 'G' and 'g' fields will include the local article number if it is
+ known, e.g.
+ .br
+ Newsgroup: news.software.nn/754
+ .LP
+ The following special symbols are recognized in the \fBheader-lines\fP
+ variable (and ignored otherwise):
+ .LP
Preceding the identifier with an equal sign "=" or an underscore "_"
will cause the header field contents to be high-lighted or underlined.
.LP
+ A plus sign "+" will use the shading attribute defined by
+ \fBshading-on\fP and \fBshading-off\fP to high-light the field
+ contents. If no shading attribute is defined it will underline the
+ field instead.
+ .LP
Including an asterisk "*" in the list will produce the standard one
line header at that point.
.LP
***************
*** 494,499 ****
--- 516,550 ----
in reading mode is:
.sp 0.5v
\fBmap show\fP \fIkey command\fP
+ .LP
+ In addition to the direct mappings described above, the following
+ variations of the \fBmap\fP command are available:
+ .TP
+ .B User defined keymaps
+ Additional keymaps can be defined using the command
+ .sp 0.5v
+ \fBmake map\fP \fInewmap\fP
+ .sp 0.5v
+ This will create a new keymap which can initialized using normal
+ \fBmap\fP commands, e.g.
+ .sp 0.5v
+ \fBmap\fP \fInewmap key command\fP
+ .sp 0.5v
+ To activate a user-defined keymap, it must be bound to a \fIprefix key\fP:
+ .sp 0.5v
+ \fBmap\fP \fIbase-map prefix-key\fP \fBprefix\fP \fInewmap\fP
+ .sp 0.5v
+ When used, the prefix key itself does not activate a command, but
+ instead it require another key to be entered and then execute the
+ command bound to that key in the keymap which is bound to the prefix key.
+ For example, to let the key sequence "^X i" execute macro number 10 in
+ both modes, the following commands can be used:
+ .sp 0.5v
+ .nf
+ make map ctl-x
+ map ctl-x i macro 10
+ map both ^X prefix ctl-x
+ .fi
.TP
.B Mapping keys in both modes
Using the pseudo-keymap `both', it is possible to map a key to a
*** ./LAST/master.c Mon Jun 25 15:46:48 1990
--- master.c Fri Jul 6 01:57:35 1990
***************
*** 730,736 ****
#endif
if (debug_mode) {
printf("NONE (*** SLEEP ***)\n");
- continue;
}
if (trace) log_entry('T', "none");
--- 730,735 ----
***************
*** 753,759 ****
#ifdef NNTP
if (use_nntp) nntp_cleanup();
#endif
! if (!debug_mode) sleep(repeat_delay);
if (s_hangup) break;
}
--- 752,758 ----
#ifdef NNTP
if (use_nntp) nntp_cleanup();
#endif
! sleep(repeat_delay);
if (s_hangup) break;
}
*** ./LAST/menu.c Mon Jun 25 15:46:49 1990
--- menu.c Thu Jul 5 17:53:17 1990
***************
*** 13,18 ****
--- 13,19 ----
import char *news_lib_directory;
+ export int echo_prefix_key = 1; /* echo prefix keys */
export int preview_window = 0; /* size of preview window */
export int fmt_linenum = 1; /* menu line format */
export int fmt_rptsubj = 0; /* repeat identical subjects if !0 */
***************
*** 498,503 ****
--- 499,505 ----
{
extern int any_message;
register int c, map;
+ int *key_map = menu_key_map;
if (flush_typeahead) flush_input();
***************
*** 510,519 ****
map = c & ~GETC_COMMAND;
} else {
cur_key = c;
! map = menu_key_map[c];
}
if (s_hangup) map = K_QUIT;
if (map & K_ARTICLE_ID) {
article_id = map & ~K_ARTICLE_ID;
map = K_ARTICLE_ID;
--- 512,527 ----
map = c & ~GETC_COMMAND;
} else {
cur_key = c;
! map = key_map[c];
}
if (s_hangup) map = K_QUIT;
+ if (map & K_PREFIX_KEY) {
+ key_map = keymaps[map & ~K_PREFIX_KEY].km_map;
+ if (echo_prefix_key) msg("%s", key_name(cur_key));
+ goto loop;
+ }
+
if (map & K_ARTICLE_ID) {
article_id = map & ~K_ARTICLE_ID;
map = K_ARTICLE_ID;
***************
*** 598,614 ****
static get_purpose(purpose)
char *purpose;
{
! #ifdef NNTP
! return; /* newsgroups file is not available */
! #else
! FILE *f;
char line[256], group[80];
register char *cp, *pp;
register int len;
! f = open_file(relative(news_lib_directory, "newsgroups"), OPEN_READ);
! if (f == NULL) return;
!
sprintf(group, "%s\t", current_group->group_name);
len = current_group->group_name_length + 1;
--- 606,631 ----
static get_purpose(purpose)
char *purpose;
{
! static FILE *f = NULL;
! static not_avail = 0;
char line[256], group[80];
register char *cp, *pp;
register int len;
! if (not_avail) return;
! #ifdef NNTP
! if (use_nntp) {
! extern FILE *nntp_get_newsgroups();
! f = nntp_get_newsgroups();
! } else
! #endif
! f = open_file(relative(news_lib_directory, "newsgroups"), OPEN_READ);
! if (f == NULL) {
! not_avail = 1;
! return;
! }
! rewind(f);
!
sprintf(group, "%s\t", current_group->group_name);
len = current_group->group_name_length + 1;
***************
*** 620,628 ****
*pp++ = *cp++;
*pp = NUL;
}
-
- fclose(f);
- #endif
}
--- 637,642 ----
***************
*** 736,741 ****
--- 750,758 ----
auto_read = entry_check = 0;
if (repl_attr_all(0, A_AUTO_SELECT, 0)) {
k_cmd = K_READ_GROUP_UPDATE;
+ if (purpose[0])
+ strcpy(delayed_msg, purpose);
+ else
sprintf(delayed_msg, "Entering %s, %ld articles",
current_group->group_name, (long)n_articles);
goto do_auto_read;
*** ./LAST/more.c Mon Jun 25 15:46:49 1990
--- more.c Sat Jul 7 01:35:47 1990
***************
*** 32,37 ****
--- 32,38 ----
import int auto_preview_mode;
import int flush_typeahead;
import int case_fold_search;
+ import int echo_prefix_key;
import char delayed_msg[];
***************
*** 48,53 ****
--- 49,67 ----
#define LINEMAX 100 /* most articles are less than 100 lines */
+ export int mark_overlap_shading = 0;
+ export char *shade_on_attr = NULL;
+ export char *shade_off_attr = NULL;
+
+ static shadeline(on)
+ int on;
+ {
+ if (on) {
+ if (shade_on_attr) fputs(shade_on_attr, stdout); else underline(1);
+ } else
+ if (shade_off_attr) fputs(shade_off_attr, stdout); else underline(0);
+ }
+
static struct header_def {
char field;
char *text;
***************
*** 74,82 ****
--- 88,209 ----
'G', "Newsgroup", &news.ng_groups, 0,
'n', "Newsgroups", &news.ng_groups, 0,
'x', "Back-Ref", &news.ng_bref, 0,
+ 'v', "Save-File", NULL, 0,
+ 'a', "Spool-File", NULL, 0,
0
};
+ get_header_field(code, namep, valp, ah)
+ char code, **namep, **valp;
+ register article_header *ah;
+ {
+ static char special[FILENAME];
+ register struct header_def *hdef;
+ import char *folder_save_file, *default_save_file;
+ char *lp;
+
+ lp = NULL;
+ for (hdef = header_defs; hdef->field; hdef++) {
+ if (hdef->field != code) continue;
+
+ if ((ah->flag & A_DIGEST) && hdef->digest)
+ lp = *(hdef->digest);
+ if (lp == NULL && hdef->news)
+ lp = *(hdef->news);
+ break;
+ }
+
+ switch (code) {
+ case 'n':
+ case 'g':
+ if (lp == NULL) break;
+ if (!(current_group->group_flag & G_MERGED) && strchr(lp, ',') == NULL)
+ return 0;
+ if (code == 'n') break;
+ case 'G':
+ if (ah->a_number > 0) {
+ sprintf(special, "%s/%ld",
+ current_group->group_name, (long)ah->a_number);
+ lp = special;
+ } else
+ lp = current_group->group_name;
+ break;
+
+ case 'a':
+ if (current_group->group_flag & G_FOLDER)
+ lp = current_group->archive_file;
+ else
+ if (group_file_name && *group_file_name)
+ lp = group_path_name;
+ break;
+
+ case 'v':
+ if ((lp = current_group->save_file) == NULL)
+ lp = (current_group->group_flag & G_FOLDER) ?
+ folder_save_file : default_save_file;
+ if (lp == NULL) return 0;
+ if (expand_file_name(special, lp, 2)) lp = special;
+ break;
+ }
+ if (lp == NULL) return 0;
+
+ *namep = hdef->text;
+ *valp = lp;
+ return 1;
+ }
+
+ static char *scan_codes;
+ static article_header *scan_arthdr;
+
+ scan_header_fields(fields, ah)
+ char *fields;
+ article_header *ah;
+ {
+ scan_codes = fields;
+ scan_arthdr = ah;
+ }
+
+ next_header_field(namep, valp, attrp)
+ char **namep, **valp;
+ fct_type *attrp;
+ {
+ fct_type attr;
+ extern highlight(), underline();
+
+ while (*scan_codes) {
+ attr = NULL_FCT;
+ *namep = NULL;
+
+ switch (*scan_codes) {
+ case '*':
+ scan_codes++;
+ return 1; /* name == NULL */
+
+ case '=':
+ attr = highlight;
+ scan_codes++;
+ break;
+
+ case '_':
+ attr = underline;
+ scan_codes++;
+ break;
+
+ case '+':
+ attr = shadeline;
+ scan_codes++;
+ break;
+ }
+
+ if (*scan_codes == NUL) break;
+
+ if (attrp) *attrp = attr;
+ if (get_header_field(*scan_codes++, namep, valp, scan_arthdr))
+ return 1;
+ }
+ return 0;
+ }
+
static char *a_st_flags(flag)
flag_type flag;
{
***************
*** 124,129 ****
--- 251,257 ----
article_header *ah;
int mode, screen_offset;
{
+ register char *lp;
register int c, col, lno;
register FILE *art;
int more_cmd, eof, skip_spaces, has_space, window_lines;
***************
*** 132,138 ****
off_t lineposbuf[LINEMAX];
off_t *linepos = lineposbuf;
int linemax = LINEMAX;
! char linebuf[200], *lp, skip_char;
int skip_wrap;
news_header_buffer ngheader, dgheader;
struct news_header news_save;
--- 260,266 ----
off_t lineposbuf[LINEMAX];
off_t *linepos = lineposbuf;
int linemax = LINEMAX;
! char linebuf[200], skip_char;
int skip_wrap;
news_header_buffer ngheader, dgheader;
struct news_header news_save;
***************
*** 145,152 ****
article_header digestah;
char *fname, *hdrline;
extern STANDOUT;
! char pr_fmt[60], send_date[40];
! int match_expr;
char *match_start, *match_end;
int open_modes, hdr_mode, o_mode;
struct header_def *hdef;
--- 273,283 ----
article_header digestah;
char *fname, *hdrline;
extern STANDOUT;
! char pr_fmt[200], send_date[40];
! int match_expr, shade_overlap, shade_line;
! int *key_map;
! key_type cur_key;
! fct_type hdrattr;
char *match_start, *match_end;
int open_modes, hdr_mode, o_mode;
struct header_def *hdef;
***************
*** 222,237 ****
match_lines = match_redraw = match_expr = 0;
underline_line = -1;
fake_underline = 0;
stop_line = first_page_lines ? first_page_lines : -1;
if (new_read_prompt) {
import long n_selected;
if (mode & (MM_PREVIEW | MM_DIGEST) || n_selected == 0)
sprintf(pr_fmt,
"\1\2--%s-- %s%s %s--%%s--%%s\1",
! current_group->group_name,
(mode & MM_DIGEST) ? "DIGEST" :
(mode & MM_PREVIEW) ? "PREVIEW" : "LAST",
(ah->flag & A_NEXT_SAME) ? "+next" : "",
--- 353,384 ----
match_lines = match_redraw = match_expr = 0;
underline_line = -1;
fake_underline = 0;
+ shade_overlap = 0;
stop_line = first_page_lines ? first_page_lines : -1;
if (new_read_prompt) {
import long n_selected;
+ char *xp, *group_name = current_group->group_name;
+ int len, maxl;
+ maxl = novice ? 18 : 25;
+
+ if ((len = strlen(group_name)) > maxl) {
+ for (xp = group_name + len - maxl; *xp; xp++) {
+ if (*xp == '.') break;
+ if (*xp == '/') { xp++; break; }
+ }
+ if (*xp)
+ group_name = xp;
+ else
+ group_name += len - maxl;
+ }
+
if (mode & (MM_PREVIEW | MM_DIGEST) || n_selected == 0)
sprintf(pr_fmt,
"\1\2--%s-- %s%s %s--%%s--%%s\1",
! group_name,
(mode & MM_DIGEST) ? "DIGEST" :
(mode & MM_PREVIEW) ? "PREVIEW" : "LAST",
(ah->flag & A_NEXT_SAME) ? "+next" : "",
***************
*** 239,245 ****
else
sprintf(pr_fmt,
"\1\2--%s-- %ld MORE%s %s--%%s--%%s\1",
! current_group->group_name,
n_selected,
(ah->flag & A_NEXT_SAME) ? "+next" : "",
novice ? "--help:?" : "");
--- 386,392 ----
else
sprintf(pr_fmt,
"\1\2--%s-- %ld MORE%s %s--%%s--%%s\1",
! group_name,
n_selected,
(ah->flag & A_NEXT_SAME) ? "+next" : "",
novice ? "--help:?" : "");
***************
*** 315,397 ****
if (hdrline && screen_offset == 0) {
! hdr_mode = 0;
! while (*hdrline) {
!
! if (*hdrline == '*') goto print_header;
! if (*hdrline == '=') {
! hdr_mode = 1;
! hdrline++;
! continue;
! }
! if (*hdrline == '_') {
! hdr_mode = 2;
! hdrline++;
! continue;
! }
! for (hdef = header_defs; hdef->field; hdef++) {
! if (hdef->field != *hdrline) continue;
! if (in_digest) {
! if (hdef->digest == NULL) break;
! if ((lp = *(hdef->digest)) == NULL)
break;
- } else
- if ((lp = *(hdef->news)) == NULL)
- break;
- if (*hdrline == 'n' || *hdrline == 'g')
- if ((current_group->group_flag & G_MERGED) == 0 &&
- strchr(lp, ',') == NULL) break;
- if (*hdrline == 'g' || *hdrline == 'G')
- lp = current_group->group_name;
-
- gotoxy(0, lno++);
- printf("%s: ", hdef->text);
- c = col = strlen(hdef->text) + 2;
- split_header_line:
- switch (hdr_mode) {
- case 0:
- break;
- case 1:
- highlight(1);
- break;
- case 2:
- underline(1);
- break;
- }
- while (*lp && c < Columns) {
- if (isspace(*lp)) {
- while (lp[1] && isspace(lp[1])) lp++;
- if (wrap_headers > 0 &&
- (c + wrap_headers) >= Columns &&
- strlen(lp) >= wrap_headers) {
- lp++;
- break;
- }
- *lp = SP;
}
! putchar(*lp++);
! c++;
! }
! switch (hdr_mode) {
! case 0:
! break;
! case 1:
! highlight(0);
! break;
! case 2:
! underline(0);
! break;
}
! if (*lp && wrap_headers >= 0) {
! gotoxy(col, lno++);
! c = col;
! goto split_header_line;
! }
! break;
}
- hdr_mode = 0;
- hdrline++;
}
hdrline = NULL;
--- 462,503 ----
if (hdrline && screen_offset == 0) {
! scan_header_fields(hdrline, ah);
! while (next_header_field(&fname, &hdrline, &hdrattr)) {
! if (fname == NULL) {
! hdrline = --scan_codes; /* this is a hack! */
! goto print_header;
! }
! lp = hdrline;
!
! gotoxy(0, lno++);
! printf("%s: ", fname);
! c = col = strlen(fname) + 2;
!
! split_header_line:
! if (hdrattr) CALL(hdrattr)(1);
!
! while (*lp && c < Columns) {
! if (isspace(*lp)) {
! while (lp[1] && isspace(lp[1])) lp++;
! if (wrap_headers > 0 &&
! (c + wrap_headers) >= Columns &&
! strlen(lp) >= wrap_headers) {
! lp++;
break;
}
! *lp = SP;
}
! putchar(*lp++);
! c++;
! }
! if (hdrattr) CALL(hdrattr)(0);
! if (*lp && wrap_headers >= 0) {
! gotoxy(col, lno++);
! c = col;
! goto split_header_line;
}
}
hdrline = NULL;
***************
*** 417,422 ****
--- 523,529 ----
extra_lines = print_lines - stop_line;
print_lines = stop_line;
underline_line = -1;
+ shade_overlap = 0;
}
stop_line = 0;
} else
***************
*** 621,626 ****
--- 728,734 ----
if (overlap > 0) {
underline_line = linenum - 1;
linenum -= overlap + 1;
+ shade_overlap = mark_overlap_shading;
goto next_page;
}
}
***************
*** 647,652 ****
--- 755,767 ----
/* now print the line */
+ shade_line = 0;
+ if ((shade_overlap > 0 && linenum <= underline_line) ||
+ (shade_overlap < 0 && linenum > underline_line)) {
+ if (match_redraw) goto no_print;
+ match_start = NULL;
+ shade_line = 1;
+ } else
if (match_lines && underline_line != linenum &&
regexec_cf(regular_expr, linebuf)) {
match_start = regular_expr->startp[0];
***************
*** 659,664 ****
--- 774,782 ----
gotoxy(0, lno);
if (!scroll_clear_page) clrline();
+ if (shade_line)
+ shadeline(1);
+ else
if (mark_overlap && underline_line == linenum)
if (!underline(1))
fake_underline = 1;
***************
*** 695,700 ****
--- 813,825 ----
if (match_start) highlight(0);
+ if (shade_line) {
+ shadeline(0);
+ if (shade_overlap > 0 && underline_line == linenum) {
+ underline_line = -1;
+ shade_overlap = 0;
+ }
+ } else
if (mark_overlap && underline_line == linenum) {
while (lp - linebuf < 10) {
putchar(fake_underline ? '_' : ' ');
***************
*** 710,715 ****
--- 835,845 ----
++lno;
if (--print_lines > 0 && s_keyboard == 0 && form_feed == 0) goto next_line;
+ if (shade_overlap) {
+ underline_line = -1;
+ shade_overlap = 0;
+ }
+
if (!eof && linenum >= maxline) {
if (ignore_nl) {
c = getc(art);
***************
*** 753,765 ****
if (flush_typeahead) flush_input();
if ((c = get_c()) & GETC_COMMAND)
c &= ~GETC_COMMAND;
else
! c = more_key_map[c];
if (s_hangup) c = K_QUIT;
if (any_message && c != K_LAST_MESSAGE) clrmsg(0);
if (c & K_MACRO) {
--- 883,904 ----
if (flush_typeahead) flush_input();
+ key_map = more_key_map;
+
+ prefix_key:
if ((c = get_c()) & GETC_COMMAND)
c &= ~GETC_COMMAND;
else
! c = key_map[cur_key = c];
if (s_hangup) c = K_QUIT;
+ if (c & K_PREFIX_KEY) {
+ key_map = keymaps[c & ~K_PREFIX_KEY].km_map;
+ if (echo_prefix_key) msg("%s", key_name(cur_key));
+ goto prefix_key;
+ }
+
if (any_message && c != K_LAST_MESSAGE) clrmsg(0);
if (c & K_MACRO) {
***************
*** 797,802 ****
--- 936,942 ----
if (linenum > overlap) {
underline_line = linenum;
linenum -= overlap;
+ shade_overlap = mark_overlap_shading;
}
}
goto next_page;
***************
*** 1012,1017 ****
--- 1152,1158 ----
if (topline <= 1) goto Prompt;
linenum = topline - window_lines + overlap; /* not perfect after FF */
underline_line = topline;
+ shade_overlap = -mark_overlap_shading;
if (linenum < 1) linenum = 1;
goto next_page;
*** ./LAST/nn.c Mon Jun 25 15:46:50 1990
--- nn.c Tue Jun 26 11:25:28 1990
***************
*** 557,563 ****
mallopt(M_NLBLKS, MALLOC_FASTBLOCKS);
#endif
#ifdef MALLOC_GRAIN
! mallopt(M_GRAIN, MALLOC_GRAIN));
#endif
#endif
--- 557,563 ----
mallopt(M_NLBLKS, MALLOC_FASTBLOCKS);
#endif
#ifdef MALLOC_GRAIN
! mallopt(M_GRAIN, MALLOC_GRAIN);
#endif
#endif
*** ./LAST/nntp.c Tue Jun 12 11:47:00 1990
--- nntp.c Thu Jul 5 12:57:33 1990
***************
*** 788,793 ****
--- 788,838 ----
}
/*
+ * nntp_get_newsgroups: get a copy of the newsgroups file.
+ *
+ * Use the "LIST NEWSGROUPS" command to get the newsgroup descriptions.
+ * Based on code from: olson%anchor.esd@sgi.com (Dave Olson)
+ */
+
+ FILE *nntp_get_newsgroups()
+ {
+ char *new_name;
+ FILE *new = NULL;
+ int n;
+
+ new_name = mktemp(relative(tmp_directory, "nngrXXXXXX"));
+ new = open_file(new_name, OPEN_CREATE_RW|OPEN_UNLINK);
+ if (new == NULL) return NULL;
+
+ again:
+ if (!is_connected && connect_server() < 0) goto err;
+
+ switch (n = ask_server("LIST NEWSGROUPS")) {
+ case OK_GROUPS:
+ if (copy_text(new) == 0) {
+ if (fflush(new) != EOF) break;
+ fclose(new);
+ }
+ if (!nntp_failed) {
+ log_entry('N', "LIST NEWSGROUPS empty");
+ nntp_failed = 1;
+ }
+ return NULL;
+
+ default:
+ if (try_again) goto again; /* Handle nntp server timeouts */
+ log_entry('N', "LIST NEWSGROUPS response: %d", n);
+ goto err;
+ }
+ rewind(new);
+ return new;
+
+ err:
+ fclose(new);
+ return NULL;
+ }
+
+ /*
* nntp_get_article_list: get list of all article numbers in group
*
* Sends XHDR command to the server, and parses the following
***************
*** 834,839 ****
--- 879,885 ----
default:
if (try_again) goto again; /* Handle nntp server timeouts */
log_entry('N', "LISTGROUP response: %d", n);
+ return NULL;
case ERR_COMMAND:
try_listgroup = 0;
goto again; /* error may have closed down server connection */
***************
*** 857,862 ****
--- 903,909 ----
default:
if (try_again) goto again; /* Handle nntp server timeouts */
log_entry('N', "XHDR response: %d", n);
+ return NULL;
case ERR_COMMAND:
nntp_failed = 2;
return NULL;
*** ./LAST/patchlevel.h Mon Jun 25 15:46:51 1990
--- patchlevel.h Mon Jul 9 14:51:13 1990
***************
*** 17,23 ****
* 1990-05-29: Patch #4 (6.4.4) - HIGH
* 1990-06-11: Patch #5 (6.4.5) - MEDIUM
* 1990-06-25: Patch #6 (6.4.6) - MEDIUM
*/
! #define PATCHLEVEL 6
--- 17,24 ----
* 1990-05-29: Patch #4 (6.4.4) - HIGH
* 1990-06-11: Patch #5 (6.4.5) - MEDIUM
* 1990-06-25: Patch #6 (6.4.6) - MEDIUM
+ * 1990-07-09: Patch #7 (6.4.7) - LOW
*/
! #define PATCHLEVEL 7
*** ./LAST/proto.c Tue May 29 18:36:37 1990
--- proto.c Thu Jul 5 23:45:04 1990
***************
*** 10,15 ****
--- 10,21 ----
#include <pwd.h>
#include "proto.h"
+ #ifndef ACCOUNTING
+ #ifdef AUTHORIZE
+ #define ACCOUNTING
+ #endif
+ #endif
+
import char *master_directory, *db_directory;
/*
*** ./LAST/save.c Mon Jun 25 15:46:51 1990
--- save.c Fri Jul 6 00:43:49 1990
***************
*** 16,21 ****
--- 16,22 ----
export int suggest_save_file = 1;
export char *unshar_header_file = "Unshar.Headers";
export int use_mail_folders = 0;
+ export int use_path_in_from = 0;
export int use_mmdf_folders = 0;
export int save_report = 1;
export int quick_save = 0;
***************
*** 22,27 ****
--- 23,32 ----
export int conf_append = 0;
export int conf_create = 1;
+ export char *print_header_lines = "FDGS";
+ export char *save_header_lines = "FDNS";
+ static char *short_header_lines;
+
export char *save_counter_format = "%d"; /* format of save counter */
export int save_counter_offset = 0;
***************
*** 67,75 ****
static int open_mode[] = {
SKIP_HEADER,
! FILL_NEWS_HEADER | SKIP_HEADER,
0,
! FILL_DIGEST_HEADER | SKIP_HEADER
};
static FILE *save_file; /* output stream for saved files */
--- 72,80 ----
static int open_mode[] = {
SKIP_HEADER,
! FILL_NEWS_HEADER | SKIP_HEADER | GET_ALL_FIELDS,
0,
! FILL_NEWS_HEADER | FILL_DIGEST_HEADER | SKIP_HEADER | GET_ALL_FIELDS
};
static FILE *save_file; /* output stream for saved files */
***************
*** 155,160 ****
--- 160,166 ----
char *ckdir_path();
uniq_counter = 0;
+ short_header_lines = save_header_lines;
switch (command) {
***************
*** 297,302 ****
--- 303,309 ----
print_header_type = NO_HEADER;
}
+ short_header_lines = print_header_lines;
save_mode = print_header_type | IS_PIPE;
if (!shell_restrictions && edit_print_command) {
***************
*** 387,392 ****
--- 394,400 ----
register FILE *art;
register c, lcount, mode;
news_header_buffer hdrbuf;
+ news_header_buffer dghdrbuf;
int was_raw = 0, set_visual = 0;
char copybuf[FILENAME * 4], uniqbuf[FILENAME];
flag_type st_flag = A_ST_FILED;
***************
*** 398,404 ****
if (mode == SHORT_HEADER && ah->flag & A_DIGEST)
mode = SHORT_HEADER_DG;
! art = open_news_article(ah, open_mode[mode], hdrbuf, (char *)NULL);
if (art == NULL) {
msg("Cannot read %s", group_path_name);
return 0;
--- 406,416 ----
if (mode == SHORT_HEADER && ah->flag & A_DIGEST)
mode = SHORT_HEADER_DG;
! c = open_mode[mode];
! if (use_mail_folders && use_path_in_from && (c & FILL_NEWS_HEADER) == 0)
! c |= FILL_NEWS_HEADER | GET_ALL_FIELDS;
!
! art = open_news_article(ah, c, hdrbuf, dghdrbuf);
if (art == NULL) {
msg("Cannot read %s", group_path_name);
return 0;
***************
*** 494,515 ****
putc(c, save_file);
}
} else
! if (mode == SHORT_HEADER) {
! if (news.ng_from)
! fprintf(save_file, "From: %s\n", news.ng_from);
! if (news.ng_date)
! fprintf(save_file, "Date: %s\n", news.ng_date);
! if (news.ng_subj)
! fprintf(save_file, "Subject: %s\n", news.ng_subj);
! fputc(NL, save_file);
! } else
! if (mode == SHORT_HEADER_DG) {
! if (digest.dg_from)
! fprintf(save_file, "From: %s\n", digest.dg_from);
! if (digest.dg_date)
! fprintf(save_file, "Date: %s\n", digest.dg_date);
! if (digest.dg_subj)
! fprintf(save_file, "Subject: %s\n", digest.dg_subj);
fputc(NL, save_file);
}
--- 506,518 ----
putc(c, save_file);
}
} else
! if (mode == SHORT_HEADER || mode == SHORT_HEADER_DG) {
! char *name, *val;
! scan_header_fields(short_header_lines, ah->flag & A_DIGEST);
! while (next_header_field(&name, &val, (fct_type *)NULL)) {
! if (name == NULL) continue;
! fprintf(save_file, "%s: %s\n", name, val);
! }
fputc(NL, save_file);
}
***************
*** 653,658 ****
--- 656,662 ----
if (use_mail_folders) {
now = cur_time();
fprintf(f, "From %s %s",
+ (use_path_in_from && news.ng_path) ? news.ng_path :
current_group->group_name, ctime(&now));
return 1;
}
*** ./LAST/variable.c Mon Jun 25 15:46:52 1990
--- variable.c Thu Jul 5 19:54:29 1990
***************
*** 34,41 ****
--- 34,45 ----
*pager,
patch_command[],
printer[],
+ *print_header_lines,
*response_dflt_answer,
*save_counter_format,
+ *save_header_lines,
+ *shade_on_attr,
+ *shade_off_attr,
*spell_checker,
*trusted_escapes,
unshar_command[],
***************
*** 64,69 ****
--- 68,74 ----
dont_sort_articles,
dont_sort_folders,
dont_split_digests,
+ echo_prefix_key,
edit_patch_command,
edit_print_command,
edit_unshar_command,
***************
*** 83,88 ****
--- 88,94 ----
macro_debug,
mailer_pipe_input,
mark_overlap,
+ mark_overlap_shading,
match_parts_equal,
monitor_mode,
new_read_prompt,
***************
*** 109,114 ****
--- 115,121 ----
tidy_newsrc,
use_mail_folders,
use_mmdf_folders,
+ use_path_in_from,
use_selections,
use_visible_bell;
***************
*** 233,238 ****
--- 240,246 ----
"default-kill-select", INT 0, (char **)&dflt_kill_select,
"default-save-file", STR 3, (char **)&default_save_file,
"delay-redraw", BOOL 0, (char **)&delay_redraw,
+ "echo-prefix-key", BOOL 0, (char **)&echo_prefix_key,
"edit-patch-command", BOOL 0, (char **)&edit_patch_command,
"edit-print-command", BOOL 0, (char **)&edit_print_command,
"edit-response-check", BOOL 0, (char **)&empty_answer_check,
***************
*** 273,278 ****
--- 281,287 ----
"mailer", STR 0, (char **)&mailer_program,
"mailer-pipe-input", BOOL 0, (char **)&mailer_pipe_input,
"mark-overlap", BOOL 0, (char **)&mark_overlap,
+ "mark-overlap-shading", BOOL 0, (char **)&mark_overlap_shading,
"marked-by-next-group", INT 0, (char **)&mark_next_group,
"marked-by-read-return", INT 0, (char **)&mark_read_return,
"marked-by-read-skip", INT 0, (char **)&mark_read_skip,
***************
*** 299,304 ****
--- 308,314 ----
"patch-command", STR SAFE 1, (char **)patch_command,
"preview-continuation", INT 0, (char **)&preview_continuation,
"preview-mark-read", BOOL 0, (char **)&preview_mark_read,
+ "print-header-lines", STR 0, (char **)&print_header_lines,
"print-header-type", INT 0, (char **)&print_header_type,
"printer", STR SAFE 1, (char **)printer,
"query-signature", BOOL 0, (char **)&query_signature,
***************
*** 316,325 ****
--- 326,338 ----
"retry-on-error", INT 0, (char **)&retry_on_error,
"save-counter", STR 3, (char **)&save_counter_format,
"save-counter-offset", INT 0, (char **)&save_counter_offset,
+ "save-header-lines", STR 0, (char **)&save_header_lines,
"save-report", BOOL 0, (char **)&save_report,
"scroll-clear-page", BOOL 0, (char **)&scroll_clear_page,
"select-leave-next", BOOL 0, (char **)&select_leave_next,
"select-on-sender", BOOL 0, (char **)&select_on_sender,
+ "shading-off", STR 0, (char **)&shade_off_attr,
+ "shading-on", STR 0, (char **)&shade_on_attr,
"shell", STR SAFE 0, (char **)&user_shell,
"shell-restrictions", BOOL INIT 0, (char **)&shell_restrictions,
"show-purpose-mode", INT 0, (char **)&show_purpose_mode,
***************
*** 342,347 ****
--- 355,361 ----
"unshar-header-file", STR 0, (char **)&unshar_header_file,
"unsubscribe-mark-read", BOOL 4, (char **)&keep_unsub_long,
"update-frequency", INT 0, (char **)&newsrc_update_freq,
+ "use-path-in-from", BOOL 0, (char **)&use_path_in_from,
"use-selections", BOOL 0, (char **)&use_selections,
"visible-bell", BOOL 0, (char **)&use_visible_bell,
"window", INT 1, (char **)&preview_window,
--
Kim F. Storm <storm@texas.dk> No news is good news,
Texas Instruments A/S, Denmark but nn is better!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads