comparison src/help.cc @ 14614:4e9dc46d4125

handle texinfo macros consistently in help system and manual * macros.texi: New file. Move macro definitions here from octave.texi. * doc/interpreter/Makefile.am (octetc_DATA): Include it in the list. (doc-cache): Pass macros.texi to mk_doc_cache.m. * octave.texi: Include macros.texi. * mk_doc_cache.m, __makeinfo__.m: Copy macros file to makeinfo input instead of handling macros specially. * configure.ac (texi_macros_file): New variable. * build-aux/common.mk (texi_macros_file, do_subst_default_vals): Substitute it. * run-octave.in (TEXIMACROSFILE): New variable. Pass --texi-macros-file to Octave. * defaults.in.h (OCTAVE_DEFAULT_TEXI_MACROS_FILE): New variable. * default.cc (set_default_texi_macros_file): New function. (install_defaults): Call it. * help.cc (Vtexi_macros_file): New variable. (Ftexi_macros_file): New function. * help.h (Vtexi_macros_file): Provide decl. * octave.cc (TEXI_MACROS_FILE_OPTION): New long option value. (long_opts): Include --texi-macros-file in the list. (octave_main): Handle TEXI_MACROS_FILE_OPTION.
author John W. Eaton <jwe@octave.org>
date Thu, 10 May 2012 12:01:42 -0400
parents 97883071e8e4
children 36f451642f79
comparison
equal deleted inserted replaced
14613:e7c8e31f8e5d 14614:4e9dc46d4125
69 69
70 // Name of the doc cache file specified on the command line. 70 // Name of the doc cache file specified on the command line.
71 // (--doc-cache-file file) 71 // (--doc-cache-file file)
72 std::string Vdoc_cache_file; 72 std::string Vdoc_cache_file;
73 73
74 // Name of the file containing local Texinfo macros that are prepended
75 // to doc strings before processing.
76 // (--texi-macros-file)
77 std::string Vtexi_macros_file;
78
74 // Name of the info file specified on command line. 79 // Name of the info file specified on command line.
75 // (--info-file file) 80 // (--info-file file)
76 std::string Vinfo_file; 81 std::string Vinfo_file;
77 82
78 // Name of the info reader we'd like to use. 83 // Name of the info reader we'd like to use.
1289 @end deftypefn") 1294 @end deftypefn")
1290 { 1295 {
1291 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (doc_cache_file); 1296 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (doc_cache_file);
1292 } 1297 }
1293 1298
1299 DEFUN (texi_macros_file, args, nargout,
1300 "-*- texinfo -*-\n\
1301 @deftypefn {Built-in Function} {@var{val} =} texi_macros_file ()\n\
1302 @deftypefnx {Built-in Function} {@var{old_val} =} texi_macros_file (@var{new_val})\n\
1303 @deftypefnx {Built-in Function} {} texi_macros_file (@var{new_val}, \"local\")\n\
1304 Query or set the internal variable that specifies the name of the\n\
1305 file containing Texinfo macros that are prepended to doc strings\n\
1306 before they are passed to makeinfo. The default value is \n\
1307 @file{@var{octave-home}/share/octave/@var{version}/etc/macros.texi},\n\
1308 in which @var{octave-home} is the root directory of the Octave installation,\n\
1309 and @var{version} is the Octave version number.\n\
1310 The default value may be overridden by the environment variable\n\
1311 @w{@env{OCTAVE_TEXI_MACROS_FILE}}, or the command line argument\n\
1312 @samp{--texi-macros-file NAME}.\n\
1313 \n\
1314 When called from inside a function with the \"local\" option, the variable is\n\
1315 changed locally for the function and any subroutines it calls. The original\n\
1316 variable value is restored when exiting the function.\n\
1317 @seealso{lookfor, info_program, doc, help, makeinfo_program}\n\
1318 @end deftypefn")
1319 {
1320 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (texi_macros_file);
1321 }
1322
1294 DEFUN (info_file, args, nargout, 1323 DEFUN (info_file, args, nargout,
1295 "-*- texinfo -*-\n\ 1324 "-*- texinfo -*-\n\
1296 @deftypefn {Built-in Function} {@var{val} =} info_file ()\n\ 1325 @deftypefn {Built-in Function} {@var{val} =} info_file ()\n\
1297 @deftypefnx {Built-in Function} {@var{old_val} =} info_file (@var{new_val})\n\ 1326 @deftypefnx {Built-in Function} {@var{old_val} =} info_file (@var{new_val})\n\
1298 @deftypefnx {Built-in Function} {} info_file (@var{new_val}, \"local\")\n\ 1327 @deftypefnx {Built-in Function} {} info_file (@var{new_val}, \"local\")\n\