INSTALL.Win9x 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. Time-stamp: <1999-05-15 11:29:23 bruce>
  2. This file describes how to install gnuplot-mode on a Windows 95 or 98
  3. system so that you may use Gnuplot from within Emacs.
  4. Gnuplot-mode was written by Bruce Ravel <ravel@phys.washington.edu>.
  5. Contact him with any questions or comments regarding gnuplot-mode.
  6. For questions or comments regarding Emacs or Gnuplot, contact the
  7. authors of those programs.
  8. ------O------
  9. Gnuplot-mode and Gnuplot can be used with Emacs on a Windows 95 or 98
  10. system, although a small amount of additional effort will be required
  11. to get everything working.
  12. The best solution is to install a sufficiently recent version of
  13. Gnuplot which includes the ability to run as a child process (as of
  14. May 15 1999 there is no such version). A more complete description of
  15. this is attached to the end of this document. Recent versions of
  16. Gnuplot can be found at ftp://ftp.gnuplot.vt.edu/pub/gnuplot/
  17. If you install a very recent version of gnuplot which includes the
  18. ability to run as a child process, then the installation
  19. instructions for gnuplot-mode are much simpler. After following
  20. the normal installation instructions, just add the following line
  21. to your Emacs initialization file:
  22. (add-hook 'gnuplot-load-hook
  23. '(lambda ()
  24. (setq gnuplot-program
  25. "c:/path/to/pgnuplot/pgnuplot.exe")))
  26. Replace "c:/path/to/pgnuplot/pgnuplot.exe" with the full path to
  27. pgnuplot on your computer.
  28. You can make gnuplot work even with an older version of Gnuplot for
  29. Windows by following these steps:
  30. 1. Edit the file pgnuplot.c so that the variable FULLPATH at line 5
  31. is pointing at the actual location of the Gnuplot executable on
  32. your computer.
  33. 2. Using any C compiler, compile pgnuplot.c to pgnuplot.exe
  34. 3. Byte-compile gnuplot.el and gnuplot-gui.el as described in the
  35. INSTALL file in the main gnuplot-mode directory. Make sure the
  36. .elc files a placed in a location where Emacs knows to look,
  37. i.e. in its load-path. You can add new directories to the
  38. load-path by placing the following line near the top of your
  39. Emacs initialization file (.emacs or _emacs):
  40. (setq load-path (append (list "c:/path/to/lisp/files")
  41. load-path))
  42. 4. Add these lines to your Emacs initialization file (.emacs or
  43. _emacs):
  44. (autoload 'gnuplot-mode "gnuplot"
  45. "gnuplot major mode" t)
  46. (autoload 'gnuplot-make-buffer "gnuplot"
  47. "open a buffer in gnuplot-mode" t)
  48. (setq auto-mode-alist (append '(("\\.gp$" . gnuplot-mode))
  49. auto-mode-alist))
  50. (global-set-key [(f9)] 'gnuplot-make-buffer)
  51. (add-hook 'gnuplot-load-hook
  52. '(lambda ()
  53. (setq gnuplot-program
  54. "c:/path/to/pgnuplot/pgnuplot.exe")))
  55. The last line is very important. It tells Emacs to launch
  56. pgnuplot.exe as its subprocess rather than Gnuplot itself. The
  57. first four lines are explained in the comments near the
  58. beginning of gnuplot.el.
  59. Replace "c:/path/to/pgnuplot/pgnuplot.exe" with the full path to
  60. pgnuplot on your computer.
  61. ------O------
  62. Resources:
  63. Emacs for Windows NT/9x:
  64. http://www.cs.washington.edu/homes/voelker/ntemacs.html
  65. The Gnuplot distribution site (includes Windows executables):
  66. ftp://ftp.gnuplot.vt.edu/pub/gnuplot/
  67. The gnuplot-mode homepage:
  68. http://feff.phys.washington.edu/~ravel/gnuplot/
  69. Cygwin, Unix tools for Windows NT/9x:
  70. http://sourceware.cygnus.com/cygwin/
  71. ------O------
  72. What follows are the comments of the author of pgnuplot.c,
  73. Hans-Bernhard Broeker, describing the function and need for this
  74. program.
  75. Thu, 11 Feb 1999
  76. Here's the tiny program I came up with to fix the single most
  77. annoying problem specific to the Windows version of gnuplot: lack
  78. of support for piping commands into it via STDIN.
  79. For those who don't know the context: Windows GUI programs like
  80. wgnuplot do not have any access to the usual I/O channels stdin and
  81. stdout. So the usual method to allow gnuplot to run as a child
  82. application, being controlled via a command stream by another one
  83. (i.e. the classical 'popen("gnuplot", "w");' method), can not work
  84. on Windoze.
  85. It's implemented as a separate Win32 console application (that's a
  86. different kind of program, which cannot display GUI windows, but
  87. does have STDIN/STDOUT channels). This program will get hold of a
  88. running wgnuplot (or start one itself, passing on any command line
  89. arguments), and deliver each character it sees on its own standard
  90. input stream as a keypress message to the command window of
  91. wgnuplot.
  92. Effectively, this makes 'pgnuplot.exe' an almost 100% complete
  93. replacement of wgnuplot.exe, as far as starting the program is
  94. concerned, but adding the stdin capabilities. A different way of
  95. seeing it is as a prototype of a general application that wants to
  96. run wgnuplot as a child process.