summaryrefslogtreecommitdiffstats
path: root/contrib/texinfo/info
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/texinfo/info')
-rw-r--r--contrib/texinfo/info/README9
-rw-r--r--contrib/texinfo/info/dir.c4
-rw-r--r--contrib/texinfo/info/display.c2
-rw-r--r--contrib/texinfo/info/display.h2
-rw-r--r--contrib/texinfo/info/doc.h2
-rw-r--r--contrib/texinfo/info/echo-area.c4
-rw-r--r--contrib/texinfo/info/echo-area.h2
-rw-r--r--contrib/texinfo/info/filesys.c55
-rw-r--r--contrib/texinfo/info/filesys.h4
-rw-r--r--contrib/texinfo/info/footnotes.c8
-rw-r--r--contrib/texinfo/info/footnotes.h4
-rw-r--r--contrib/texinfo/info/gc.h2
-rw-r--r--contrib/texinfo/info/indices.c4
-rw-r--r--contrib/texinfo/info/indices.h2
-rw-r--r--contrib/texinfo/info/info-utils.c2
-rw-r--r--contrib/texinfo/info/info-utils.h4
-rw-r--r--contrib/texinfo/info/info.c6
-rw-r--r--contrib/texinfo/info/info.h4
-rw-r--r--contrib/texinfo/info/infodoc.c375
-rw-r--r--contrib/texinfo/info/infokey.c6
-rw-r--r--contrib/texinfo/info/infokey.h2
-rw-r--r--contrib/texinfo/info/infomap.c164
-rw-r--r--contrib/texinfo/info/infomap.h2
-rw-r--r--contrib/texinfo/info/m-x.c4
-rw-r--r--contrib/texinfo/info/man.c5
-rw-r--r--contrib/texinfo/info/man.h2
-rw-r--r--contrib/texinfo/info/nodemenu.c4
-rw-r--r--contrib/texinfo/info/nodes.c4
-rw-r--r--contrib/texinfo/info/nodes.h4
-rw-r--r--contrib/texinfo/info/search.c4
-rw-r--r--contrib/texinfo/info/search.h4
-rw-r--r--contrib/texinfo/info/session.c20
-rw-r--r--contrib/texinfo/info/session.h4
-rw-r--r--contrib/texinfo/info/signals.c167
-rw-r--r--contrib/texinfo/info/signals.h9
-rw-r--r--contrib/texinfo/info/termdep.h7
-rw-r--r--contrib/texinfo/info/terminal.c8
-rw-r--r--contrib/texinfo/info/terminal.h4
-rw-r--r--contrib/texinfo/info/tilde.c4
-rw-r--r--contrib/texinfo/info/variables.c6
-rw-r--r--contrib/texinfo/info/variables.h2
-rw-r--r--contrib/texinfo/info/window.c5
-rw-r--r--contrib/texinfo/info/window.h2
43 files changed, 577 insertions, 361 deletions
diff --git a/contrib/texinfo/info/README b/contrib/texinfo/info/README
index 5cc0791..5ea39e2 100644
--- a/contrib/texinfo/info/README
+++ b/contrib/texinfo/info/README
@@ -1,3 +1,12 @@
+$Id: README,v 1.2 2002/09/11 16:32:09 karl Exp $
+texinfo/info/README
+
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved.
+
Info 2.0 is a complete rewrite of the original standalone Info I wrote in
1987, the first program I wrote for rms. That program was something like
my second Unix program ever, and my die-hard machine language coding habits
diff --git a/contrib/texinfo/info/dir.c b/contrib/texinfo/info/dir.c
index 94380f5..626407f 100644
--- a/contrib/texinfo/info/dir.c
+++ b/contrib/texinfo/info/dir.c
@@ -1,7 +1,7 @@
/* dir.c -- how to build a special "dir" node from "localdir" files.
- $Id: dir.c,v 1.7 1998/06/28 19:51:36 karl Exp $
+ $Id: dir.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/display.c b/contrib/texinfo/info/display.c
index b6b55ff..aba4a4b 100644
--- a/contrib/texinfo/info/display.c
+++ b/contrib/texinfo/info/display.c
@@ -1,5 +1,5 @@
/* display.c -- How to display Info windows.
- $Id: display.c,v 1.7 2002/03/08 21:41:44 karl Exp $
+ $Id: display.c,v 1.1 2002/08/25 23:38:38 karl Exp $
Copyright (C) 1993, 97 Free Software Foundation, Inc.
diff --git a/contrib/texinfo/info/display.h b/contrib/texinfo/info/display.h
index 4398135..f1cf8c0 100644
--- a/contrib/texinfo/info/display.h
+++ b/contrib/texinfo/info/display.h
@@ -1,5 +1,5 @@
/* display.h -- How the display in Info is done.
- $Id: display.h,v 1.2 1997/07/15 18:37:29 karl Exp $
+ $Id: display.h,v 1.1 2002/08/25 23:38:38 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
diff --git a/contrib/texinfo/info/doc.h b/contrib/texinfo/info/doc.h
index 53597d1..00c22e5 100644
--- a/contrib/texinfo/info/doc.h
+++ b/contrib/texinfo/info/doc.h
@@ -1,5 +1,5 @@
/* doc.h -- Structures associating function pointers with documentation.
- $Id: doc.h,v 1.5 2001/11/16 23:16:40 karl Exp $
+ $Id: doc.h,v 1.1 2002/08/25 23:38:38 karl Exp $
Copyright (C) 1993, 2001 Free Software Foundation, Inc.
diff --git a/contrib/texinfo/info/echo-area.c b/contrib/texinfo/info/echo-area.c
index 078e8e7..8954571 100644
--- a/contrib/texinfo/info/echo-area.c
+++ b/contrib/texinfo/info/echo-area.c
@@ -1,7 +1,7 @@
/* echo-area.c -- how to read a line in the echo area.
- $Id: echo-area.c,v 1.15 2001/12/12 16:19:39 karl Exp $
+ $Id: echo-area.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98, 99, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/echo-area.h b/contrib/texinfo/info/echo-area.h
index 7feec06..e8b57cb 100644
--- a/contrib/texinfo/info/echo-area.h
+++ b/contrib/texinfo/info/echo-area.h
@@ -1,5 +1,5 @@
/* echo-area.h -- Functions used in reading information from the echo area.
- $Id: echo-area.h,v 1.3 1997/07/15 18:38:21 karl Exp $
+ $Id: echo-area.h,v 1.1 2002/08/25 23:38:38 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
diff --git a/contrib/texinfo/info/filesys.c b/contrib/texinfo/info/filesys.c
index 7ce6017..83618f1 100644
--- a/contrib/texinfo/info/filesys.c
+++ b/contrib/texinfo/info/filesys.c
@@ -1,7 +1,8 @@
/* filesys.c -- filesystem specific functions.
- $Id: filesys.c,v 1.15 2002/03/23 20:45:24 karl Exp $
+ $Id: filesys.c,v 1.3 2003/01/31 19:18:11 karl Exp $
- Copyright (C) 1993, 97, 98, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 2000, 2002, 2003 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -266,43 +267,43 @@ info_absolute_file (fname)
return info_file_in_path (filename_non_directory (fname), containing_dir);
}
-/* Given a string containing units of information separated by
- the PATH_SEP character, return the next one pointed to by
- IDX, or NULL if there are no more.
- Advance IDX to the character after the colon. */
+
+/* Given a string containing units of information separated by the
+ PATH_SEP character, return the next one after IDX, or NULL if there
+ are no more. Advance IDX to the character after the colon. */
+
char *
extract_colon_unit (string, idx)
char *string;
int *idx;
{
- register int i, start;
+ int i = *idx;
+ int start = *idx;
- i = start = *idx;
- if ((i >= strlen (string)) || !string)
- return ((char *) NULL);
+ if (!string || i >= strlen (string))
+ return NULL;
+ /* Advance to next PATH_SEP. */
while (string[i] && string[i] != PATH_SEP[0])
i++;
- if (i == start)
- {
- return ((char *) NULL);
- }
- else
- {
- char *value;
-
- value = (char *) xmalloc (1 + (i - start));
- strncpy (value, &string[start], (i - start));
- value[i - start] = '\0';
- if (string[i])
- ++i;
- *idx = i;
- return (value);
- }
+
+ if (!string[i] && i == start) /* end of string, and didn't advance */
+ return NULL;
+
+ {
+ char *value = xmalloc ((i - start) + 1);
+ strncpy (value, &string[start], (i - start));
+ value[i - start] = 0;
+
+ i++; /* move past PATH_SEP */
+ *idx = i;
+ return value;
+ }
}
/* A structure which associates a filename with its expansion. */
-typedef struct {
+typedef struct
+{
char *filename;
char *expansion;
} FILENAME_LIST;
diff --git a/contrib/texinfo/info/filesys.h b/contrib/texinfo/info/filesys.h
index 06573ef..5b7f5b7 100644
--- a/contrib/texinfo/info/filesys.h
+++ b/contrib/texinfo/info/filesys.h
@@ -1,7 +1,7 @@
/* filesys.h -- external declarations for filesys.c.
- $Id: filesys.h,v 1.5 1998/07/21 22:25:44 karl Exp $
+ $Id: filesys.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/footnotes.c b/contrib/texinfo/info/footnotes.c
index c891e39..7abb8a6 100644
--- a/contrib/texinfo/info/footnotes.c
+++ b/contrib/texinfo/info/footnotes.c
@@ -1,7 +1,7 @@
/* footnotes.c -- Some functions for manipulating footnotes.
- $Id: footnotes.c,v 1.9 1999/09/25 16:10:04 karl Exp $
+ $Id: footnotes.c,v 1.2 2002/11/06 00:41:17 karl Exp $
- Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +21,8 @@
#include "info.h"
-/* Non-zero means attempt to show footnotes when displaying a new window. */
-int auto_footnotes_p = 1;
+/* Nonzero means attempt to show footnotes when displaying a new window. */
+int auto_footnotes_p = 0;
static char *footnote_nodename = "*Footnotes*";
diff --git a/contrib/texinfo/info/footnotes.h b/contrib/texinfo/info/footnotes.h
index a0d4fb0..6fd42a3 100644
--- a/contrib/texinfo/info/footnotes.h
+++ b/contrib/texinfo/info/footnotes.h
@@ -1,7 +1,7 @@
/* footnotes.h -- Some functions for manipulating footnotes.
- $Id: footnotes.h,v 1.4 1998/11/29 21:44:49 karl Exp $
+ $Id: footnotes.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/gc.h b/contrib/texinfo/info/gc.h
index b4d993a..832cd53 100644
--- a/contrib/texinfo/info/gc.h
+++ b/contrib/texinfo/info/gc.h
@@ -1,5 +1,5 @@
/* gc.h -- Functions for garbage collecting unused node contents.
- $Id: gc.h,v 1.2 1997/07/15 18:41:53 karl Exp $
+ $Id: gc.h,v 1.1 2002/08/25 23:38:38 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
diff --git a/contrib/texinfo/info/indices.c b/contrib/texinfo/info/indices.c
index 9123c46..4e3a3be 100644
--- a/contrib/texinfo/info/indices.c
+++ b/contrib/texinfo/info/indices.c
@@ -1,7 +1,7 @@
/* indices.c -- deal with an Info file index.
- $Id: indices.c,v 1.15 2002/03/11 13:43:52 karl Exp $
+ $Id: indices.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98, 99, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/indices.h b/contrib/texinfo/info/indices.h
index 8b8a707..b5f74bb 100644
--- a/contrib/texinfo/info/indices.h
+++ b/contrib/texinfo/info/indices.h
@@ -1,5 +1,5 @@
/* indices.h -- Functions defined in indices.c.
- $Id: indices.h,v 1.2 1997/07/06 20:50:29 karl Exp $
+ $Id: indices.h,v 1.1 2002/08/25 23:38:38 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
diff --git a/contrib/texinfo/info/info-utils.c b/contrib/texinfo/info/info-utils.c
index 73a8081..611ca15 100644
--- a/contrib/texinfo/info/info-utils.c
+++ b/contrib/texinfo/info/info-utils.c
@@ -1,5 +1,5 @@
/* info-utils.c -- miscellanous.
- $Id: info-utils.c,v 1.8 2002/03/08 21:41:44 karl Exp $
+ $Id: info-utils.c,v 1.1 2002/08/25 23:38:38 karl Exp $
Copyright (C) 1993, 98 Free Software Foundation, Inc.
diff --git a/contrib/texinfo/info/info-utils.h b/contrib/texinfo/info/info-utils.h
index 24cc482..5475fda 100644
--- a/contrib/texinfo/info/info-utils.h
+++ b/contrib/texinfo/info/info-utils.h
@@ -1,7 +1,7 @@
/* info-utils.h -- Exported functions and variables from info-utils.c.
- $Id: info-utils.h,v 1.5 1998/08/10 18:07:28 karl Exp $
+ $Id: info-utils.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 96, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1996, 1998, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/info.c b/contrib/texinfo/info/info.c
index 4533507..5d1be7f 100644
--- a/contrib/texinfo/info/info.c
+++ b/contrib/texinfo/info/info.c
@@ -1,7 +1,7 @@
/* info.c -- Display nodes of Info files in multiple windows.
- $Id: info.c,v 1.60 2002/03/11 19:54:29 karl Exp $
+ $Id: info.c,v 1.2 2003/01/19 18:45:59 karl Exp $
- Copyright (C) 1993, 96, 97, 98, 99, 2000, 01, 02
+ Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -280,7 +280,7 @@ main (argc, argv)
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
- "2002");
+ "2003");
xexit (0);
}
diff --git a/contrib/texinfo/info/info.h b/contrib/texinfo/info/info.h
index 1746660..6e58b17 100644
--- a/contrib/texinfo/info/info.h
+++ b/contrib/texinfo/info/info.h
@@ -1,7 +1,7 @@
/* info.h -- Header file which includes all of the other headers.
- $Id: info.h,v 1.16 2002/02/23 19:12:02 karl Exp $
+ $Id: info.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98, 99, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/infodoc.c b/contrib/texinfo/info/infodoc.c
index 731cb48..830d8c0 100644
--- a/contrib/texinfo/info/infodoc.c
+++ b/contrib/texinfo/info/infodoc.c
@@ -1,7 +1,8 @@
-/* infodoc.c -- Functions which build documentation nodes.
- $Id: infodoc.c,v 1.28 2002/02/27 13:37:33 karl Exp $
+/* infodoc.c -- functions which build documentation nodes.
+ $Id: infodoc.c,v 1.5 2002/11/06 00:40:08 karl Exp $
- Copyright (C) 1993, 97, 98, 99, 2001, 02 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -66,12 +67,12 @@ static char *info_internal_help_text[] = {
"\n",
N_("Moving within a node:\n\
---------------------\n"),
- N_("\\%-10[scroll-forward] Scroll forward a page.\n"),
- N_("\\%-10[scroll-backward] Scroll backward a page.\n"),
N_("\\%-10[beginning-of-node] Go to the beginning of this node.\n"),
N_("\\%-10[end-of-node] Go to the end of this node.\n"),
- N_("\\%-10[scroll-forward] Scroll forward 1 line.\n"),
- N_("\\%-10[scroll-backward] Scroll backward 1 line.\n"),
+ N_("\\%-10[next-line] Scroll forward 1 line.\n"),
+ N_("\\%-10[prev-line] Scroll backward 1 line.\n"),
+ N_("\\%-10[scroll-forward] Scroll forward a page.\n"),
+ N_("\\%-10[scroll-backward] Scroll backward a page.\n"),
"\n",
N_("Other commands:\n\
---------------\n"),
@@ -226,7 +227,7 @@ dump_map_to_message_buffer (prefix, map)
if (last - 1 != i)
{
printf_to_message_buffer ("%s .. ", pretty_keyseq (new_prefix));
- new_prefix[prefix_len] = last - 1;
+ new_prefix[prefix_len] = last - 1;
printf_to_message_buffer ("%s\t", pretty_keyseq (new_prefix));
i = last - 1;
}
@@ -329,29 +330,29 @@ create_internal_info_help_node (help_is_only_window_p)
InfoCommand *cmd = DocInfoCmd(&function_doc_array[i]);
if (InfoFunction(cmd) != info_do_lowercase_version
- && !where_is_internal (info_keymap, cmd)
+ && !where_is_internal (info_keymap, cmd)
&& !where_is_internal (echo_area_keymap, cmd))
{
if (!printed_one_mx)
{
printf_to_message_buffer ("---------------------\n\n");
- if (exec_keys && exec_keys[0])
- printf_to_message_buffer
- (_("The following commands can only be invoked via %s:\n\n"), exec_keys);
- else
- printf_to_message_buffer
- (_("The following commands cannot be invoked at all:\n\n"));
+ if (exec_keys && exec_keys[0])
+ printf_to_message_buffer
+ (_("The following commands can only be invoked via %s:\n\n"), exec_keys);
+ else
+ printf_to_message_buffer
+ (_("The following commands cannot be invoked at all:\n\n"));
printed_one_mx = 1;
}
printf_to_message_buffer
("%s %s\n %s\n",
- exec_keys,
+ exec_keys,
function_doc_array[i].func_name,
replace_in_documentation (strlen (function_doc_array[i].doc)
- ? _(function_doc_array[i].doc)
- : "")
- );
+ ? _(function_doc_array[i].doc)
+ : "")
+ );
}
}
@@ -661,7 +662,7 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
return;
}
- *k++ = '\e';
+ *k++ = '\e';
keystroke = UnMeta (keystroke);
map = (Keymap)map[ESC].function;
}
@@ -686,28 +687,28 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
char *keyname, *message, *fundoc, *funname = "";
#if defined (INFOKEY)
- /* If the key is bound to do-lowercase-version, but its
- lower-case variant is undefined, say that this key is
- also undefined. This is especially important for unbound
- edit keys that emit an escape sequence: it's terribly
- confusing to see a message "Home (do-lowercase-version)"
- or some such when Home is unbound. */
- if (InfoFunction(map[keystroke].function) == info_do_lowercase_version)
- {
- unsigned char lowerkey = Meta_p(keystroke)
- ? Meta (tolower (UnMeta (keystroke)))
- : tolower (keystroke);
-
- if (map[lowerkey].function == (InfoCommand *)NULL)
- {
- message_in_echo_area (_("%s is undefined."),
- pretty_keyseq (keys));
- return;
- }
- }
+ /* If the key is bound to do-lowercase-version, but its
+ lower-case variant is undefined, say that this key is
+ also undefined. This is especially important for unbound
+ edit keys that emit an escape sequence: it's terribly
+ confusing to see a message "Home (do-lowercase-version)"
+ or some such when Home is unbound. */
+ if (InfoFunction(map[keystroke].function) == info_do_lowercase_version)
+ {
+ unsigned char lowerkey = Meta_p(keystroke)
+ ? Meta (tolower (UnMeta (keystroke)))
+ : tolower (keystroke);
+
+ if (map[lowerkey].function == (InfoCommand *)NULL)
+ {
+ message_in_echo_area (_("%s is undefined."),
+ pretty_keyseq (keys));
+ return;
+ }
+ }
#endif
- keyname = pretty_keyseq (keys);
+ keyname = pretty_keyseq (keys);
#if defined (NAMED_FUNCTIONS)
funname = function_name (map[keystroke].function);
@@ -878,7 +879,7 @@ strrpbrk (s, f)
{
for (t = f; *t; t++)
if (*e == *t)
- return (char *)e;
+ return (char *)e;
}
return NULL;
}
@@ -905,146 +906,146 @@ replace_in_documentation (string, help_is_only_window_p)
/* Is this the start of a replaceable function name? */
if (string[i] == '\\')
- {
- char *fmt = NULL;
- unsigned min = 0;
- unsigned max = 0;
-
- if(string[j] == '%')
- {
- if (string[++j] == '-')
- j++;
- if (isdigit(string[j]))
- {
- min = atoi(string + j);
- while (isdigit(string[j]))
- j++;
- if (string[j] == '.' && isdigit(string[j + 1]))
- {
- j += 1;
- max = atoi(string + j);
- while (isdigit(string[j]))
- j++;
- }
- fmt = (char *)xmalloc (j - i + 2);
- strncpy (fmt, string + i + 1, j - i);
- fmt[j - i - 1] = 's';
- fmt[j - i] = '\0';
- }
- else
- j = i + 1;
- }
- if (string[j] == '[')
- {
- unsigned arg = 0;
- char *argstr = NULL;
- char *rep_name, *fun_name, *rep;
- InfoCommand *command;
- char *repstr = NULL;
- unsigned replen;
-
- /* Copy in the old text. */
- strncpy (result + next, string + start, i - start);
- next += (i - start);
- start = j + 1;
-
- /* Look for an optional numeric arg. */
- i = start;
- if (isdigit(string[i])
- || (string[i] == '-' && isdigit(string[i + 1])) )
- {
- arg = atoi(string + i);
- if (string[i] == '-')
- i++;
- while (isdigit(string[i]))
- i++;
- }
- start = i;
-
- /* Move to the end of the function name. */
- for (i = start; string[i] && (string[i] != ']'); i++);
-
- rep_name = (char *)xmalloc (1 + i - start);
- strncpy (rep_name, string + start, i - start);
- rep_name[i - start] = '\0';
-
- /* If we have only one window (because the window size was too
- small to split it), we have to quit help by going back one
- noew in the history list, not deleting the window. */
- if (strcmp (rep_name, "quit-help") == 0)
- fun_name = help_is_only_window_p ? "history-node"
- : "delete-window";
- else
- fun_name = rep_name;
-
- /* Find a key which invokes this function in the info_keymap. */
- command = named_function (fun_name);
-
- free (rep_name);
-
- /* If the internal documentation string fails, there is a
- serious problem with the associated command's documentation.
- We croak so that it can be fixed immediately. */
- if (!command)
- abort ();
-
- if (arg)
- {
- char *argrep, *p;
-
- argrep = where_is (info_keymap, InfoCmd(info_add_digit_to_numeric_arg));
- p = argrep ? strrpbrk (argrep, "0123456789-") : NULL;
- if (p)
- {
- argstr = (char *)xmalloc (p - argrep + 21);
- strncpy (argstr, argrep, p - argrep);
- sprintf (argstr + (p - argrep), "%d", arg);
- }
- else
- command = NULL;
- }
- rep = command ? where_is (info_keymap, command) : NULL;
- if (!rep)
- rep = "N/A";
- replen = (argstr ? strlen (argstr) + 1 : 0) + strlen (rep);
- repstr = (char *)xmalloc (replen);
- repstr[0] = '\0';
- if (argstr)
- {
- strcat(repstr, argstr);
- strcat(repstr, " ");
- free (argstr);
- }
- strcat(repstr, rep);
-
- if (fmt)
- {
- if (replen > max)
- replen = max;
- if (replen < min)
- replen = min;
- }
- if (next + replen > reslen)
- {
- reslen = next + replen + 1;
- result = (char *)xrealloc (result, reslen + 1);
- }
-
- if (fmt)
- sprintf (result + next, fmt, repstr);
- else
- strcpy (result + next, repstr);
-
- next = strlen (result);
- free (repstr);
-
- start = i;
- if (string[i])
- start++;
- }
-
- maybe_free (fmt);
- }
+ {
+ char *fmt = NULL;
+ unsigned min = 0;
+ unsigned max = 0;
+
+ if(string[j] == '%')
+ {
+ if (string[++j] == '-')
+ j++;
+ if (isdigit(string[j]))
+ {
+ min = atoi(string + j);
+ while (isdigit(string[j]))
+ j++;
+ if (string[j] == '.' && isdigit(string[j + 1]))
+ {
+ j += 1;
+ max = atoi(string + j);
+ while (isdigit(string[j]))
+ j++;
+ }
+ fmt = (char *)xmalloc (j - i + 2);
+ strncpy (fmt, string + i + 1, j - i);
+ fmt[j - i - 1] = 's';
+ fmt[j - i] = '\0';
+ }
+ else
+ j = i + 1;
+ }
+ if (string[j] == '[')
+ {
+ unsigned arg = 0;
+ char *argstr = NULL;
+ char *rep_name, *fun_name, *rep;
+ InfoCommand *command;
+ char *repstr = NULL;
+ unsigned replen;
+
+ /* Copy in the old text. */
+ strncpy (result + next, string + start, i - start);
+ next += (i - start);
+ start = j + 1;
+
+ /* Look for an optional numeric arg. */
+ i = start;
+ if (isdigit(string[i])
+ || (string[i] == '-' && isdigit(string[i + 1])) )
+ {
+ arg = atoi(string + i);
+ if (string[i] == '-')
+ i++;
+ while (isdigit(string[i]))
+ i++;
+ }
+ start = i;
+
+ /* Move to the end of the function name. */
+ for (i = start; string[i] && (string[i] != ']'); i++);
+
+ rep_name = (char *)xmalloc (1 + i - start);
+ strncpy (rep_name, string + start, i - start);
+ rep_name[i - start] = '\0';
+
+ /* If we have only one window (because the window size was too
+ small to split it), we have to quit help by going back one
+ noew in the history list, not deleting the window. */
+ if (strcmp (rep_name, "quit-help") == 0)
+ fun_name = help_is_only_window_p ? "history-node"
+ : "delete-window";
+ else
+ fun_name = rep_name;
+
+ /* Find a key which invokes this function in the info_keymap. */
+ command = named_function (fun_name);
+
+ free (rep_name);
+
+ /* If the internal documentation string fails, there is a
+ serious problem with the associated command's documentation.
+ We croak so that it can be fixed immediately. */
+ if (!command)
+ abort ();
+
+ if (arg)
+ {
+ char *argrep, *p;
+
+ argrep = where_is (info_keymap, InfoCmd(info_add_digit_to_numeric_arg));
+ p = argrep ? strrpbrk (argrep, "0123456789-") : NULL;
+ if (p)
+ {
+ argstr = (char *)xmalloc (p - argrep + 21);
+ strncpy (argstr, argrep, p - argrep);
+ sprintf (argstr + (p - argrep), "%d", arg);
+ }
+ else
+ command = NULL;
+ }
+ rep = command ? where_is (info_keymap, command) : NULL;
+ if (!rep)
+ rep = "N/A";
+ replen = (argstr ? strlen (argstr) : 0) + strlen (rep) + 1;
+ repstr = (char *)xmalloc (replen);
+ repstr[0] = '\0';
+ if (argstr)
+ {
+ strcat(repstr, argstr);
+ strcat(repstr, " ");
+ free (argstr);
+ }
+ strcat(repstr, rep);
+
+ if (fmt)
+ {
+ if (replen > max)
+ replen = max;
+ if (replen < min)
+ replen = min;
+ }
+ if (next + replen > reslen)
+ {
+ reslen = next + replen + 1;
+ result = (char *)xrealloc (result, reslen + 1);
+ }
+
+ if (fmt)
+ sprintf (result + next, fmt, repstr);
+ else
+ strcpy (result + next, repstr);
+
+ next = strlen (result);
+ free (repstr);
+
+ start = i;
+ if (string[i])
+ start++;
+ }
+
+ maybe_free (fmt);
+ }
}
strcpy (result + next, string + start);
return (result);
@@ -1076,7 +1077,7 @@ where_is (map, cmd)
name = function_name (cmd);
if (!name)
- return NULL; /* no such function */
+ return NULL; /* no such function */
rep = where_is_internal (map, InfoCmd(info_execute_command));
if (!rep)
@@ -1107,7 +1108,15 @@ where_is_internal (map, cmd)
return NULL;
#else /* !INFOKEY */
-
+ /* There is a bug in that create_internal_info_help_node calls
+ where_is_internal without setting where_is_rep_index to zero. This
+ was found by Mandrake and reported by Thierry Vignaud
+ <tvignaud@mandrakesoft.com> around April 24, 2002.
+
+ I think the best fix is to make where_is_rep_index another
+ parameter to this recursively-called function, instead of a static
+ variable. But this [!INFOKEY] branch of the code is not enabled
+ any more, so let's just skip the whole thing. --karl, 28sep02. */
register int i;
/* If the function is directly invokable in MAP, return the representation
diff --git a/contrib/texinfo/info/infokey.c b/contrib/texinfo/info/infokey.c
index cd05aeb..f31c98a 100644
--- a/contrib/texinfo/info/infokey.c
+++ b/contrib/texinfo/info/infokey.c
@@ -1,7 +1,7 @@
/* infokey.c -- compile ~/.infokey to ~/.info.
- $Id: infokey.c,v 1.10 2002/03/19 14:36:49 karl Exp $
+ $Id: infokey.c,v 1.3 2003/01/19 18:46:27 karl Exp $
- Copyright (C) 1999, 2001, 02 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -140,7 +140,7 @@ main (argc, argv)
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
- "1999");
+ "2003");
xexit (0);
}
diff --git a/contrib/texinfo/info/infokey.h b/contrib/texinfo/info/infokey.h
index df3749f..9b362fa 100644
--- a/contrib/texinfo/info/infokey.h
+++ b/contrib/texinfo/info/infokey.h
@@ -1,5 +1,5 @@
/* infokey.h -- Custom keystroke definition support.
- $Id: infokey.h,v 1.1 2002/03/20 16:03:22 karl Exp $
+ $Id: infokey.h,v 1.1 2002/08/25 23:38:38 karl Exp $
Copyright (C) 1999, 2002 Free Software Foundation, Inc.
diff --git a/contrib/texinfo/info/infomap.c b/contrib/texinfo/info/infomap.c
index 7749d53..de82f69 100644
--- a/contrib/texinfo/info/infomap.c
+++ b/contrib/texinfo/info/infomap.c
@@ -1,7 +1,8 @@
/* infomap.c -- keymaps for Info.
- $Id: infomap.c,v 1.28 2002/02/08 23:02:53 karl Exp $
+ $Id: infomap.c,v 1.5 2003/01/24 19:04:54 karl Exp $
- Copyright (C) 1993, 97, 98, 99, 2001, 02 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -58,47 +59,154 @@ keymap_make_keymap ()
return (keymap);
}
+#if defined(INFOKEY)
+static FUNCTION_KEYSEQ *
+find_function_keyseq (map, c, rootmap)
+ Keymap map;
+ int c;
+ Keymap rootmap;
+{
+ FUNCTION_KEYSEQ *k;
+
+ if (map[c].type != ISFUNC)
+ abort();
+ if (map[c].function == NULL)
+ return NULL;
+ for (k = map[c].function->keys; k; k = k->next)
+ {
+ const unsigned char *p;
+ Keymap m = rootmap;
+ if (k->map != rootmap)
+ continue;
+ for (p = k->keyseq; *p && m[*p].type == ISKMAP; p++)
+ m = (Keymap)m[*p].function;
+ if (*p != c || p[1])
+ continue;
+ if (m[*p].type != ISFUNC)
+ abort ();
+ break;
+ }
+ return k;
+}
+
+static void
+add_function_keyseq (function, keyseq, rootmap)
+ InfoCommand *function;
+ const unsigned char *keyseq;
+ Keymap rootmap;
+{
+ FUNCTION_KEYSEQ *ks;
+
+ if (function == NULL ||
+ function == InfoCmd(info_do_lowercase_version) ||
+ function == InfoCmd(ea_insert))
+ return;
+ ks = (FUNCTION_KEYSEQ *)xmalloc (sizeof(FUNCTION_KEYSEQ));
+ ks->next = function->keys;
+ ks->map = rootmap;
+ ks->keyseq = xstrdup(keyseq);
+ function->keys = ks;
+}
+
+static void
+remove_function_keyseq (function, keyseq, rootmap)
+ InfoCommand *function;
+ const unsigned char *keyseq;
+ Keymap rootmap;
+{
+
+ FUNCTION_KEYSEQ *k, *kp;
+
+ if (function == NULL ||
+ function == InfoCmd(info_do_lowercase_version) ||
+ function == InfoCmd(ea_insert))
+ return;
+ for (kp = NULL, k = function->keys; k; kp = k, k = k->next)
+ if (k->map == rootmap && strcmp(k->keyseq, keyseq) == 0)
+ break;
+ if (!k)
+ abort ();
+ if (kp)
+ kp->next = k->next;
+ else
+ function->keys = k->next;
+}
+#endif /* INFOKEY */
+
/* Return a new keymap which is a copy of MAP. */
Keymap
-keymap_copy_keymap (map)
- Keymap map;
+keymap_copy_keymap (map, rootmap, newroot)
+ Keymap map;
+ Keymap rootmap;
+ Keymap newroot;
{
int i;
Keymap keymap;
+#if defined(INFOKEY)
+ FUNCTION_KEYSEQ *ks;
+#endif /* INFOKEY */
keymap = keymap_make_keymap ();
+ if (!newroot)
+ newroot = keymap;
for (i = 0; i < 256; i++)
{
keymap[i].type = map[i].type;
- keymap[i].function = map[i].function;
+ switch (map[i].type)
+ {
+ case ISFUNC:
+ keymap[i].function = map[i].function;
+#if defined(INFOKEY)
+ ks = find_function_keyseq (map, i, rootmap, NULL);
+ if (ks)
+ add_function_keyseq(map[i].function, ks->keyseq, newroot);
+#endif /* INFOKEY */
+ break;
+ case ISKMAP:
+ keymap[i].function = (InfoCommand *)keymap_copy_keymap (
+ (Keymap)map[i].function, rootmap);
+ break;
+ }
}
return (keymap);
}
/* Free the keymap and its descendants. */
void
-keymap_discard_keymap (map)
- Keymap (map);
+keymap_discard_keymap (map, rootmap)
+ Keymap map;
+ Keymap rootmap;
{
int i;
if (!map)
return;
+ if (!rootmap)
+ rootmap = map;
for (i = 0; i < 256; i++)
{
+#if defined(INFOKEY)
+ FUNCTION_KEYSEQ *ks;
+#endif /* INFOKEY */
switch (map[i].type)
{
case ISFUNC:
+#if defined(INFOKEY)
+ ks = find_function_keyseq(map, i, rootmap);
+ if (ks)
+ remove_function_keyseq (map[i].function, ks->keyseq, rootmap);
+#endif /* INFOKEY */
break;
case ISKMAP:
- keymap_discard_keymap ((Keymap)map[i].function);
+ keymap_discard_keymap ((Keymap)map[i].function, rootmap);
break;
}
}
+ free(map);
}
/* Conditionally bind key sequence. */
@@ -116,27 +224,45 @@ keymap_bind_keyseq (map, keyseq, keyentry)
while ((c = *s++) != '\0')
{
+#if defined(INFOKEY)
+ FUNCTION_KEYSEQ *ks;
+#endif /* INFOKEY */
switch (m[c].type)
{
case ISFUNC:
+#if defined(INFOKEY)
+ ks = find_function_keyseq(m, c, map);
+ if (ks)
+ remove_function_keyseq (m[c].function, ks->keyseq, map);
+#else /* !INFOKEY */
if (!(m[c].function == NULL || (
-#if !defined(INFOKEY)
m != map &&
-#endif /* !INFOKEY */
m[c].function == InfoCmd(info_do_lowercase_version))
))
return 0;
+#endif /* !INFOKEY */
if (*s != '\0')
{
m[c].type = ISKMAP;
+ /* Here we are casting the Keymap pointer returned from
+ keymap_make_keymap to an InfoCommand pointer. Ugh.
+ This makes the `function' structure garbage
+ if it's actually interpreted as an InfoCommand.
+ Should really be using a union, and taking steps to
+ avoid the possible error. */
m[c].function = (InfoCommand *)keymap_make_keymap ();
}
break;
case ISKMAP:
+#if defined(INFOKEY)
+ if (*s == '\0')
+ keymap_discard_keymap ((Keymap)m[c].function, map);
+#else /* !INFOKEY */
if (*s == '\0')
return 0;
+#endif
break;
}
if (*s != '\0')
@@ -146,18 +272,7 @@ keymap_bind_keyseq (map, keyseq, keyentry)
else
{
#if defined(INFOKEY)
- FUNCTION_KEYSEQ *k;
-
- for (k = keyentry->function->keys; k && k->map != map; k = k->next)
- ;
- if (!k)
- {
- FUNCTION_KEYSEQ *ks = (FUNCTION_KEYSEQ *)xmalloc (sizeof(FUNCTION_KEYSEQ));
- ks->next = keyentry->function->keys;
- ks->map = map;
- ks->keyseq = xstrdup (keyseq);
- keyentry->function->keys = ks;
- }
+ add_function_keyseq (keyentry->function, keyseq, map);
#endif /* INFOKEY */
m[c] = *keyentry;
}
@@ -505,8 +620,8 @@ initialize_vi_like_keymaps ()
map['b'].function = ea_backward_word;
map['d'].function = ea_kill_word;
map['f'].function = ea_forward_word;
- map['h'].function = ea_forward;
- map['l'].function = ea_backward;
+ map['h'].function = ea_backward;
+ map['l'].function = ea_forward;
map['w'].function = ea_forward_word;
map['x'].function = ea_delete;
map['X'].function = ea_kill_word;
@@ -1721,3 +1836,4 @@ initialize_info_keymaps ()
}
#endif /* defined(INFOKEY) */
+/* vim: set sw=2 cino={1s>2sn-s^-se-s: */
diff --git a/contrib/texinfo/info/infomap.h b/contrib/texinfo/info/infomap.h
index bf46399..fe7fa77 100644
--- a/contrib/texinfo/info/infomap.h
+++ b/contrib/texinfo/info/infomap.h
@@ -1,5 +1,5 @@
/* infomap.h -- description of a keymap in Info and related functions.
- $Id: infomap.h,v 1.6 2001/11/16 23:16:59 karl Exp $
+ $Id: infomap.h,v 1.1 2002/08/25 23:38:38 karl Exp $
Copyright (C) 1993, 2001 Free Software Foundation, Inc.
diff --git a/contrib/texinfo/info/m-x.c b/contrib/texinfo/info/m-x.c
index 5085235..383261d 100644
--- a/contrib/texinfo/info/m-x.c
+++ b/contrib/texinfo/info/m-x.c
@@ -1,7 +1,7 @@
/* m-x.c -- Meta-x minibuffer reader.
- $Id: m-x.c,v 1.9 2001/11/16 23:14:33 karl Exp $
+ $Id: m-x.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/man.c b/contrib/texinfo/info/man.c
index 1332cc5..bbde1ac 100644
--- a/contrib/texinfo/info/man.c
+++ b/contrib/texinfo/info/man.c
@@ -1,7 +1,8 @@
/* man.c: How to read and format man files.
- $Id: man.c,v 1.16 2002/02/23 19:12:02 karl Exp $
+ $Id: man.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1995, 97, 98, 99, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 1998, 1999, 2000, 2002 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/man.h b/contrib/texinfo/info/man.h
index 3cf4b16..461936f 100644
--- a/contrib/texinfo/info/man.h
+++ b/contrib/texinfo/info/man.h
@@ -1,5 +1,5 @@
/* man.h: Defines and external function declarations for man.c.
- $Id: man.h,v 1.2 1997/07/15 18:42:56 karl Exp $
+ $Id: man.h,v 1.1 2002/08/25 23:38:38 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
diff --git a/contrib/texinfo/info/nodemenu.c b/contrib/texinfo/info/nodemenu.c
index b109057..dad5137 100644
--- a/contrib/texinfo/info/nodemenu.c
+++ b/contrib/texinfo/info/nodemenu.c
@@ -1,7 +1,7 @@
/* nodemenu.c -- produce a menu of all visited nodes.
- $Id: nodemenu.c,v 1.8 1998/06/28 19:54:27 karl Exp $
+ $Id: nodemenu.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/nodes.c b/contrib/texinfo/info/nodes.c
index 7f0bf0f..0554ec7 100644
--- a/contrib/texinfo/info/nodes.c
+++ b/contrib/texinfo/info/nodes.c
@@ -1,7 +1,7 @@
/* nodes.c -- how to get an Info file and node.
- $Id: nodes.c,v 1.15 2000/11/11 00:40:37 karl Exp $
+ $Id: nodes.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 98, 99, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/nodes.h b/contrib/texinfo/info/nodes.h
index 7fd625d..0002ea4 100644
--- a/contrib/texinfo/info/nodes.h
+++ b/contrib/texinfo/info/nodes.h
@@ -1,7 +1,7 @@
/* nodes.h -- How we represent nodes internally.
- $Id: nodes.h,v 1.8 1998/07/10 20:28:43 karl Exp $
+ $Id: nodes.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/search.c b/contrib/texinfo/info/search.c
index 0e48cea..593cff9 100644
--- a/contrib/texinfo/info/search.c
+++ b/contrib/texinfo/info/search.c
@@ -1,7 +1,7 @@
/* search.c -- searching large bodies of text.
- $Id: search.c,v 1.6 2002/03/23 20:45:24 karl Exp $
+ $Id: search.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/search.h b/contrib/texinfo/info/search.h
index 757ec5c..5f94978 100644
--- a/contrib/texinfo/info/search.h
+++ b/contrib/texinfo/info/search.h
@@ -1,7 +1,7 @@
/* search.h -- Structure used to search large bodies of text, with bounds.
- $Id: search.h,v 1.4 1998/04/19 20:50:23 karl Exp $
+ $Id: search.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/session.c b/contrib/texinfo/info/session.c
index 229dd4e..7cf95fa 100644
--- a/contrib/texinfo/info/session.c
+++ b/contrib/texinfo/info/session.c
@@ -1,8 +1,8 @@
/* session.c -- user windowing interface to Info.
- $Id: session.c,v 1.45 2002/03/02 15:05:04 karl Exp $
+ $Id: session.c,v 1.3 2003/01/24 19:05:53 karl Exp $
- Copyright (C) 1993, 96, 97, 98, 99, 2000, 01, 02
- Free Software Foundation, Inc.
+ Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free
+ Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3936,7 +3936,7 @@ incremental_search (window, count, ignore)
key = info_get_input_char ();
window_get_state (window, &mystate);
- if (key == DEL)
+ if (key == DEL || key == Control ('h'))
{
/* User wants to delete one level of search? */
if (!isearch_states_index)
@@ -3967,9 +3967,15 @@ incremental_search (window, count, ignore)
if (!Meta_p (key) || key > 32)
{
- func = InfoFunction(window->keymap[key].function);
-
- if (isprint (key) || func == (VFunction *)NULL)
+ /* If this key is not a keymap, get its associated function,
+ if any. If it is a keymap, then it's probably ESC from an
+ arrow key, and we handle that case below. */
+ char type = window->keymap[key].type;
+ func = type == ISFUNC
+ ? InfoFunction(window->keymap[key].function)
+ : NULL; /* function member is a Keymap if ISKMAP */
+
+ if (isprint (key) || (type == ISFUNC && func == NULL))
{
insert_and_search:
diff --git a/contrib/texinfo/info/session.h b/contrib/texinfo/info/session.h
index 99892fc..f2f806c 100644
--- a/contrib/texinfo/info/session.h
+++ b/contrib/texinfo/info/session.h
@@ -1,7 +1,7 @@
/* session.h -- Functions found in session.c.
- $Id: session.h,v 1.10 2001/11/16 23:17:15 karl Exp $
+ $Id: session.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 98, 99, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/signals.c b/contrib/texinfo/info/signals.c
index 0e92578..61e5f97 100644
--- a/contrib/texinfo/info/signals.c
+++ b/contrib/texinfo/info/signals.c
@@ -1,7 +1,8 @@
/* signals.c -- install and maintain Info signal handlers.
- $Id: signals.c,v 1.6 1998/12/06 22:00:04 karl Exp $
+ $Id: signals.c,v 1.4 2003/01/29 19:23:22 karl Exp $
- Copyright (C) 1993, 94, 95, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,9 +29,6 @@
/* */
/* **************************************************************** */
-/* Non-zero when our signal handler has been called to handle SIGWINCH. */
-static int in_sigwinch = 0;
-
#if !defined (HAVE_SIGPROCMASK) && defined (HAVE_SIGSETMASK)
/* Perform OPERATION on NEWSET, perhaps leaving information in OLDSET. */
static void
@@ -63,32 +61,86 @@ sigprocmask (operation, newset, oldset)
/* */
/* **************************************************************** */
-typedef RETSIGTYPE signal_handler ();
+#if defined (HAVE_SIGACTION) || defined (HAVE_SIGPROCMASK) ||\
+ defined (HAVE_SIGSETMASK)
+static void
+mask_termsig (set)
+ sigset_t *set;
+{
+# if defined (SIGTSTP)
+ sigaddset (set, SIGTSTP);
+ sigaddset (set, SIGTTOU);
+ sigaddset (set, SIGTTIN);
+# endif
+# if defined (SIGWINCH)
+ sigaddset (set, SIGWINCH);
+# endif
+#if defined (SIGINT)
+ sigaddset (set, SIGINT);
+#endif
+# if defined (SIGUSR1)
+ sigaddset (set, SIGUSR1);
+# endif
+}
+#endif /* HAVE_SIGACTION || HAVE_SIGPROCMASK || HAVE_SIGSETMASK */
+
+static RETSIGTYPE info_signal_proc ();
+#if defined (HAVE_SIGACTION)
+typedef struct sigaction signal_info;
+signal_info info_signal_handler;
-static RETSIGTYPE info_signal_handler ();
-static signal_handler *old_TSTP, *old_TTOU, *old_TTIN;
-static signal_handler *old_WINCH, *old_INT, *old_USR1;
+static void
+set_termsig (sig, old)
+ int sig;
+ signal_info *old;
+{
+ sigaction (sig, &info_signal_handler, old);
+}
+
+static void
+restore_termsig (sig, saved)
+ int sig;
+ const signal_info *saved;
+{
+ sigaction (sig, saved, NULL);
+}
+#else /* !HAVE_SIGACTION */
+typedef RETSIGTYPE (*signal_info) ();
+#define set_termsig(sig, old) (void)(*(old) = signal (sig, info_signal_proc))
+#define restore_termsig(sig, saved) (void)signal (sig, *(saved))
+#define info_signal_handler info_signal_proc
+static int term_conf_busy = 0;
+#endif /* !HAVE_SIGACTION */
+
+static signal_info old_TSTP, old_TTOU, old_TTIN;
+static signal_info old_WINCH, old_INT, old_USR1;
void
initialize_info_signal_handler ()
{
+#if defined (HAVE_SIGACTION)
+ info_signal_handler.sa_handler = info_signal_proc;
+ info_signal_handler.sa_flags = 0;
+ mask_termsig (&info_signal_handler.sa_mask);
+#endif /* HAVE_SIGACTION */
+
#if defined (SIGTSTP)
- old_TSTP = (signal_handler *) signal (SIGTSTP, info_signal_handler);
- old_TTOU = (signal_handler *) signal (SIGTTOU, info_signal_handler);
- old_TTIN = (signal_handler *) signal (SIGTTIN, info_signal_handler);
+ set_termsig (SIGTSTP, &old_TSTP);
+ set_termsig (SIGTTOU, &old_TTOU);
+ set_termsig (SIGTTIN, &old_TTIN);
#endif /* SIGTSTP */
#if defined (SIGWINCH)
- old_WINCH = (signal_handler *) signal (SIGWINCH, info_signal_handler);
+ set_termsig (SIGWINCH, &old_WINCH);
#endif
#if defined (SIGINT)
- old_INT = (signal_handler *) signal (SIGINT, info_signal_handler);
+ set_termsig (SIGINT, &old_INT);
#endif
#if defined (SIGUSR1)
/* Used by DJGPP to simulate SIGTSTP on Ctrl-Z. */
- old_USR1 = (signal_handler *) signal (SIGUSR1, info_signal_handler);
+ set_termsig (SIGUSR1, &old_USR1);
#endif
}
@@ -117,11 +169,25 @@ reset_info_window_sizes ()
}
static RETSIGTYPE
-info_signal_handler (sig)
+info_signal_proc (sig)
int sig;
{
- signal_handler **old_signal_handler;
+ signal_info *old_signal_handler;
+#if !defined (HAVE_SIGACTION)
+ /* best effort: first increment this counter and later block signals */
+ if (term_conf_busy)
+ return;
+ term_conf_busy++;
+#if defined (HAVE_SIGPROCMASK) || defined (HAVE_SIGSETMASK)
+ {
+ sigset_t nvar, ovar;
+ sigemptyset (&nvar);
+ mask_termsig (&nvar);
+ sigprocmask (SIG_BLOCK, &nvar, &ovar);
+ }
+#endif /* HAVE_SIGPROCMASK || HAVE_SIGSETMASK */
+#endif /* !HAVE_SIGACTION */
switch (sig)
{
#if defined (SIGTSTP)
@@ -141,8 +207,10 @@ info_signal_handler (sig)
if (sig == SIGTTIN)
old_signal_handler = &old_TTIN;
#endif /* SIGTSTP */
+#if defined (SIGINT)
if (sig == SIGINT)
old_signal_handler = &old_INT;
+#endif /* SIGINT */
/* For stop signals, restore the terminal IO, leave the cursor
at the bottom of the window, and stop us. */
@@ -150,17 +218,17 @@ info_signal_handler (sig)
terminal_clear_to_eol ();
fflush (stdout);
terminal_unprep_terminal ();
- signal (sig, *old_signal_handler);
- UNBLOCK_SIGNAL (sig);
- kill (getpid (), sig);
+ restore_termsig (sig, old_signal_handler);
+ UNBLOCK_SIGNAL (sig);
+ kill (getpid (), sig);
/* The program is returning now. Restore our signal handler,
turn on terminal handling, redraw the screen, and place the
cursor where it belongs. */
terminal_prep_terminal ();
- *old_signal_handler = (signal_handler *) signal (sig, info_signal_handler);
- redisplay_after_signal ();
- fflush (stdout);
+ set_termsig (sig, old_signal_handler);
+ /* window size might be changed while sleeping */
+ reset_info_window_sizes ();
}
break;
@@ -172,35 +240,42 @@ info_signal_handler (sig)
case SIGUSR1:
#endif
{
- if (!in_sigwinch) {
- in_sigwinch++;
-
- /* Turn off terminal IO, tell our parent that the window has changed,
- then reinitialize the terminal and rebuild our windows. */
+ /* Turn off terminal IO, tell our parent that the window has changed,
+ then reinitialize the terminal and rebuild our windows. */
#ifdef SIGWINCH
- if (sig == SIGWINCH)
- old_signal_handler = &old_WINCH;
+ if (sig == SIGWINCH)
+ old_signal_handler = &old_WINCH;
#endif
#ifdef SIGUSR1
- if (sig == SIGUSR1)
- old_signal_handler = &old_USR1;
+ if (sig == SIGUSR1)
+ old_signal_handler = &old_USR1;
#endif
- terminal_goto_xy (0, 0);
- fflush (stdout);
- terminal_unprep_terminal ();
- signal (sig, *old_signal_handler);
- UNBLOCK_SIGNAL (sig);
- kill (getpid (), sig);
-
- /* After our old signal handler returns... */
- *old_signal_handler
- = (signal_handler *) signal (sig, info_signal_handler);
- terminal_prep_terminal ();
- reset_info_window_sizes ();
- in_sigwinch--;
- }
+ terminal_goto_xy (0, 0);
+ fflush (stdout);
+ terminal_unprep_terminal (); /* needless? */
+ restore_termsig (sig, old_signal_handler);
+ UNBLOCK_SIGNAL (sig);
+ kill (getpid (), sig);
+
+ /* After our old signal handler returns... */
+ set_termsig (sig, old_signal_handler); /* needless? */
+ terminal_prep_terminal ();
+ reset_info_window_sizes ();
}
break;
#endif /* SIGWINCH || SIGUSR1 */
}
+#if !defined (HAVE_SIGACTION)
+ /* at this time it is safer to perform unblock after decrement */
+ term_conf_busy--;
+#if defined (HAVE_SIGPROCMASK) || defined (HAVE_SIGSETMASK)
+ {
+ sigset_t nvar, ovar;
+ sigemptyset (&nvar);
+ mask_termsig (&nvar);
+ sigprocmask (SIG_UNBLOCK, &nvar, &ovar);
+ }
+#endif /* HAVE_SIGPROCMASK || HAVE_SIGSETMASK */
+#endif /* !HAVE_SIGACTION */
}
+/* vim: set sw=2 cino={1s>2sn-s^-se-s: */
diff --git a/contrib/texinfo/info/signals.h b/contrib/texinfo/info/signals.h
index 3a45925..5c9f252 100644
--- a/contrib/texinfo/info/signals.h
+++ b/contrib/texinfo/info/signals.h
@@ -1,10 +1,7 @@
-/* signals.h -- Header to include system dependent signal definitions.
- $Id: signals.h,v 1.3 1997/07/15 18:35:59 karl Exp $
+/* signals.h -- header to include system dependent signal definitions.
+ $Id: signals.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 94, 95, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1997, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/termdep.h b/contrib/texinfo/info/termdep.h
index 0ab6c44..8d2758a 100644
--- a/contrib/texinfo/info/termdep.h
+++ b/contrib/texinfo/info/termdep.h
@@ -1,7 +1,8 @@
-/* termdep.h -- System things that terminal.c depends on.
- $Id: termdep.h,v 1.5 2001/09/12 17:26:03 karl Exp $
+/* termdep.h -- system things that terminal.c depends on.
+ $Id: termdep.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 96, 97, 98, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1996, 1997, 1998, 2001, 2002 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/terminal.c b/contrib/texinfo/info/terminal.c
index dd4673e..ff9913a 100644
--- a/contrib/texinfo/info/terminal.c
+++ b/contrib/texinfo/info/terminal.c
@@ -1,8 +1,8 @@
-/* terminal.c -- How to handle the physical terminal for Info.
- $Id: terminal.c,v 1.23 2001/11/16 23:16:04 karl Exp $
+/* terminal.c -- how to handle the physical terminal for Info.
+ $Id: terminal.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 97, 98, 99, 2001
- Free Software Foundation, Inc.
+ Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1996, 1997, 1998,
+ 1999, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/terminal.h b/contrib/texinfo/info/terminal.h
index 361fa4c..647d468 100644
--- a/contrib/texinfo/info/terminal.h
+++ b/contrib/texinfo/info/terminal.h
@@ -1,7 +1,7 @@
/* terminal.h -- The external interface to terminal I/O.
- $Id: terminal.h,v 1.7 2001/11/16 23:17:29 karl Exp $
+ $Id: terminal.h,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 96, 97, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/tilde.c b/contrib/texinfo/info/tilde.c
index bba285a..19f56b1 100644
--- a/contrib/texinfo/info/tilde.c
+++ b/contrib/texinfo/info/tilde.c
@@ -1,7 +1,7 @@
/* tilde.c -- tilde expansion code (~/foo := $HOME/foo).
- $Id: tilde.c,v 1.13 1999/03/03 22:42:21 karl Exp $
+ $Id: tilde.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 98, 99
+ Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1996, 1998, 1999, 2002
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
diff --git a/contrib/texinfo/info/variables.c b/contrib/texinfo/info/variables.c
index 581d2bb..7280325 100644
--- a/contrib/texinfo/info/variables.c
+++ b/contrib/texinfo/info/variables.c
@@ -1,7 +1,7 @@
-/* variables.c -- How to manipulate user visible variables in Info.
- $Id: variables.c,v 1.8 2001/11/16 23:16:19 karl Exp $
+/* variables.c -- how to manipulate user visible variables in Info.
+ $Id: variables.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/variables.h b/contrib/texinfo/info/variables.h
index 1afcfb8..58169d3 100644
--- a/contrib/texinfo/info/variables.h
+++ b/contrib/texinfo/info/variables.h
@@ -1,5 +1,5 @@
/* variables.h -- Description of user visible variables in Info.
- $Id: variables.h,v 1.3 1997/07/15 18:44:23 karl Exp $
+ $Id: variables.h,v 1.1 2002/08/25 23:38:38 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
diff --git a/contrib/texinfo/info/window.c b/contrib/texinfo/info/window.c
index 4acd5e5..8a626f0 100644
--- a/contrib/texinfo/info/window.c
+++ b/contrib/texinfo/info/window.c
@@ -1,7 +1,8 @@
/* window.c -- windows in Info.
- $Id: window.c,v 1.16 2002/03/08 21:41:44 karl Exp $
+ $Id: window.c,v 1.1 2002/08/25 23:38:38 karl Exp $
- Copyright (C) 1993, 97, 98, 2001, 02 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 1998, 2001, 2002 Free Software Foundation,
+ Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/texinfo/info/window.h b/contrib/texinfo/info/window.h
index 17367cb..2686a82 100644
--- a/contrib/texinfo/info/window.h
+++ b/contrib/texinfo/info/window.h
@@ -1,5 +1,5 @@
/* window.h -- Structure and flags used in manipulating Info windows.
- $Id: window.h,v 1.4 1997/07/15 18:45:47 karl Exp $
+ $Id: window.h,v 1.1 2002/08/25 23:38:38 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
OpenPOWER on IntegriCloud