Thanks to visit codestin.com
Credit goes to github.com

Skip to content

yyr/gnuplot-mode

 
 

Repository files navigation

gnuplot-mode, version 0.7

This directory contains files for running Gnuplot from within emacs. This package was assembled by Bruce Ravel <[email protected]>. See the homepage at http://xafs.org/BruceRavel/GnuplotMode

Contents

FileDescription
README.orgthis file
INSTALLthorough installation instructions
gnuplot.elgnuplot mode for emacs
gnuplot-gui.ela GUI for setting command arguments interactively
gnuplot-context.elcontext-sensitive completion and help lookup
dot.ela short lisp file used by the Makefile
gnuplot.infoinfo version of gnuplot 4.6 help
gpelcard.texquick reference card for gnuplot mode (latex)
dotemacs.elexample .emacs lines for enabling gnuplot mode

Files inherited from the gnuplot distribution for making gnuplot-mode

  • Makefile.am
  • configure.ac
  • Makefile.dst

Installation

Installing from MELPA

gnuplot-mode can be installed directly from http://melpa.milkbox.net as the “gnuplot” package (note: not “gnuplot-mode”, which is a different package). Note that MELPA always builds the latest commit to the master branch, which may be ahead of the official release.

el-get users

El-get does contain gnuplot-mode recipe. So to install simply call,

M-x el-get-install RET gnuplot-mode

Alternatively, you can place the following in your init file sothat el-get can install and load gnuplot-mode at Emacs start up.

(el-get 'sync 'gnuplot-mode)

Installing from the git repository

To do a full install from a clone of the git repository you will need recent versions of GNU Autotools. This is for consistency with Gnuplot CVS, which has an autotools-based build system.

Within the cloned repository, run autoreconf and automake --add-missing. Then continue from step 2 of the instructions for “Installing from a .tar.gz distribution” below.

Or you could just copy the three .el files to your .emacs.d and byte-compile them within Emacs. (Note that you should byte-compile them, especially gnuplot-context.el, which is unacceptably slow when run interpreted).

Installing from a .tar.gz distribution

