# HG changeset patch # User jwe # Date 847859251 0 # Node ID 3b8598be273ef855efaa37f21caecd1f09a9dd48 # Parent fea92d9ce972ed5fe21049b0115bc36cced21d54 [project @ 1996-11-13 04:26:39 by jwe] diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ Tue Nov 12 21:50:49 1996 John W. Eaton + * MAKEINFO.PATCH: Update to use patch relative to texinfo-3.9. + + * INFO.PATCH: New file. + * octMakefile.in (DISTFILES): Add it. + * info: Update to current release from texinfo-3.9. Mon Nov 11 23:56:58 1996 John W. Eaton diff --git a/INFO.PATCH b/INFO.PATCH new file mode 100644 --- /dev/null +++ b/INFO.PATCH @@ -0,0 +1,420 @@ +Octave depends on being able to call the GNU info reader with the +command line arguments + + --index-search STRING + +to find individual entries in the manual. The following patch +implements this option. It is relative to the version of info +distributed with texinfo-3.9. + +The patch has already been applied to the info sources distributed +with Octave. It is only provided here in case you want to add this +option to some other version of info that you may have. + +This patch has been submitted to the maintainers of Texinfo, so maybe +someday it will not be necessary. + +jwe + + +Tue Nov 12 14:44:00 1996 John W. Eaton + + * info/session.c (initialize_info_session): New arg, + clear_screen. Change all callers. + + * info/info.c (main): Handle new option, --index-search STRING. + (index_search_p, index_search_string): New static variables, used + to handle --index-search option. + + * info/indices.h (do_info_index_search, index_intry_exists): + Provide declarations here. + + * info/indices.c (do_info_index_search): New function, extracted + from info_index_search. + (info_index_search): Simply call do_info_index_search() with + search_string set to NULL. + (index_entry_exists): New function. + + +diff -cNr texinfo-3.9/info/indices.c texinfo-3.9.local/info/indices.c +*** texinfo-3.9/info/indices.c Fri Jun 16 12:59:55 1995 +--- texinfo-3.9.local/info/indices.c Tue Nov 12 15:09:58 1996 +*************** +*** 174,180 **** + } + + DECLARE_INFO_COMMAND (info_index_search, +! "Look up a string in the index for this file") + { + FILE_BUFFER *fb; + char *line; +--- 174,191 ---- + } + + DECLARE_INFO_COMMAND (info_index_search, +! "Look up a string in the index for this file") +! { +! do_info_index_search (window, count, 0); +! } +! +! /* Look up SEARCH_STRING in the index for this file. If SEARCH_STRING +! is NULL, prompt user for input. */ +! void +! do_info_index_search (window, count, search_string) +! WINDOW *window; +! int count; +! char *search_string; + { + FILE_BUFFER *fb; + char *line; +*************** +*** 204,239 **** + return; + } + +! /* Okay, there is an index. Let the user select one of the members of it. */ +! line = +! info_read_maybe_completing (window, "Index entry: ", index_index); +! +! window = active_window; +! +! /* User aborted? */ +! if (!line) + { +! info_abort_key (active_window, 1, 0); +! return; +! } + +! /* Empty line means move to the Index node. */ +! if (!*line) +! { +! free (line); + +! if (initial_index_filename && initial_index_nodename) + { +! NODE *node; +! +! node = +! info_get_node (initial_index_filename, initial_index_nodename); +! set_remembered_pagetop_and_point (window); +! window_set_node_of_window (window, node); +! remember_window_and_node (window, node); +! window_clear_echo_area (); + return; + } + } + + /* The user typed either a completed index label, or a partial string. +--- 215,256 ---- + return; + } + +! /* Okay, there is an index. Look for SEARCH_STRING, or, if it is +! empty, prompt for one. */ +! if (search_string && *search_string) +! line = strdup (search_string); +! else + { +! line = +! info_read_maybe_completing (window, "Index entry: ", index_index); + +! window = active_window; + +! /* User aborted? */ +! if (!line) + { +! info_abort_key (active_window, 1, 0); + return; + } ++ ++ /* Empty line means move to the Index node. */ ++ if (!*line) ++ { ++ free (line); ++ ++ if (initial_index_filename && initial_index_nodename) ++ { ++ NODE *node; ++ ++ node = ++ info_get_node (initial_index_filename, initial_index_nodename); ++ set_remembered_pagetop_and_point (window); ++ window_set_node_of_window (window, node); ++ remember_window_and_node (window, node); ++ window_clear_echo_area (); ++ return; ++ } ++ } + } + + /* The user typed either a completed index label, or a partial string. +*************** +*** 265,270 **** +--- 282,334 ---- + if (index_offset == old_offset) + index_offset = 0; + } ++ } ++ ++ int ++ index_entry_exists (window, string) ++ WINDOW *window; ++ char *string; ++ { ++ register int i; ++ FILE_BUFFER *fb; ++ ++ /* If there is no previous search string, the user hasn't built an index ++ yet. */ ++ if (!string) ++ return 0; ++ ++ fb = file_buffer_of_window (window); ++ if (!initial_index_filename || ++ (strcmp (initial_index_filename, fb->filename) != 0)) ++ { ++ info_free_references (index_index); ++ index_index = info_indices_of_file_buffer (fb); ++ } ++ ++ /* If there is no index, that is an error. */ ++ if (!index_index) ++ return 0; ++ ++ for (i = 0; (i > -1) && (index_index[i]); i++) ++ if (strcmp (string, index_index[i]->label) == 0) ++ break; ++ ++ /* If that failed, look for the next substring match. */ ++ if ((i < 0) || (!index_index[i])) ++ { ++ for (i = 0; (i > -1) && (index_index[i]); i++) ++ if (string_in_line (string, index_index[i]->label) != -1) ++ break; ++ ++ if ((i > -1) && (index_index[i])) ++ string_in_line (string, index_index[i]->label); ++ } ++ ++ /* If that failed, return 0. */ ++ if ((i < 0) || (!index_index[i])) ++ return 0; ++ ++ return 1; + } + + DECLARE_INFO_COMMAND (info_next_index_match, +diff -cNr texinfo-3.9/info/indices.h texinfo-3.9.local/info/indices.h +*** texinfo-3.9/info/indices.h Fri Jun 16 13:01:54 1995 +--- texinfo-3.9.local/info/indices.h Tue Nov 12 15:01:54 1996 +*************** +*** 35,39 **** +--- 35,41 ---- + + /* User visible functions declared in indices.c. */ + extern void info_index_search (), info_next_index_match (); ++ extern void do_info_index_search (); ++ extern int index_intry_exists (); + + #endif /* !_INDICES_H_ */ +diff -cNr texinfo-3.9/info/info.c texinfo-3.9.local/info/info.c +*** texinfo-3.9/info/info.c Fri Oct 4 13:19:54 1996 +--- texinfo-3.9.local/info/info.c Tue Nov 12 15:21:19 1996 +*************** +*** 39,44 **** +--- 39,52 ---- + /* Variable containing the string to search for when apropos_p is non-zero. */ + static char *apropos_search_string = (char *)NULL; + ++ /* Non-zero means search all indices for INDEX_SEARCH_STRING. Unlike ++ apropos, this puts the user at the node, running info. */ ++ static int index_search_p = 0; ++ ++ /* Variable containing the string to search for when index_search_p is ++ non-zero. */ ++ static char *index_search_string = (char *)NULL; ++ + /* Non-zero means print version info only. */ + static int print_version_p = 0; + +*************** +*** 70,75 **** +--- 78,84 ---- + #define APROPOS_OPTION 1 + #define DRIBBLE_OPTION 2 + #define RESTORE_OPTION 3 ++ #define IDXSRCH_OPTION 4 + static struct option long_options[] = { + { "apropos", 1, 0, APROPOS_OPTION }, + { "directory", 1, 0, 'd' }, +*************** +*** 81,86 **** +--- 90,96 ---- + { "version", 0, &print_version_p, 1 }, + { "dribble", 1, 0, DRIBBLE_OPTION }, + { "restore", 1, 0, RESTORE_OPTION }, ++ { "index-search", 1, 0, IDXSRCH_OPTION }, + {NULL, 0, NULL, 0} + }; + +*************** +*** 181,186 **** +--- 191,203 ---- + info_set_input_from_file (optarg); + break; + ++ /* User has specified a string to search all indices for. */ ++ case IDXSRCH_OPTION: ++ index_search_p = 1; ++ maybe_free (index_search_string); ++ index_search_string = strdup (optarg); ++ break; ++ + default: + usage (); + } +*************** +*** 286,291 **** +--- 303,345 ---- + begin_multiple_window_info_session (user_filename, user_nodenames); + + exit (0); ++ } ++ ++ /* If the user specified `--index-search string', start the info ++ session in the node corresponding to the first match. */ ++ if (index_search_p) ++ { ++ int status = 0; ++ ++ initialize_info_session (initial_node, 0); ++ ++ if (index_entry_exists (windows, index_search_string)) ++ { ++ terminal_clear_screen (); ++ terminal_prep_terminal (); ++ display_update_display (windows); ++ info_last_executed_command = (VFunction *)NULL; ++ ++ do_info_index_search (windows, 0, index_search_string); ++ ++ info_read_and_dispatch (); ++ ++ terminal_unprep_terminal (); ++ ++ /* On program exit, leave the cursor at the bottom of the ++ window, and restore the terminal IO. */ ++ terminal_goto_xy (0, screenheight - 1); ++ terminal_clear_to_eol (); ++ fflush (stdout); ++ } ++ else ++ { ++ fprintf (stderr, "no entries found\n"); ++ status = -1; ++ } ++ ++ close_dribble_file (); ++ exit (status); + } + + /* If there are arguments remaining, they are the names of menu items +diff -cNr texinfo-3.9/info/session.c texinfo-3.9.local/info/session.c +*** texinfo-3.9/info/session.c Fri Jul 19 09:56:01 1996 +--- texinfo-3.9.local/info/session.c Tue Nov 12 15:33:08 1996 +*************** +*** 92,98 **** + /* If this is the first node, initialize the info session. */ + if (!window) + { +! initialize_info_session (node); + window = active_window; + } + else +--- 92,98 ---- + /* If this is the first node, initialize the info session. */ + if (!window) + { +! initialize_info_session (node, 1); + window = active_window; + } + else +*************** +*** 145,151 **** + char *format; + void *arg; + { +! initialize_info_session (initial_node); + info_error (format, arg, (void *)NULL); + info_session (); + } +--- 145,151 ---- + char *format; + void *arg; + { +! initialize_info_session (initial_node, 1); + info_error (format, arg, (void *)NULL); + info_session (); + } +*************** +*** 155,161 **** + begin_info_session (initial_node) + NODE *initial_node; + { +! initialize_info_session (initial_node); + display_startup_message_and_start (); + } + +--- 155,161 ---- + begin_info_session (initial_node) + NODE *initial_node; + { +! initialize_info_session (initial_node, 1); + display_startup_message_and_start (); + } + +*************** +*** 260,269 **** + extern void initialize_info_signal_handler (); + + /* Initialize the first info session by starting the terminal, window, +! and display systems. */ + void +! initialize_info_session (node) + NODE *node; + { + char *getenv (), *term_name; + +--- 260,271 ---- + extern void initialize_info_signal_handler (); + + /* Initialize the first info session by starting the terminal, window, +! and display systems. If CLEAR_SCREEN is 0, don't clear the +! screen. */ + void +! initialize_info_session (node, clear_screen) + NODE *node; ++ int clear_screen; + { + char *getenv (), *term_name; + +*************** +*** 279,285 **** + exit (1); + } + +! terminal_clear_screen (); + initialize_info_keymaps (); + window_initialize_windows (screenwidth, screenheight); + initialize_info_signal_handler (); +--- 281,289 ---- + exit (1); + } + +! if (clear_screen) +! terminal_clear_screen (); +! + initialize_info_keymaps (); + window_initialize_windows (screenwidth, screenheight); + initialize_info_signal_handler (); + diff --git a/MAKEINFO.PATCH b/MAKEINFO.PATCH --- a/MAKEINFO.PATCH +++ b/MAKEINFO.PATCH @@ -73,9 +73,10 @@ bar-function Here is a patch that will cause makeinfo to behave more like -TeX/texinfo.tex. +TeX/texinfo.tex. It is relative to the versionof makeinfo distributed +with texinfo 3.9. -Sat Dec 30 15:57:34 1995 John Eaton +Tue Nov 12 22:20:22 1996 John Eaton * makeinfo.c (INDEX_ALIST): Use two indices, read_index and write_index, instead of just one. @@ -93,10 +94,11 @@ (cm_synindex): Don't merge indcies, just make the write_index for redirectee the same as the write_index for redirector. -*** makeinfo.c.orig Sat Dec 23 16:18:37 1995 ---- makeinfo.c Sat Dec 30 15:51:17 1995 +diff -cNr texinfo-3.9/makeinfo/makeinfo.c texinfo-3.9.local/makeinfo/makeinfo.c +*** texinfo-3.9/makeinfo/makeinfo.c Fri Oct 4 13:20:54 1996 +--- texinfo-3.9.local/makeinfo/makeinfo.c Thu Nov 7 13:12:59 1996 *************** -*** 7408,7421 **** +*** 7472,7485 **** int defining_line; /* Line number where this entry was written. */ } INDEX_ELT; @@ -111,7 +113,7 @@ int code; } INDEX_ALIST; ---- 7408,7447 ---- +--- 7472,7511 ---- int defining_line; /* Line number where this entry was written. */ } INDEX_ELT; @@ -153,7 +155,7 @@ } INDEX_ALIST; *************** -*** 7480,7486 **** +*** 7544,7550 **** for (i = 0; i < defined_indices; i++) if (name_index_alist[i] && strcmp (name, name_index_alist[i]->name) == 0) @@ -161,7 +163,7 @@ return (-1); } ---- 7506,7513 ---- +--- 7570,7577 ---- for (i = 0; i < defined_indices; i++) if (name_index_alist[i] && strcmp (name, name_index_alist[i]->name) == 0) @@ -171,7 +173,7 @@ } *************** -*** 7506,7512 **** +*** 7570,7576 **** INDEX_ALIST *which = find_index (name); if (which) @@ -179,7 +181,7 @@ else return (-1); } ---- 7533,7539 ---- +--- 7597,7603 ---- INDEX_ALIST *which = find_index (name); if (which) @@ -188,7 +190,7 @@ return (-1); } *************** -*** 7539,7545 **** +*** 7603,7609 **** } } @@ -196,7 +198,7 @@ void undefindex (name) char *name; ---- 7566,7573 ---- +--- 7630,7637 ---- } } @@ -206,7 +208,7 @@ undefindex (name) char *name; *************** -*** 7550,7556 **** +*** 7614,7620 **** if (which < 0) return; @@ -214,7 +216,7 @@ free_index (the_indices[i]); the_indices[i] = (INDEX_ELT *) NULL; ---- 7578,7584 ---- +--- 7642,7648 ---- if (which < 0) return; @@ -223,7 +225,7 @@ free_index (the_indices[i]); the_indices[i] = (INDEX_ELT *) NULL; *************** -*** 7598,7604 **** +*** 7662,7668 **** /* We have a slot. Start assigning. */ name_index_alist[slot] = (INDEX_ALIST *) xmalloc (sizeof (INDEX_ALIST)); name_index_alist[slot]->name = strdup (name); @@ -231,7 +233,7 @@ name_index_alist[slot]->code = code; the_indices[slot] = (INDEX_ELT *) NULL; ---- 7626,7633 ---- +--- 7690,7697 ---- /* We have a slot. Start assigning. */ name_index_alist[slot] = (INDEX_ALIST *) xmalloc (sizeof (INDEX_ALIST)); name_index_alist[slot]->name = strdup (name); @@ -241,7 +243,7 @@ the_indices[slot] = (INDEX_ELT *) NULL; *************** -*** 7615,7621 **** +*** 7679,7685 **** tem = find_index (name); @@ -249,7 +251,7 @@ #if defined (HAVE_MACROS) if (macro_expansion_output_stream) ---- 7644,7650 ---- +--- 7708,7714 ---- tem = find_index (name); @@ -258,7 +260,7 @@ #if defined (HAVE_MACROS) if (macro_expansion_output_stream) *************** -*** 7718,7739 **** +*** 7782,7803 **** } } @@ -281,9 +283,9 @@ /* Expects 2 args, on the same line. Both are index abbreviations. Make the first one be a synonym for the second one, i.e. make the first one have the same index as the second one. */ ---- 7747,7752 ---- +--- 7811,7816 ---- *************** -*** 7757,7778 **** +*** 7821,7842 **** } else { @@ -306,7 +308,7 @@ } } ---- 7770,7777 ---- +--- 7834,7841 ---- } else { diff --git a/PROJECTS b/PROJECTS --- a/PROJECTS +++ b/PROJECTS @@ -92,6 +92,8 @@ * Given two vectors x and y of length m and n, implement a function outer (x, y, f) that returns an m-by-n matrix with entries f (x(i), y(j)). If f is omitted, multiplication is the default. + Should probably work for any vectors, not just if x is a column + vector and y is a row vector. -------- Graphics: diff --git a/octMakefile.in b/octMakefile.in --- a/octMakefile.in +++ b/octMakefile.in @@ -26,7 +26,7 @@ BUGS COPYING INSTALL INSTALL.OCTAVE NEWS NEWS.[0-9] PROJECTS \ README README.NLP ROADMAP SENDING-PATCHES THANKS move-if-change \ octave.sh octave-bug.in doinstall.sh mkinstalldirs mkoctfile.in \ - MAKEINFO.PATCH ChangeLog ChangeLog.[0-9] + INFO.PATCH MAKEINFO.PATCH ChangeLog ChangeLog.[0-9] # Complete directory trees to distribute. DISTDIRS = emacs glob kpathsea make # plplot