/usr/share/doc/octave-htmldoc/interpreter/Running-Octave-from-Within-Emacs.html is in octave-htmldoc 3.8.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Octave: Running Octave from Within Emacs</title>
<meta name="description" content="GNU Octave: Running Octave from Within Emacs">
<meta name="keywords" content="GNU Octave: Running Octave from Within Emacs">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Emacs-Octave-Support.html#Emacs-Octave-Support" rel="up" title="Emacs Octave Support">
<link href="Using-the-Emacs-Info-Reader-for-Octave.html#Using-the-Emacs-Info-Reader-for-Octave" rel="next" title="Using the Emacs Info Reader for Octave">
<link href="Using-Octave-Mode.html#Using-Octave-Mode" rel="prev" title="Using Octave Mode">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Running-Octave-from-Within-Emacs"></a>
<div class="header">
<p>
Next: <a href="Using-the-Emacs-Info-Reader-for-Octave.html#Using-the-Emacs-Info-Reader-for-Octave" accesskey="n" rel="next">Using the Emacs Info Reader for Octave</a>, Previous: <a href="Using-Octave-Mode.html#Using-Octave-Mode" accesskey="p" rel="prev">Using Octave Mode</a>, Up: <a href="Emacs-Octave-Support.html#Emacs-Octave-Support" accesskey="u" rel="up">Emacs Octave Support</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Running-Octave-from-Within-Emacs-1"></a>
<h3 class="appendixsec">H.3 Running Octave from Within Emacs</h3>
<p>The package <samp>octave</samp> provides commands for running an inferior
Octave process in a special Emacs buffer. Use
</p><div class="lisp">
<pre class="lisp">M-x run-octave
</pre></div>
<p>to directly start an inferior Octave process. If Emacs does not know
about this command, add the line
</p><div class="lisp">
<pre class="lisp">(autoload 'run-octave "octave-inf" nil t)
</pre></div>
<p>to your <samp>.emacs</samp> file.
</p>
<p>This will start Octave in a special buffer the name of which is
specified by the variable <code>inferior-octave-buffer</code> and defaults to
<code>"*Inferior Octave*"</code>. From within this buffer, you can
interact with the inferior Octave process ‘as usual’, i.e., by entering
Octave commands at the prompt. The buffer is in Inferior Octave mode,
which is derived from the standard Comint mode, a major mode for
interacting with an inferior interpreter. See the documentation for
<code>comint-mode</code> for more details, and use <kbd>C-h b</kbd> to find out
about available special keybindings.
</p>
<p>You can also communicate with an inferior Octave process from within
files with Octave code (i.e., buffers in Octave mode), using the
following commands.
</p>
<dl compact="compact">
<dt><kbd>C-c i l</kbd></dt>
<dd><p>Send the current line to the inferior Octave process
(<code>octave-send-line</code>).
With positive prefix argument <var>N</var>, send that many lines.
If <code>octave-send-line-auto-forward</code> is non-<code>nil</code>, go to the
next unsent code line.
</p>
</dd>
<dt><kbd>C-c i b</kbd></dt>
<dd><p>Send the current block to the inferior Octave process
(<code>octave-send-block</code>).
</p>
</dd>
<dt><kbd>C-c i f</kbd></dt>
<dd><p>Send the current function to the inferior Octave process
(<code>octave-send-defun</code>).
</p>
</dd>
<dt><kbd>C-c i r</kbd></dt>
<dd><p>Send the region to the inferior Octave process
(<code>octave-send-region</code>).
</p>
</dd>
<dt><kbd>C-c i s</kbd></dt>
<dd><p>Make sure that ‘inferior-octave-buffer’ is displayed
(<code>octave-show-process-buffer</code>).
</p>
</dd>
<dt><kbd>C-c i h</kbd></dt>
<dd><p>Delete all windows that display the inferior Octave buffer
(<code>octave-hide-process-buffer</code>).
</p>
</dd>
<dt><kbd>C-c i k</kbd></dt>
<dd><p>Kill the inferior Octave process and its buffer
(<code>octave-kill-process</code>).
</p></dd>
</dl>
<p>The effect of the commands which send code to the Octave process can be
customized by the following variables.
</p>
<dl compact="compact">
<dt><code>octave-send-echo-input</code></dt>
<dd><p>Non-<code>nil</code> means echo input sent to the inferior Octave process.
Default is <code>t</code>.
</p>
</dd>
<dt><code>octave-send-show-buffer</code></dt>
<dd><p>Non-<code>nil</code> means display the buffer running the Octave process after
sending a command (but without selecting it).
Default is <code>t</code>.
</p></dd>
</dl>
<p>If you send code and there is no inferior Octave process yet, it will be
started automatically.
</p>
<p>The startup of the inferior Octave process is highly customizable.
The variable <code>inferior-octave-startup-args</code> can be used for
specifying command lines arguments to be passed to Octave on startup
as a list of strings. For example, to suppress the startup message and
use ‘traditional’ mode, set this to <code>'("-q" "--traditional")</code>.
You can also specify a startup file of Octave commands to be loaded on
startup; note that these commands will not produce any visible output
in the process buffer. Which file to use is controlled by the variable
<code>inferior-octave-startup-file</code>. If this is <code>nil</code>, the file
<samp>~/.emacs-octave</samp> is used if it exists.
</p>
<p>And finally, <code>inferior-octave-mode-hook</code> is run after starting the
process and putting its buffer into Inferior Octave mode. Hence, if you
like the up and down arrow keys to behave in the interaction buffer as
in the shell, and you want this buffer to use nice colors, add
</p><div class="lisp">
<pre class="lisp">(add-hook 'inferior-octave-mode-hook
(lambda ()
(turn-on-font-lock)
(define-key inferior-octave-mode-map [up]
'comint-previous-input)
(define-key inferior-octave-mode-map [down]
'comint-next-input)))
</pre></div>
<p>to your <samp>.emacs</samp> file. You could also swap the roles of <kbd>C-a</kbd>
(<code>beginning-of-line</code>) and <code>C-c C-a</code> (<code>comint-bol</code>) using
this hook.
</p>
<blockquote>
<p><strong>Note</strong> that if you set your Octave prompts to something different
from the defaults, make sure that <code>inferior-octave-prompt</code> matches
them. Otherwise, <em>nothing</em> will work, because Emacs will not know
when Octave is waiting for input, or done sending output.
</p></blockquote>
<hr>
<div class="header">
<p>
Next: <a href="Using-the-Emacs-Info-Reader-for-Octave.html#Using-the-Emacs-Info-Reader-for-Octave" accesskey="n" rel="next">Using the Emacs Info Reader for Octave</a>, Previous: <a href="Using-Octave-Mode.html#Using-Octave-Mode" accesskey="p" rel="prev">Using Octave Mode</a>, Up: <a href="Emacs-Octave-Support.html#Emacs-Octave-Support" accesskey="u" rel="up">Emacs Octave Support</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|