Gnuplot-mode has been included with Gnuplot since the 3.7 distribution. The installation instructions for the free-standing distribution have been modified to be consistent with that.

  1. Unpack the gnuplot.tar.gz and cd to the gnuplot directory.
  2. Type ./configure. If configure doesn’t work for you, see note 7 below.

    You can specify the Emacs executable to use for byte-compiling by using the EMACS environment variable: for example ./configure EMACS=xemacs to use XEmacs. On Mac OS X, if your Emacs application is located at /Applications/Emacs.app, you should do ./configure EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs

    You can also optionally specify the --with-lispdir= switch to change where make install will put the compiled Lisp files.

    Note that if you run a shell within Emacs, it is often a good idea not to build this package from inside it. Run it in a separate terminal instead, or you may get strange environment variable and load path conflicts.

  3. Run make. There will be some compilation warnings, but they should be harmless.
  4. Run make install, or manually move the lisp files to the system site_lisp directory if you are installing as root. If you are installing as a normal user move the ~e .elc files to a place where emacs, i.e. your personal emacs directory.
  5. Insert the contents of the dotemacs file into your .emacs file or into the system’s emacs start-up file to enable gnuplot mode.
  6. The function gnuplot-info-lookup-symbol looks at the Gnuplot info file that comes with this package or that can be made from the Gnuplot distribution. For that function to work, the file gnuplot.info must be placed somewhere where info can find it, for example /usr/info A line like this in your .emacs allows you to put gnuplot.info any place convenient: (add-to-list 'Info-default-directory-list "/path/to/file")
  7. To make the reference card, run make pdf or make ps.

New features for gnuplot-mode 0.7

New syntax for gnuplot version 4

gnuplot-mode supports the new curly-brace-block do and if statements introduced in recent versions of gnuplot. The indentation code to handle these is pretty simple, but should work. Please report any bugs. The number of columns to offset inner blocks is controlled by the gnuplot-basic-offset variable.

Context-sensitive keyword completion

By default gnuplot-mode will try to parse your commands as you type, so that tab completion via M-TAB or TAB will only suggest relevant completion candidates. For example, with point after the with of a plot command, tab completion will suggest only plotting styles. This also enables more specific help topic lookup in the gnuplot info file, provided you have the right version of gnuplot.info installed.

If the context-sensitivity annoys you, you can get the old behavior back by toggling gnuplot-context-sensitive-mode. See also the variable gnuplot-tab-completion.

Eldoc mode

If you install the file gnuplot-eldoc.el from a recent Gnuplot distribution, gnuplot-mode can show syntax hints in the modeline when eldoc-mode is turned on and context sensitivity is enabled.

Inline images

You can optionally have plots displayed inline in the Gnuplot comint process buffer. This is handy for trying things out without having to switch between Emacs and the Gnuplot display. Call gnuplot-inline-imge-mode or type C-c M-i to try it out. This feature is implemented using temporary .png files, and is also somewhat experimental. It requires Gnuplot to have png support and a GNU Emacs with image support. Please report bugs.

NOTES

  1. Version 0.7 of gnuplot-mode is designed for use with gnuplot version 4.4 and up. It will also mostly work fine with older versions. If it doesn’t work with newer versions, that’s a bug ;-)

    This version has mostly been tested under GNU Emacs 23 and 24. It should also work on GNU Emacs 22 and XEmacs 21. Earlier than that it may work, but has not been tested.

  2. If “configure” doesn’t work for you, the file “Makefile.dst” can be used. In that case do, “make -f Makefile.dst” and carry on from there.
  3. The gnuplot-mode distribution comes with the version of the gnuplot info file that gets made by gnuplot 4.6. Use it rather than the old one. If you really must use the older info file, see the document string for the variable `gnuplot-info-hook’. If you already have the info file installed on your computer, you will not need the one that comes with gnuplot-mode.
  4. The interactive graphical graphical interface to setting command arguments contained in gnuplot-gui.el is experimental. It is incomplete and may make mistakes. Hopefully, you will find it useful. It requires that you are using a version of emacs with the widget library installed or that you have installed it yourself. Version numbers in the 20’s of Emacs and XEmacs ship with the widget library. For version numbers in the 19’s, it can be obtained at http://www.dina.kvl.dk/~abraham/custom/
  5. By definition, the context sensitive completion has to know a fair bit about the structure of the gnuplot language. If you use it with an old version of gnuplot (pre version 4) it may make mistakes. Most of gnuplot 4.6’s command language is parsed correctly, with the exception of the various set terminal commands.
  6. Gnuplot’s pause -1 command, which waits for the user to press a key, is problematic when running under Emacs. Sending pause -1 to the running gnuplot process will make Emacs appear to freeze. (It isn’t really crashed: typing C-g will unlock it and let you continue). The workaround for now is to make Gnuplot output a string before pausing, by doing
pause -1 "Hit return"

or similar. Thanks to Jim Mehl for reporting this issue.

The todo list

  1. Use ELPA

    Gnuplot-mode is already on http://melpa.milkbox.net, but it would be good to get it into the other repositories too.

  2. Using gnuplot-mode on windows is problematic. John Handy says:

    You probably get nagged quite a bit about this. Some have been running into issues with gnuplot-mode and Windows and I’m wondering if you have any comments. I use it just fine on Linux, but it seems that Windows users are not able to send data to gnuplot successfully.

    Org-mode also uses gnuplot-mode and this org-plot and org-mode babel+gnuplot are not working correctly on Windows.

    Any thoughts? I’m hoping to include any results in the Org-mode wiki for gnuplot use: http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.php

    If you’re interested, here are some of the threads I’m referring to: http://newsgroups.derkeiler.com/Archive/Comp/comp.emacs/2007-07/msg00159.html http://www.mail-archive.com/[email protected]/msg14544.html http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/53489131c79f62b3

    If you’d like to see my summary of the issues to the org-mode mailing list, it’s here: http://thread.gmane.org/gmane.emacs.orgmode/30235

About

A major mode for Emacs for interacting with Gnuplot

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Emacs Lisp 69.0%
  • Shell 31.0%