Skip to content

Commit 68508cd

Browse files
committed
Remove the gnuplot-load-hook, prefer with-eval-after-load
1 parent da61a96 commit 68508cd

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

gnuplot.el

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,11 @@
114114
:group 'gnuplot-hooks
115115
:type 'hook)
116116

117-
(defcustom gnuplot-load-hook nil
118-
"Hook run when gnuplot.el is first loaded."
119-
:group 'gnuplot-hooks
120-
:type 'hook)
117+
(defvar gnuplot-load-hook nil)
118+
(make-obsolete-variable
119+
'gnuplot-load-hook
120+
"The package loading hook has been removed, use `with-eval-after-load' instead."
121+
"8.0")
121122

122123
(defcustom gnuplot-after-plot-hook (list #'gnuplot-trim-gnuplot-buffer)
123124
"Hook run after gnuplot plots something.
@@ -543,18 +544,16 @@ The easiest way to customize the submenus is to use the custom
543544
package. Just type \\[gnuplot-customize] and follow your nose.
544545
545546
You can also add new items to any of these sub-menus by adding to the
546-
`gnuplot-load-hook' in your .emacs file. Here is an example of adding
547-
the \"regis\" terminal type to the terminal sub-menu:
547+
`with-eval-after-load' blocks in your .emacs file. Here is an example of
548+
adding the \"regis\" terminal type to the terminal sub-menu:
548549
549-
(add-hook
550-
'gnuplot-load-hook
551-
'(lambda ()
550+
(with-eval-after-load 'gnuplot
552551
(setq gnuplot-insertions-terminal
553552
(append gnuplot-insertions-terminal
554553
(list
555554
[\"regis\"
556555
(gnuplot-insert \"set terminal regis\")
557-
t])))))")
556+
t]))))")
558557

559558
(defvar gnuplot-insertions-top ()
560559
"Top part of insertions menu.
@@ -2259,11 +2258,7 @@ following in your .emacs file:
22592258

22602259
;;; That's it! ----------------------------------------------------------------
22612260

2262-
2263-
;;; --- final chores: provide 'gnuplot and run load-hook
2264-
;; provide before run-hooks suggested by <DB>
22652261
(provide 'gnuplot)
2266-
(run-hooks 'gnuplot-load-hook)
22672262

22682263
;; Local Variables:
22692264
;; indent-tabs-mode: nil

gpelcard.tex

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,6 @@
322322
\variable{gnuplot-mode-hook}{nil}{Functions run when gnuplot minor
323323
mode is entered.}
324324
%
325-
\variable{gnuplot-load-hook}{nil}{Functions run when gnuplot.el is
326-
first loaded.}
327-
%
328325
\variable{gnuplot-after-plot-hook}{nil}{Functions run after gnuplot
329326
plots an entire buffer. See the doc string for
330327
\texttt{gnuplot-recently-sent}.}

0 commit comments

Comments
 (0)