App-Chart

 view release on metacpan or  search on metacpan

lib/App/Chart/doc/chart.html  view on Meta::CPAN

<p>Chart looks at <code class="env">LANGUAGE</code> too (on all systems) for the preferred language
for stock and commodity names.
</p>

<hr>
</div>
</div>
<div class="chapter-level-extent" id="Emacs">
<div class="nav-panel">
<p>
Next: <a href="#Concept-Index" accesskey="n" rel="next">Concept Index</a>, Previous: <a href="#Internationalization" accesskey="p" rel="prev">Internationalization</a>, Up: <a href="#Top" accesskey="u" rel="up">Chart</a> &nbsp; [<a href="#Concept-Inde...
</div>
<h2 class="chapter" id="Emacs-1"><span>18 Emacs<a class="copiable-link" href="#Emacs-1"> &para;</a></span></h2>
<a class="index-entry-id" id="index-Emacs"></a>

<p><a class="uref" href="http://www.gnu.org/software/emacs/">http://www.gnu.org/software/emacs/</a>
</p>
<a class="index-entry-id" id="index-chartprog_002eel"></a>
<a class="index-entry-id" id="index-XEmacs"></a>
<p><samp class="file">chartprog.el</samp> shows the Chart watchlist and gets quotes within Emacs
(see <a data-manual="emacs" href="https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Top">The Emacs Editor</a> in <cite class="cite">The Emacs Editor</cite>).  It&rsquo;s designed for Emacs 21 and
higher, and also works with XEmacs 21 if you have the UTF-8 coding system (see
below).
</p>
<a class="index-entry-id" id="index-Autoload-chartprog_002eel"></a>
<a class="index-entry-id" id="index-chartprog_002dloaddefs_002eel"></a>
<a class="index-entry-id" id="index-_002eemacs"></a>
<p>The Debian package has the following setups already.  Otherwise, the best way
to use <samp class="file">chartprog.el</samp> is with autoloads for the commands.
<samp class="file">chartprog-loaddefs.el</samp> is a small file which sets this up.  Add the
following to your <samp class="file">.emacs</samp> file (see <a data-manual="emacs" href="https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Init-File">The Init File
<samp class="file">~/.emacs</samp></a> in <cite class="cite">The Emacs Editor</cite>),
</p>
<div class="example lisp">
<pre class="lisp-preformatted">(require 'chartprog-loaddefs)
</pre></div>

<a class="index-entry-id" id="index-load_002dpath"></a>
<a class="index-entry-id" id="index-site_002dlisp"></a>
<p>The build system currently doesn&rsquo;t install <samp class="file">chartprog.el</samp> into
<samp class="file">site-lisp</samp>, so you should copy it and <samp class="file">chartprog-loaddefs.el</samp> to
somewhere in your <code class="code">load-path</code> (see <a data-manual="emacs" href="https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Lisp-Libraries">Libraries of Lisp
Code for Emacs</a> in <cite class="cite">The Emacs Editor</cite>).
</p>



<ul class="mini-toc">
<li><a href="#Watchlist-and-Quotes" accesskey="1">Watchlist and Quotes</a></li>
<li><a href="#UTF_002d8" accesskey="2">UTF-8</a></li>
<li><a href="#Lisp" accesskey="3">Lisp</a></li>
<li><a href="#Simple-Emacs-Spreadsheet" accesskey="4">Simple Emacs Spreadsheet</a></li>
</ul>
<div class="section-level-extent" id="Watchlist-and-Quotes">
<h3 class="section"><span>18.1 Watchlist and Quotes<a class="copiable-link" href="#Watchlist-and-Quotes"> &para;</a></span></h3>

<a class="index-entry-id" id="index-chart_002dwatchlist"></a>
<p><kbd class="kbd">M-x chart-watchlist</kbd> displays the Favourites list in a buffer.  Key
<kbd class="key">a</kbd> adds a symbol.  <kbd class="kbd">C-k</kbd> and <kbd class="kbd">C-y</kbd> kill and yank symbols.
<kbd class="key">g</kbd> refreshes the quotes.  <kbd class="key">L</kbd> selects a different list (like the
Alerts list).  The usual <kbd class="kbd">C-h m</kbd> mode help shows other key bindings.
</p>
<p>Chart communicates changes to the lists between the Emacs display and a
running Chart GUI.  So if you have both open then changes in one are
reflected in the other a moment later.
</p>
<a class="index-entry-id" id="index-chart_002dquote"></a>
<p><kbd class="kbd">M-x chart-quote</kbd> displays a quote for a given symbol in the message area.
It prompts for the symbol with default a symbol at point.  <kbd class="key">Tab</kbd>
completion is available (see <a data-manual="emacs" href="https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Completion">Completion</a> in <cite class="cite">The Emacs Editor</cite>) using
the database symbols, favourites list, and previously requested symbols.
</p>
<a class="index-entry-id" id="index-chart_002dquote_002dat_002dpoint"></a>
<p><kbd class="kbd">M-x chart-quote-at-point</kbd> displays a quote for the symbol at point,
without prompting.
</p>
<p>The language, date formats, etc, follow the Chart locale selection described
in <a class="ref" href="#Internationalization">Internationalization</a>.  Emacs <kbd class="kbd">M-x set-language-environment</kbd> and
other Emacs setups don&rsquo;t influence the display.
</p>

</div>
<div class="section-level-extent" id="UTF_002d8">
<h3 class="section"><span>18.2 UTF-8<a class="copiable-link" href="#UTF_002d8"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Asian-characters-in-Emacs"></a>
<a class="index-entry-id" id="index-XEmacs-UTF_002d8"></a>

<p>UTF-8 is used in Emacs, the same as in the Gtk GUI display.  This is easiest
to implement, and should mean whatever is seen in the GUI can be seen in
Emacs.
</p>
<dl class="table">
<dt><a id="index-MULE_002dUCS"></a><span>Emacs 21<a class="copiable-link" href="#index-MULE_002dUCS"> &para;</a></span></dt>
<dd><p>If you use an Asian locale then you probably know Emacs 21 has limited support
for Asian parts of UTF-8.  The typical symptom is &lsquo;<samp class="samp">\207</samp>&rsquo;, &lsquo;<samp class="samp">\221</samp>&rsquo; etc
in the display.  Install the MULE-UCS package to add to the builtin
characters: <a class="uref" href="http://www.m17n.org">http://www.m17n.org</a>
</p>
</dd>
<dt>XEmacs 21</dt>
<dd><p>If you use XEmacs 21 you probably know it has no builtin UTF-8.  To run
<code class="code">chartprog.el</code> you must get one of the add-ons providing that.  MULE-UCS
is recommended (<a class="uref" href="http://www.m17n.org">http://www.m17n.org</a>), and <code class="code">chartprog.el</code> will
attempt to load it automatically.
</p></dd>
</dl>


</div>
<div class="section-level-extent" id="Lisp">
<h3 class="section"><span>18.3 Lisp<a class="copiable-link" href="#Lisp"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Lisp"></a>

<dl class="first-deffn first-defun-alias-first-deffn">
<dt class="deffn defun-alias-deffn" id="index-chart_002dlatest"><span class="category-def">Function: </span><span><strong class="def-name">chart-latest</strong> <var class="def-var-arguments">symbol &amp;optional field scale</var><a class="copiable-l...
<dd><p>Return the latest price for <var class="var">symbol</var> (a string) from Chart.  If there&rsquo;s no
information available (an unknown stock, not online, nothing cached, etc) the
return is <code class="code">nil</code>.
</p>
<div class="example">
<pre class="example-preformatted">(chart-latest &quot;F&quot;) &rArr; 19.55



( run in 0.770 second using v1.01-cache-2.11-cpan-2398b32b56e )