Skip to content

Commit 897c029

Browse files
committed
Automatically register gnuplot-mode for *.gp files
Additional minor documentation fixes.
1 parent 794ac1b commit 897c029

File tree

4 files changed

+13
-65
lines changed

4 files changed

+13
-65
lines changed

README.org

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -19,74 +19,32 @@ It is recommended to run =gnuplot-mode= on GNU Emacs 25 or above,
1919
using gnuplot version 5.0 or above.
2020

2121
* Installation
22-
** Using MELPA
2322

24-
The easiest way to install =gnuplot-mode= is to directly get it from
25-
[[http://melpa.milkbox.net][MELPA]]. After [[http://melpa.milkbox.net/#installing][configuring Emacs to use MELPA]], you should be able to
26-
install gnuplot-mode by typing
23+
The easiest way to install =gnuplot-mode= is to directly get it from [[https://elpa.nongnu.org/][NonGNU ELPA]]
24+
or [[http://melpa.org][MELPA]]. After configuring Emacs to use MELPA, you should be able to install
25+
gnuplot-mode by typing
2726

2827
: M-x install-package RET gnuplot RET
2928

3029
or do =M-x list-packages= and search for =gnuplot= in the list.
3130

32-
** Using =el-get=
33-
34-
The [[https://github.com/dimitri/el-get.git][el-get]] package includes a gnuplot-mode recipe. So to install
35-
simply call
36-
37-
: M-x el-get-install RET gnuplot-mode
38-
39-
Alternatively, you can directly place the following in your init file so that
40-
=el-get= can install and load gnuplot-mode at Emacs start up:
41-
42-
: (el-get 'sync 'gnuplot-mode)
43-
44-
** From source
45-
46-
After fetching the package's source from [[https://github.com/emacs-gnuplot/gnuplot][the homepage]], byte-compile
47-
the package's files using the =make= command and move the compiled
48-
=.elc= files to your chosen target directory.
49-
5031
* Configuration
51-
** Load Path
52-
53-
First of all, make sure that =gnuplot.el= is in your load-path (this is automatic if using a package helper like use-package). To do so manually, add the following snippet in your emacs configuration file
5432

55-
#+begin_src emacs-lisp
56-
(add-to-list 'load-path "/path/to/gnuplot")
57-
#+end_src
58-
59-
** Info File
60-
61-
The function =gnuplot-info-lookup-symbol= looks at the Gnuplot info
62-
file. For that function to work, a =gnuplot.info= file must be placed
63-
somewhere where info can find it. The following snippet allows you
64-
to put the =gnuplot.info= any place convenient:
65-
66-
#+begin_src emacs-lisp
67-
(add-to-list 'Info-default-directory-list "/path/to/info/file")
68-
#+end_src
69-
70-
** Enable Mode
71-
72-
You can automatically enable =gnuplot-mode= using the snippet below:
73-
74-
#+begin_src emacs-lisp
75-
(autoload 'gnuplot-mode "gnuplot" "Gnuplot major mode" t)
76-
(autoload 'gnuplot-make-buffer "gnuplot" "open a buffer in gnuplot-mode" t)
77-
(setq auto-mode-alist (append '(("\\.gp$" . gnuplot-mode)) auto-mode-alist))
78-
#+end_src
33+
=gnuplot-mode= is enabled automatically for =*.gp= files. The function
34+
=gnuplot-info-lookup-symbol= looks at the Gnuplot info file. For that function to
35+
work, a =gnuplot.info= file must be available in a directory in
36+
=Info-directory-list=.
7937

8038
* Usage
8139

82-
Apart from enabling =gnuplot-mode= automatically (see above), these
83-
two functions are useful for starting up gnuplot-mode:
40+
Apart from enabling =gnuplot-mode= automatically for =*.gp= files, these functions
41+
are useful for starting up gnuplot-mode:
8442

43+
- =M-x run-gnuplot= : start gnuplot repl
8544
- =M-x gnuplot-mode= : start gnuplot-mode in the current buffer
8645
- =M-x gnuplot-make-buffer= : open a new buffer (which is not visiting
8746
a file) and start gnuplot-mode in that buffer
8847

89-
9048
** Bindings
9149

9250
When =gnuplot-mode= is on, the following keybindings are available:
@@ -126,7 +84,7 @@ and suggest only relevant completion candidates on typing =M-TAB= or
12684
tab completion will suggest only plotting styles. This also enables
12785
more specific help topic lookup in the gnuplot info file, provided you
12886
have the right version of =gnuplot.info= installed (see the
129-
Installation section for isntructions).
87+
Installation section for instructions).
13088

13189
If the context-sensitivity annoys you, you can get simple
13290
non-context-sensitive completion back by toggling

gnuplot-context.el

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,12 +2256,8 @@ distribution. See gnuplot-context.el for details."
22562256
(setq eldoc-documentation-function nil)
22572257
(eldoc-mode 0)))
22582258

2259-
2260-
;;; All done!
22612259
(provide 'gnuplot-context)
2262-
22632260
;; Local Variables:
22642261
;; indent-tabs-mode: nil
22652262
;; End:
2266-
22672263
;;; gnuplot-context.el ends here

gnuplot-gui.el

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,13 +1650,8 @@ is non-nil if this is a \\='range widget."
16501650
(gnuplot-info-lookup-symbol (widget-value widget)
16511651
'gnuplot-mode))))
16521652

1653-
1654-
;;; just about done
1655-
16561653
(provide 'gnuplot-gui)
1657-
16581654
;; Local Variables:
16591655
;; indent-tabs-mode: nil
16601656
;; End:
1661-
16621657
;;; gnuplot-gui.el ends here

gnuplot.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,12 +2074,11 @@ following in your .emacs file:
20742074
(gnuplot-make-gnuplot-buffer)
20752075
(pop-to-buffer gnuplot-buffer))
20762076

2077-
;;; That's it! ----------------------------------------------------------------
2077+
;;;###autoload
2078+
(add-to-list 'auto-mode-alist '("\\.gp\\'" . gnuplot-mode))
20782079

20792080
(provide 'gnuplot)
2080-
20812081
;; Local Variables:
20822082
;; indent-tabs-mode: nil
20832083
;; End:
2084-
20852084
;;; gnuplot.el ends here

0 commit comments

Comments
 (0)