Mercurial > octave-nkf
annotate doc/interpreter/eos.txi @ 10846:a4f482e66b65
Grammarcheck more of the documentation.
Use @noindent macro appropriately.
Limit line length to 80 characters.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 01 Aug 2010 20:22:17 -0700 |
parents | 923c7cb7f13f |
children | fd0a3ac60b0e |
rev | line source |
---|---|
8920 | 1 @c Copyright (C) 1996, 1997, 1999, 2002, 2003, 2005, 2007, 2008, |
2 @c 2009 Kurt Hornik | |
7018 | 3 @c |
4 @c This file is part of Octave. | |
5 @c | |
6 @c Octave is free software; you can redistribute it and/or modify it | |
7 @c under the terms of the GNU General Public License as published by the | |
8 @c Free Software Foundation; either version 3 of the License, or (at | |
9 @c your option) any later version. | |
10 @c | |
11 @c Octave is distributed in the hope that it will be useful, but WITHOUT | |
12 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 @c for more details. | |
15 @c | |
16 @c You should have received a copy of the GNU General Public License | |
17 @c along with Octave; see the file COPYING. If not, see | |
18 @c <http://www.gnu.org/licenses/>. | |
19 | |
5428 | 20 @c Written by Kurt Hornik <Kurt.Hornik@wu-wien.ac.at> on 1996/05/17. |
3294 | 21 @c Last updated by KH on 1997/07/31. |
22 | |
23 @node Emacs | |
24 @chapter Emacs Octave Support | |
25 | |
26 The development of Octave code can greatly be facilitated using Emacs | |
4167 | 27 with Octave mode |
3294 | 28 automatically indent the code, do some of the typing (with Abbrev mode) |
29 and show keywords, comments, strings, etc.@: in different faces (with | |
30 Font-lock mode on devices that support it). | |
31 | |
32 It is also possible to run Octave from within Emacs, either by directly | |
33 entering commands at the prompt in a buffer in Inferior Octave mode, or | |
34 by interacting with Octave from within a file with Octave code. This is | |
35 useful in particular for debugging Octave code. | |
36 | |
37 Finally, you can convince Octave to use the Emacs info reader for | |
38 @kbd{help -i}. | |
39 | |
40 All functionality is provided by the Emacs Lisp package EOS (for ``Emacs | |
41 Octave Support''). This chapter describes how to set up and use this | |
42 package. | |
43 | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
44 Please contact @email{Kurt.Hornik@@wu-wien.ac.at} if you have any questions |
3294 | 45 or suggestions on using EOS. |
46 | |
47 @menu | |
48 * Installing EOS:: | |
49 * Using Octave Mode:: | |
50 * Running Octave From Within Emacs:: | |
51 * Using the Emacs Info Reader for Octave:: | |
52 @end menu | |
53 | |
4167 | 54 @node Installing EOS |
3294 | 55 @section Installing EOS |
56 | |
57 The Emacs package EOS consists of the three files @file{octave-mod.el}, | |
58 @file{octave-inf.el}, and @file{octave-hlp.el}. These files, or better | |
59 yet their byte-compiled versions, should be somewhere in your Emacs | |
60 load-path. | |
61 | |
62 If you have GNU Emacs with a version number at least as high as 19.35, | |
63 you are all set up, because EOS is respectively will be part of GNU | |
64 Emacs as of version 19.35. | |
65 | |
66 Otherwise, copy the three files from the @file{emacs} subdirectory of | |
67 the Octave distribution to a place where Emacs can find them (this | |
68 depends on how your Emacs was installed). Byte-compile them for speed | |
69 if you want. | |
70 | |
4167 | 71 @node Using Octave Mode |
3294 | 72 @section Using Octave Mode |
73 | |
74 If you are lucky, your sysadmins have already arranged everything so | |
75 that Emacs automatically goes into Octave mode whenever you visit an | |
76 Octave code file as characterized by its extension @file{.m}. If not, | |
77 proceed as follows. | |
78 | |
79 @enumerate | |
80 @item | |
81 To begin using Octave mode for all @file{.m} files you visit, add the | |
82 following lines to a file loaded by Emacs at startup time, typically | |
83 your @file{~/.emacs} file: | |
84 | |
85 @lisp | |
86 (autoload 'octave-mode "octave-mod" nil t) | |
87 (setq auto-mode-alist | |
88 (cons '(\"\\\\.m$\" . octave-mode) auto-mode-alist)) | |
89 @end lisp | |
90 | |
91 @item | |
92 Finally, to turn on the abbrevs, auto-fill and font-lock features | |
93 automatically, also add the following lines to one of the Emacs startup | |
94 files: | |
95 @lisp | |
96 (add-hook 'octave-mode-hook | |
97 (lambda () | |
98 (abbrev-mode 1) | |
99 (auto-fill-mode 1) | |
100 (if (eq window-system 'x) | |
101 (font-lock-mode 1)))) | |
102 @end lisp | |
103 See the Emacs manual for more information about how to customize | |
104 Font-lock mode. | |
105 @end enumerate | |
106 | |
107 In Octave mode, the following special Emacs commands can be used in | |
108 addition to the standard Emacs commands. | |
109 | |
110 @table @kbd | |
111 @item C-h m | |
112 Describe the features of Octave mode. | |
113 | |
114 @item LFD | |
115 Reindent the current Octave line, insert a newline and indent the new | |
116 line (@code{octave-reindent-then-newline-and-indent}). An abbrev before | |
117 point is expanded if @code{abbrev-mode} is non-@code{nil}. | |
118 | |
119 @item TAB | |
120 Indents current Octave line based on its contents and on previous | |
121 lines (@code{indent-according-to-mode}). | |
122 | |
123 @item ; | |
124 Insert an ``electric'' semicolon (@code{octave-electric-semi}). If | |
125 @code{octave-auto-indent} is non-@code{nil}, reindent the current line. | |
126 If @code{octave-auto-newline} is non-@code{nil}, automagically insert a | |
127 newline and indent the new line. | |
128 | |
129 @item ` | |
130 Start entering an abbreviation (@code{octave-abbrev-start}). If Abbrev | |
131 mode is turned on, typing @kbd{`C-h} or @kbd{`?} lists all abbrevs. | |
132 Any other key combination is executed normally. Note that all Octave | |
133 abbrevs start with a grave accent. | |
134 | |
135 @item M-LFD | |
136 Break line at point and insert continuation marker and alignment | |
137 (@code{octave-split-line}). | |
138 | |
139 @item M-TAB | |
140 Perform completion on Octave symbol preceding point, comparing that | |
6501 | 141 symbol against Octave's reserved words and built-in variables |
3294 | 142 (@code{octave-complete-symbol}). |
143 | |
144 @item M-C-a | |
145 Move backward to the beginning of a function | |
146 (@code{octave-beginning-of-defun}). | |
147 With prefix argument @var{N}, do it that many times if @var{N} is | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
148 positive; otherwise, move forward to the @var{N}-th following beginning |
3294 | 149 of a function. |
150 | |
151 @item M-C-e | |
152 Move forward to the end of a function (@code{octave-end-of-defun}). | |
153 With prefix argument @var{N}, do it that many times if @var{N} is | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
154 positive; otherwise, move back to the @var{N}-th preceding end of a |
3294 | 155 function. |
156 | |
157 @item M-C-h | |
158 Puts point at beginning and mark at the end of the current Octave | |
159 function, i.e., the one containing point or following point | |
160 (@code{octave-mark-defun}). | |
161 | |
162 @item M-C-q | |
163 Properly indents the Octave function which contains point | |
164 (@code{octave-indent-defun}). | |
165 | |
166 @item M-; | |
167 If there is no comment already on this line, create a code-level comment | |
168 (started by two comment characters) if the line is empty, or an in-line | |
169 comment (started by one comment character) otherwise | |
170 (@code{octave-indent-for-comment}). | |
171 Point is left after the start of the comment which is properly aligned. | |
172 | |
173 @item C-c ; | |
174 Puts the comment character @samp{#} (more precisely, the string value of | |
175 @code{octave-comment-start}) at the beginning of every line in the | |
176 region (@code{octave-comment-region}). With just @kbd{C-u} prefix | |
177 argument, uncomment each line in the region. A numeric prefix argument | |
178 @var{N} means use @var{N} comment characters. | |
179 | |
180 @item C-c : | |
181 Uncomments every line in the region (@code{octave-uncomment-region}). | |
182 | |
183 @item C-c C-p | |
184 Move one line of Octave code backward, skipping empty and comment lines | |
185 (@code{octave-previous-code-line}). With numeric prefix argument | |
186 @var{N}, move that many code lines backward (forward if @var{N} is | |
187 negative). | |
188 | |
189 @item C-c C-n | |
190 Move one line of Octave code forward, skipping empty and comment lines | |
191 (@code{octave-next-code-line}). With numeric prefix argument @var{N}, | |
192 move that many code lines forward (backward if @var{N} is negative). | |
193 | |
194 @item C-c C-a | |
195 Move to the `real' beginning of the current line | |
196 (@code{octave-beginning-of-line}). If point is in an empty or comment | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
197 line, simply go to its beginning; otherwise, move backwards to the |
3294 | 198 beginning of the first code line which is not inside a continuation |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
199 statement, i.e., which does not follow a code line ending in @samp{...} |
3294 | 200 or @samp{\}, or is inside an open parenthesis list. |
201 | |
202 @item C-c C-e | |
203 Move to the `real' end of the current line (@code{octave-end-of-line}). | |
204 If point is in a code line, move forward to the end of the first Octave | |
205 code line which does not end in @samp{...} or @samp{\} or is inside an | |
206 open parenthesis list. Otherwise, simply go to the end of the current | |
207 line. | |
208 | |
209 @item C-c M-C-n | |
210 Move forward across one balanced begin-end block of Octave code | |
211 (@code{octave-forward-block}). With numeric prefix argument @var{N}, | |
212 move forward across @var{n} such blocks (backward if @var{N} is | |
213 negative). | |
214 | |
215 @item C-c M-C-p | |
216 Move back across one balanced begin-end block of Octave code | |
217 (@code{octave-backward-block}). With numeric prefix argument @var{N}, | |
218 move backward across @var{N} such blocks (forward if @var{N} is | |
219 negative). | |
220 | |
221 @item C-c M-C-d | |
222 Move forward down one begin-end block level of Octave code | |
223 (@code{octave-down-block}). With numeric prefix argument, do it that | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
224 many times; a negative argument means move backward, but still go down |
3294 | 225 one level. |
226 | |
227 @item C-c M-C-u | |
228 Move backward out of one begin-end block level of Octave code | |
229 (@code{octave-backward-up-block}). With numeric prefix argument, do it | |
230 that many times; a negative argument means move forward, but still to a | |
231 less deep spot. | |
232 | |
233 @item C-c M-C-h | |
234 Put point at the beginning of this block, mark at the end | |
235 (@code{octave-mark-block}). | |
236 The block marked is the one that contains point or follows point. | |
237 | |
238 @item C-c ] | |
239 Close the current block on a separate line (@code{octave-close-block}). | |
240 An error is signaled if no block to close is found. | |
241 | |
242 @item C-c f | |
243 Insert a function skeleton, prompting for the function's name, arguments | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
244 and return values which have to be entered without parentheses |
3294 | 245 (@code{octave-insert-defun}). |
246 | |
247 @item C-c C-h | |
248 Search the function, operator and variable indices of all info files | |
249 with documentation for Octave for entries (@code{octave-help}). If used | |
250 interactively, the entry is prompted for with completion. If multiple | |
251 matches are found, one can cycle through them using the standard | |
252 @samp{,} (@code{Info-index-next}) command of the Info reader. | |
253 | |
254 The variable @code{octave-help-files} is a list of files to search | |
255 through and defaults to @code{'("octave")}. If there is also an Octave | |
256 Local Guide with corresponding info file, say, @file{octave-LG}, you can | |
257 have @code{octave-help} search both files by | |
258 @lisp | |
259 (setq octave-help-files '("octave" "octave-LG")) | |
260 @end lisp | |
261 @noindent | |
262 in one of your Emacs startup files. | |
263 | |
264 @end table | |
265 | |
266 A common problem is that the @key{RET} key does @emph{not} indent the | |
267 line to where the new text should go after inserting the newline. This | |
268 is because the standard Emacs convention is that @key{RET} (aka | |
269 @kbd{C-m}) just adds a newline, whereas @key{LFD} (aka @kbd{C-j}) adds a | |
270 newline and indents it. This is particularly inconvenient for users with | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
271 keyboards which do not have a special @key{LFD} key at all; in such |
3294 | 272 cases, it is typically more convenient to use @key{RET} as the @key{LFD} |
273 key (rather than typing @kbd{C-j}). | |
274 | |
275 You can make @key{RET} do this by adding | |
276 @lisp | |
277 (define-key octave-mode-map "\C-m" | |
278 'octave-reindent-then-newline-and-indent) | |
279 @end lisp | |
280 @noindent | |
281 to one of your Emacs startup files. Another, more generally applicable | |
282 solution is | |
283 @lisp | |
284 (defun RET-behaves-as-LFD () | |
285 (let ((x (key-binding "\C-j"))) | |
286 (local-set-key "\C-m" x))) | |
287 (add-hook 'octave-mode-hook 'RET-behaves-as-LFD) | |
288 @end lisp | |
289 @noindent | |
290 (this works for all modes by adding to the startup hooks, without having | |
291 to know the particular binding of @key{RET} in that mode!). Similar | |
292 considerations apply for using @key{M-RET} as @key{M-LFD}. As Barry | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
293 A. Warsaw @email{bwarsaw@@cnri.reston.va.us} says in the documentation for his |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
294 @code{cc-mode}, ``This is a very common question. @code{:-)} If you want |
3294 | 295 this to be the default behavior, don't lobby me, lobby RMS!'' |
296 | |
297 The following variables can be used to customize Octave mode. | |
298 | |
299 @table @code | |
300 @item octave-auto-indent | |
301 Non-@code{nil} means auto-indent the current line after a semicolon or | |
302 space. Default is @code{nil}. | |
303 | |
304 @item octave-auto-newline | |
305 Non-@code{nil} means auto-insert a newline and indent after semicolons | |
306 are typed. The default value is @code{nil}. | |
307 | |
308 @item octave-blink-matching-block | |
309 Non-@code{nil} means show matching begin of block when inserting a space, | |
310 newline or @samp{;} after an else or end keyword. Default is @code{t}. | |
311 This is an extremely useful feature for automatically verifying that the | |
312 keywords match---if they don't, an error message is displayed. | |
313 | |
314 @item octave-block-offset | |
315 Extra indentation applied to statements in block structures. | |
316 Default is 2. | |
317 | |
318 @item octave-continuation-offset | |
319 Extra indentation applied to Octave continuation lines. | |
320 Default is 4. | |
321 | |
322 @item octave-continuation-string | |
323 String used for Octave continuation lines. | |
324 Normally @samp{\}. | |
325 | |
326 @item octave-mode-startup-message | |
327 If @code{t} (default), a startup message is displayed when Octave mode | |
328 is called. | |
329 | |
330 @end table | |
331 | |
332 If Font Lock mode is enabled, Octave mode will display | |
333 @itemize @bullet | |
334 @item | |
335 strings in @code{font-lock-string-face} | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
336 |
3294 | 337 @item |
338 comments in @code{font-lock-comment-face} | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
339 |
3294 | 340 @item |
341 the Octave reserved words (such as all block keywords) and the text | |
342 functions (such as @samp{cd} or @samp{who}) which are also reserved | |
343 using @code{font-lock-keyword-face} | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
344 |
3294 | 345 @item |
7594 | 346 the built-in operators (@samp{&&}, @samp{==}, @dots{}) using |
3294 | 347 @code{font-lock-reference-face} |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
348 |
3294 | 349 @item |
350 and the function names in function declarations in | |
351 @code{font-lock-function-name-face}. | |
352 @end itemize | |
353 | |
354 There is also rudimentary support for Imenu (currently, function names | |
355 can be indexed). | |
356 | |
357 Customization of Octave mode can be performed by modification of the | |
358 variable @code{octave-mode-hook}. It the value of this variable is | |
359 non-@code{nil}, turning on Octave mode calls its value. | |
360 | |
361 If you discover a problem with Octave mode, you can conveniently send a | |
362 bug report using @kbd{C-c C-b} (@code{octave-submit-bug-report}). This | |
363 automatically sets up a mail buffer with version information already | |
364 added. You just need to add a description of the problem, including a | |
365 reproducible test case and send the message. | |
366 | |
4167 | 367 @node Running Octave From Within Emacs |
3294 | 368 @section Running Octave From Within Emacs |
369 | |
370 The package @file{octave} provides commands for running an inferior | |
371 Octave process in a special Emacs buffer. Use | |
372 @lisp | |
373 M-x run-octave | |
374 @end lisp | |
375 @noindent | |
376 to directly start an inferior Octave process. If Emacs does not know | |
377 about this command, add the line | |
378 @lisp | |
379 (autoload 'run-octave "octave-inf" nil t) | |
380 @end lisp | |
381 @noindent | |
382 to your @file{.emacs} file. | |
383 | |
384 This will start Octave in a special buffer the name of which is | |
385 specified by the variable @code{inferior-octave-buffer} and defaults to | |
386 @code{"*Inferior Octave*"}. From within this buffer, you can | |
387 interact with the inferior Octave process `as usual', i.e., by entering | |
388 Octave commands at the prompt. The buffer is in Inferior Octave mode, | |
389 which is derived from the standard Comint mode, a major mode for | |
390 interacting with an inferior interpreter. See the documentation for | |
391 @code{comint-mode} for more details, and use @kbd{C-h b} to find out | |
392 about available special keybindings. | |
393 | |
394 You can also communicate with an inferior Octave process from within | |
395 files with Octave code (i.e., buffers in Octave mode), using the | |
396 following commands. | |
397 | |
398 @table @kbd | |
399 @item C-c i l | |
400 Send the current line to the inferior Octave process | |
401 (@code{octave-send-line}). | |
402 With positive prefix argument @var{N}, send that many lines. | |
403 If @code{octave-send-line-auto-forward} is non-@code{nil}, go to the | |
404 next unsent code line. | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
405 |
3294 | 406 @item C-c i b |
407 Send the current block to the inferior Octave process | |
408 (@code{octave-send-block}). | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
409 |
3294 | 410 @item C-c i f |
411 Send the current function to the inferior Octave process | |
412 (@code{octave-send-defun}). | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
413 |
3294 | 414 @item C-c i r |
415 Send the region to the inferior Octave process | |
416 (@code{octave-send-region}). | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
417 |
3294 | 418 @item C-c i s |
419 Make sure that `inferior-octave-buffer' is displayed | |
420 (@code{octave-show-process-buffer}). | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
421 |
3294 | 422 @item C-c i h |
423 Delete all windows that display the inferior Octave buffer | |
424 (@code{octave-hide-process-buffer}). | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
425 |
3294 | 426 @item C-c i k |
427 Kill the inferior Octave process and its buffer | |
428 (@code{octave-kill-process}). | |
429 @end table | |
430 | |
431 The effect of the commands which send code to the Octave process can be | |
432 customized by the following variables. | |
433 @table @code | |
434 @item octave-send-echo-input | |
435 Non-@code{nil} means echo input sent to the inferior Octave process. | |
436 Default is @code{t}. | |
437 | |
438 @item octave-send-show-buffer | |
439 Non-@code{nil} means display the buffer running the Octave process after | |
440 sending a command (but without selecting it). | |
441 Default is @code{t}. | |
442 @end table | |
443 | |
444 If you send code and there is no inferior Octave process yet, it will be | |
445 started automatically. | |
446 | |
447 The startup of the inferior Octave process is highly customizable. | |
448 The variable @code{inferior-octave-startup-args} can be used for | |
449 specifying command lines arguments to be passed to Octave on startup | |
450 as a list of strings. For example, to suppress the startup message and | |
451 use `traditional' mode, set this to @code{'("-q" "--traditional")}. | |
452 You can also specify a startup file of Octave commands to be loaded on | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
453 startup; note that these commands will not produce any visible output |
3294 | 454 in the process buffer. Which file to use is controlled by the variable |
455 @code{inferior-octave-startup-file}. If this is @code{nil}, the file | |
456 @file{~/.emacs-octave} is used if it exists. | |
457 | |
458 And finally, @code{inferior-octave-mode-hook} is run after starting the | |
459 process and putting its buffer into Inferior Octave mode. Hence, if you | |
460 like the up and down arrow keys to behave in the interaction buffer as | |
461 in the shell, and you want this buffer to use nice colors, add | |
462 @lisp | |
463 (add-hook 'inferior-octave-mode-hook | |
464 (lambda () | |
465 (turn-on-font-lock) | |
466 (define-key inferior-octave-mode-map [up] | |
467 'comint-previous-input) | |
468 (define-key inferior-octave-mode-map [down] | |
469 'comint-next-input))) | |
470 @end lisp | |
471 @noindent | |
472 to your @file{.emacs} file. You could also swap the roles of @kbd{C-a} | |
473 (@code{beginning-of-line}) and @code{C-c C-a} (@code{comint-bol}) using | |
474 this hook. | |
475 | |
476 @quotation | |
477 @strong{Note:} | |
478 If you set your Octave prompts to something different from the defaults, | |
479 make sure that @code{inferior-octave-prompt} matches them. | |
480 Otherwise, @emph{nothing} will work, because Emacs will have no idea | |
481 when Octave is waiting for input, or done sending output. | |
482 @end quotation | |
483 | |
4167 | 484 @node Using the Emacs Info Reader for Octave |
3294 | 485 @section Using the Emacs Info Reader for Octave |
486 | |
487 You can also set up the Emacs Info reader for dealing with the results | |
488 of Octave's @samp{help -i}. For this, the package @file{gnuserv} needs | |
489 to be installed, which unfortunately still does not come with GNU Emacs | |
490 (it does with XEmacs). It can be retrieved from any GNU Emacs Lisp Code | |
491 Directory archive, e.g.@: | |
492 @url{ftp://ftp.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive}, | |
493 in the @file{packages} subdirectory. The alpha version of an enhanced | |
494 version of gnuserv is available at | |
495 @url{ftp://ftp.wellfleet.com/netman/psmith/emacs/gnuserv-2.1alpha.tar.gz}. | |
496 | |
497 If @file{gnuserv} is installed, add the lines | |
498 @lisp | |
499 (autoload 'octave-help "octave-hlp" nil t) | |
500 (require 'gnuserv) | |
501 (gnuserv-start) | |
502 @end lisp | |
503 @noindent | |
504 to your @file{.emacs} file. | |
505 | |
506 You can use either `plain' Emacs Info or the function @code{octave-help} | |
507 as your Octave info reader (for @samp{help -i}). In the former case, | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
508 set the Octave variable @w{@env{INFO_PROGRAM}} to @code{"info-emacs-info"}. |
3294 | 509 The latter is perhaps more attractive because it allows to look up keys |
510 in the indices of @emph{several} info files related to Octave (provided | |
511 that the Emacs variable @code{octave-help-files} is set correctly). In | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
9209
diff
changeset
|
512 this case, set @w{@env{INFO_PROGRAM}} to @code{"info-emacs-octave-help"}. |
3294 | 513 |
514 If you use Octave from within Emacs, these settings are best done in the | |
515 @file{~/.emacs-octave} startup file (or the file pointed to by the Emacs | |
516 variable @code{inferior-octave-startup-file}). |