67
68
N_("Moving within a node:\n\
68
69
---------------------\n"),
70
N_("\\%-10[beginning-of-node] Go to the beginning of this node.\n"),
71
N_("\\%-10[end-of-node] Go to the end of this node.\n"),
72
N_("\\%-10[next-line] Scroll forward 1 line.\n"),
73
N_("\\%-10[prev-line] Scroll backward 1 line.\n"),
69
74
N_("\\%-10[scroll-forward] Scroll forward a page.\n"),
70
75
N_("\\%-10[scroll-backward] Scroll backward a page.\n"),
71
N_("\\%-10[beginning-of-node] Go to the beginning of this node.\n"),
72
N_("\\%-10[end-of-node] Go to the end of this node.\n"),
73
N_("\\%-10[scroll-forward] Scroll forward 1 line.\n"),
74
N_("\\%-10[scroll-backward] Scroll backward 1 line.\n"),
76
77
N_("Other commands:\n\
77
78
---------------\n"),
240
242
int length_so_far;
241
243
int desired_doc_start = 40; /* Must be multiple of 8. */
243
printf_to_message_buffer ("(%s)", name);
245
printf_to_message_buffer ("(%s)", name, NULL, NULL);
244
246
length_so_far = message_buffer_length_this_line ();
246
if ((desired_doc_start + strlen (doc)) >= the_screen->width)
247
printf_to_message_buffer ("\n ");
248
if ((desired_doc_start + strlen (doc))
249
>= (unsigned int) the_screen->width)
250
printf_to_message_buffer ("\n ", NULL, NULL, NULL);
250
253
while (length_so_far < desired_doc_start)
252
printf_to_message_buffer ("\t");
255
printf_to_message_buffer ("\t", NULL, NULL, NULL);
253
256
length_so_far += character_width ('\t', length_so_far);
257
260
#endif /* NAMED_FUNCTIONS */
258
printf_to_message_buffer ("%s\n", doc);
261
printf_to_message_buffer ("%s\n", doc, NULL, NULL);
261
264
free (new_prefix);
299
302
? _(info_internal_help_text[i])
300
303
: info_internal_help_text[i];
301
304
char *key = info_help_keys_text[i][vi_keys_p];
303
306
/* If we have only one window (because the window size was too
304
307
small to split it), CTRL-x 0 doesn't work to `quit' help. */
305
308
if (STREQ (key, "CTRL-x 0") && help_is_only_window_p)
308
printf_to_message_buffer (msg, key);
311
printf_to_message_buffer (msg, key, NULL, NULL);
309
312
#endif /* !INFOKEY */
312
printf_to_message_buffer ("---------------------\n\n");
313
printf_to_message_buffer (_("The current search path is:\n"));
314
printf_to_message_buffer (" %s\n", infopath);
315
printf_to_message_buffer ("---------------------\n\n");
316
printf_to_message_buffer (_("Commands available in Info windows:\n\n"));
315
printf_to_message_buffer ("---------------------\n\n", NULL, NULL, NULL);
316
printf_to_message_buffer ((char *) _("The current search path is:\n"),
318
printf_to_message_buffer (" %s\n", infopath, NULL, NULL);
319
printf_to_message_buffer ("---------------------\n\n", NULL, NULL, NULL);
320
printf_to_message_buffer ((char *) _("Commands available in Info windows:\n\n"),
317
322
dump_map_to_message_buffer ("", info_keymap);
318
printf_to_message_buffer ("---------------------\n\n");
319
printf_to_message_buffer (_("Commands available in the echo area:\n\n"));
323
printf_to_message_buffer ("---------------------\n\n", NULL, NULL, NULL);
324
printf_to_message_buffer ((char *) _("Commands available in the echo area:\n\n"),
320
326
dump_map_to_message_buffer ("", echo_area_keymap);
322
328
#if defined (NAMED_FUNCTIONS)
329
335
InfoCommand *cmd = DocInfoCmd(&function_doc_array[i]);
331
if (InfoFunction(cmd) != info_do_lowercase_version
332
&& !where_is_internal (info_keymap, cmd)
337
if (InfoFunction(cmd) != (VFunction *) info_do_lowercase_version
338
&& !where_is_internal (info_keymap, cmd)
333
339
&& !where_is_internal (echo_area_keymap, cmd))
335
341
if (!printed_one_mx)
337
printf_to_message_buffer ("---------------------\n\n");
338
if (exec_keys && exec_keys[0])
339
printf_to_message_buffer
340
(_("The following commands can only be invoked via %s:\n\n"), exec_keys);
342
printf_to_message_buffer
343
(_("The following commands cannot be invoked at all:\n\n"));
343
printf_to_message_buffer ("---------------------\n\n",
345
if (exec_keys && exec_keys[0])
346
printf_to_message_buffer
347
((char *) _("The following commands can only be invoked via %s:\n\n"),
348
exec_keys, NULL, NULL);
350
printf_to_message_buffer
351
((char *) _("The following commands cannot be invoked at all:\n\n"),
344
353
printed_one_mx = 1;
347
356
printf_to_message_buffer
350
359
function_doc_array[i].func_name,
351
360
replace_in_documentation (strlen (function_doc_array[i].doc)
352
? _(function_doc_array[i].doc)
361
? (char *) _(function_doc_array[i].doc) : "", 0)
359
367
if (printed_one_mx)
360
printf_to_message_buffer ("\n");
368
printf_to_message_buffer ("\n", NULL, NULL, NULL);
362
370
maybe_free (exec_keys);
363
371
#endif /* NAMED_FUNCTIONS */
365
373
printf_to_message_buffer
366
374
("%s", replace_in_documentation
367
(_("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n")));
375
((char *) _("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"), 0),
368
377
node = message_buffer_to_node ();
369
378
internal_info_help_node_contents = node->contents;
686
691
char *keyname, *message, *fundoc, *funname = "";
688
693
#if defined (INFOKEY)
689
/* If the key is bound to do-lowercase-version, but its
690
lower-case variant is undefined, say that this key is
691
also undefined. This is especially important for unbound
692
edit keys that emit an escape sequence: it's terribly
693
confusing to see a message "Home (do-lowercase-version)"
694
or some such when Home is unbound. */
695
if (InfoFunction(map[keystroke].function) == info_do_lowercase_version)
697
unsigned char lowerkey = Meta_p(keystroke)
698
? Meta (tolower (UnMeta (keystroke)))
699
: tolower (keystroke);
694
/* If the key is bound to do-lowercase-version, but its
695
lower-case variant is undefined, say that this key is
696
also undefined. This is especially important for unbound
697
edit keys that emit an escape sequence: it's terribly
698
confusing to see a message "Home (do-lowercase-version)"
699
or some such when Home is unbound. */
700
if (InfoFunction(map[keystroke].function)
701
== (VFunction *) info_do_lowercase_version)
703
unsigned char lowerkey = Meta_p(keystroke)
704
? Meta (tolower (UnMeta (keystroke)))
705
: tolower (keystroke);
701
if (map[lowerkey].function == (InfoCommand *)NULL)
703
message_in_echo_area (_("%s is undefined."),
704
pretty_keyseq (keys));
707
if (map[lowerkey].function == (InfoCommand *)NULL)
709
message_in_echo_area ((char *) _("%s is undefined."),
710
pretty_keyseq (keys), NULL);
710
keyname = pretty_keyseq (keys);
716
keyname = pretty_keyseq (keys);
712
718
#if defined (NAMED_FUNCTIONS)
713
719
funname = function_name (map[keystroke].function);
906
906
/* Is this the start of a replaceable function name? */
907
907
if (string[i] == '\\')
915
if (string[++j] == '-')
917
if (isdigit(string[j]))
919
min = atoi(string + j);
920
while (isdigit(string[j]))
922
if (string[j] == '.' && isdigit(string[j + 1]))
925
max = atoi(string + j);
926
while (isdigit(string[j]))
929
fmt = (char *)xmalloc (j - i + 2);
930
strncpy (fmt, string + i + 1, j - i);
931
fmt[j - i - 1] = 's';
937
if (string[j] == '[')
941
char *rep_name, *fun_name, *rep;
942
InfoCommand *command;
946
/* Copy in the old text. */
947
strncpy (result + next, string + start, i - start);
951
/* Look for an optional numeric arg. */
953
if (isdigit(string[i])
954
|| (string[i] == '-' && isdigit(string[i + 1])) )
956
arg = atoi(string + i);
957
if (string[i] == '-')
959
while (isdigit(string[i]))
964
/* Move to the end of the function name. */
965
for (i = start; string[i] && (string[i] != ']'); i++);
967
rep_name = (char *)xmalloc (1 + i - start);
968
strncpy (rep_name, string + start, i - start);
969
rep_name[i - start] = '\0';
971
/* If we have only one window (because the window size was too
972
small to split it), we have to quit help by going back one
973
noew in the history list, not deleting the window. */
974
if (strcmp (rep_name, "quit-help") == 0)
975
fun_name = help_is_only_window_p ? "history-node"
980
/* Find a key which invokes this function in the info_keymap. */
981
command = named_function (fun_name);
985
/* If the internal documentation string fails, there is a
986
serious problem with the associated command's documentation.
987
We croak so that it can be fixed immediately. */
995
argrep = where_is (info_keymap, InfoCmd(info_add_digit_to_numeric_arg));
996
p = argrep ? strrpbrk (argrep, "0123456789-") : NULL;
999
argstr = (char *)xmalloc (p - argrep + 21);
1000
strncpy (argstr, argrep, p - argrep);
1001
sprintf (argstr + (p - argrep), "%d", arg);
1006
rep = command ? where_is (info_keymap, command) : NULL;
1009
replen = (argstr ? strlen (argstr) + 1 : 0) + strlen (rep);
1010
repstr = (char *)xmalloc (replen);
1014
strcat(repstr, argstr);
1015
strcat(repstr, " ");
1018
strcat(repstr, rep);
1027
if (next + replen > reslen)
1029
reslen = next + replen + 1;
1030
result = (char *)xrealloc (result, reslen + 1);
1034
sprintf (result + next, fmt, repstr);
1036
strcpy (result + next, repstr);
1038
next = strlen (result);
915
if (string[++j] == '-')
917
if (isdigit(string[j]))
919
min = atoi(string + j);
920
while (isdigit(string[j]))
922
if (string[j] == '.' && isdigit(string[j + 1]))
925
max = atoi(string + j);
926
while (isdigit(string[j]))
929
fmt = (char *)xmalloc (j - i + 2);
930
strncpy (fmt, string + i + 1, j - i);
931
fmt[j - i - 1] = 's';
937
if (string[j] == '[')
941
char *rep_name, *fun_name, *rep;
942
InfoCommand *command;
946
/* Copy in the old text. */
947
strncpy (result + next, string + start, i - start);
951
/* Look for an optional numeric arg. */
953
if (isdigit(string[i])
954
|| (string[i] == '-' && isdigit(string[i + 1])) )
956
arg = atoi(string + i);
957
if (string[i] == '-')
959
while (isdigit(string[i]))
964
/* Move to the end of the function name. */
965
for (i = start; string[i] && (string[i] != ']'); i++);
967
rep_name = (char *)xmalloc (1 + i - start);
968
strncpy (rep_name, string + start, i - start);
969
rep_name[i - start] = '\0';
971
/* If we have only one window (because the window size was too
972
small to split it), we have to quit help by going back one
973
noew in the history list, not deleting the window. */
974
if (strcmp (rep_name, "quit-help") == 0)
975
fun_name = help_is_only_window_p ? "history-node"
980
/* Find a key which invokes this function in the info_keymap. */
981
command = named_function (fun_name);
985
/* If the internal documentation string fails, there is a
986
serious problem with the associated command's documentation.
987
We croak so that it can be fixed immediately. */
995
argrep = where_is (info_keymap, InfoCmd(info_add_digit_to_numeric_arg));
996
p = argrep ? strrpbrk (argrep, "0123456789-") : NULL;
999
argstr = (char *)xmalloc (p - argrep + 21);
1000
strncpy (argstr, argrep, p - argrep);
1001
sprintf (argstr + (p - argrep), "%d", arg);
1006
rep = command ? where_is (info_keymap, command) : NULL;
1009
replen = (argstr ? strlen (argstr) : 0) + strlen (rep) + 1;
1010
repstr = (char *)xmalloc (replen);
1014
strcat(repstr, argstr);
1015
strcat(repstr, " ");
1018
strcat(repstr, rep);
1027
if (next + replen > reslen)
1029
reslen = next + replen + 1;
1030
result = (char *)xrealloc (result, reslen + 1);
1034
sprintf (result + next, fmt, repstr);
1036
strcpy (result + next, repstr);
1038
next = strlen (result);
1049
1049
strcpy (result + next, string + start);
1050
1050
return (result);
1175
1177
if (!location || !location[0])
1177
info_error (_("`%s' is not on any keys"), command_name);
1179
info_error ((char *) _("`%s' is not on any keys"),
1180
command_name, NULL);
1181
1184
if (strstr (location, function_name (command)))
1182
1185
window_message_in_echo_area
1183
(_("%s can only be invoked via %s."), command_name, location);
1186
((char *) _("%s can only be invoked via %s."),
1187
command_name, location);
1185
1189
window_message_in_echo_area
1186
(_("%s can be invoked via %s."), command_name, location);
1190
((char *) _("%s can be invoked via %s."),
1191
command_name, location);
1190
info_error (_("There is no function named `%s'"), command_name);
1195
info_error ((char *) _("There is no function named `%s'"),
1196
command_name, NULL);
1193
1199
free (command_name);