Skip to content

Commit 11e1741

Browse files
committed
Use hashed symbols
gnuplot-inline-image-mode does not exist anymore
1 parent 432fe8f commit 11e1741

File tree

1 file changed

+42
-46
lines changed

1 file changed

+42
-46
lines changed

gnuplot.el

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
:group 'gnuplot-hooks
120120
:type 'hook)
121121

122-
(defcustom gnuplot-after-plot-hook nil
122+
(defcustom gnuplot-after-plot-hook (list #'gnuplot-trim-gnuplot-buffer)
123123
"Hook run after gnuplot plots something.
124124
This is the last thing done by the functions for plotting a line, a
125125
region, a buffer, or a file."
@@ -389,8 +389,8 @@ and `gnuplot-dedicated-display-mode'."
389389
(const :tag "No" nil)
390390
(const :tag "In Comint buffer" inline)
391391
(const :tag "In dedicated buffer" dedicated))
392-
:initialize 'custom-initialize-default
393-
:set 'gnuplot-set-display-mode)
392+
:initialize #'custom-initialize-default
393+
:set #'gnuplot-set-display-mode)
394394

395395
(defcustom gnuplot-image-format "png"
396396
"Image format to use for displaying images within Emacs.
@@ -403,8 +403,8 @@ This only has an effect when `gnuplot-inline-image-mode' is
403403
non-nil."
404404
:group 'gnuplot
405405
:type 'string
406-
:initialize 'custom-initialize-default
407-
:set 'gnuplot-set-display-mode)
406+
:initialize #'custom-initialize-default
407+
:set #'gnuplot-set-display-mode)
408408

409409
(defgroup gnuplot-faces nil
410410
"Text faces used by gnuplot-mode."
@@ -423,27 +423,26 @@ non-nil."
423423

424424
(defvar gnuplot-mode-map
425425
(let ((map (make-sparse-keymap)))
426-
(define-key map "\C-c\C-b" 'gnuplot-send-buffer-to-gnuplot)
427-
(define-key map "\C-c\C-c" 'comment-region) ; <RF>
426+
(define-key map "\C-c\C-b" #'gnuplot-send-buffer-to-gnuplot)
427+
(define-key map "\C-c\C-c" #'comment-region) ; <RF>
428428
(define-key map "\C-c\C-o" 'gnuplot-gui-set-options-and-insert)
429-
(define-key map "\C-c\C-e" 'gnuplot-show-gnuplot-buffer)
430-
(define-key map "\C-c\C-f" 'gnuplot-send-file-to-gnuplot)
431-
(define-key map "\C-c\C-d" 'gnuplot-info-lookup-symbol)
432-
(define-key map "\C-c\C-i" 'gnuplot-insert-filename)
433-
(define-key map "\C-c\C-j" 'gnuplot-forward-script-line)
434-
(define-key map "\C-c\C-k" 'gnuplot-kill-gnuplot-buffer)
435-
(define-key map "\C-c\C-l" 'gnuplot-send-line-to-gnuplot)
436-
(define-key map "\C-c\C-n" 'gnuplot-negate-option)
437-
(define-key map "\C-c\C-r" 'gnuplot-send-region-to-gnuplot)
438-
(define-key map (kbd "C-M-x") 'gnuplot-send-line-to-gnuplot)
439-
(define-key map "\C-c\C-v" 'gnuplot-send-line-and-forward)
440-
(define-key map "\C-c\C-z" 'gnuplot-customize)
441-
(define-key map "\C-i" 'indent-for-tab-command)
442-
(define-key map "\C-m" 'newline-and-indent)
443-
(define-key map "\C-c\M-i" 'gnuplot-inline-image-mode)
444-
(define-key map (kbd "}") 'gnuplot-electric-insert)
445-
(define-key map "\M-\r" 'completion-at-point)
446-
(define-key map "\M-\t" 'completion-at-point)
429+
(define-key map "\C-c\C-e" #'gnuplot-show-gnuplot-buffer)
430+
(define-key map "\C-c\C-f" #'gnuplot-send-file-to-gnuplot)
431+
(define-key map "\C-c\C-d" #'gnuplot-info-lookup-symbol)
432+
(define-key map "\C-c\C-i" #'gnuplot-insert-filename)
433+
(define-key map "\C-c\C-j" #'gnuplot-forward-script-line)
434+
(define-key map "\C-c\C-k" #'gnuplot-kill-gnuplot-buffer)
435+
(define-key map "\C-c\C-l" #'gnuplot-send-line-to-gnuplot)
436+
(define-key map "\C-c\C-n" #'gnuplot-negate-option)
437+
(define-key map "\C-c\C-r" #'gnuplot-send-region-to-gnuplot)
438+
(define-key map (kbd "C-M-x") #'gnuplot-send-line-to-gnuplot)
439+
(define-key map "\C-c\C-v" #'gnuplot-send-line-and-forward)
440+
(define-key map "\C-c\C-z" #'gnuplot-customize)
441+
(define-key map "\C-i" #'indent-for-tab-command)
442+
(define-key map "\C-m" #'newline-and-indent)
443+
(define-key map (kbd "}") #'gnuplot-electric-insert)
444+
(define-key map "\M-\r" #'completion-at-point)
445+
(define-key map "\M-\t" #'completion-at-point)
447446
(define-key map [S-mouse-2] 'gnuplot-gui-mouse-set)
448447

449448
map))
@@ -1351,8 +1350,6 @@ this function is attached to `gnuplot-after-plot-hook'"
13511350
(delete-region (line-beginning-position) (1+ (line-end-position))))
13521351
(goto-char (point-max))))))
13531352

1354-
(add-hook 'gnuplot-after-plot-hook 'gnuplot-trim-gnuplot-buffer nil nil)
1355-
13561353

13571354
;;; --- functions controlling the gnuplot process
13581355

@@ -1402,13 +1399,13 @@ buffer."
14021399
(setq-local parse-sexp-lookup-properties t)
14031400
(setq-local syntax-propertize-function #'gnuplot-syntax-propertize)
14041401

1405-
(add-hook 'kill-buffer-hook 'gnuplot-close-down nil t)
1402+
(add-hook 'kill-buffer-hook #'gnuplot-close-down nil t)
14061403

14071404
(add-hook 'comint-output-filter-functions
1408-
'comint-postoutput-scroll-to-bottom
1405+
#'comint-postoutput-scroll-to-bottom
14091406
nil t)
14101407
(add-hook 'comint-output-filter-functions
1411-
'gnuplot-protect-prompt-fn
1408+
#'gnuplot-protect-prompt-fn
14121409
nil t)
14131410

14141411
;; Set up completion, using completion-at-point
@@ -1422,17 +1419,16 @@ buffer."
14221419
(easy-menu-add gnuplot-comint-mode-menu gnuplot-comint-mode-map))
14231420

14241421
;; Key bindings for gnuplot-comint-mode
1425-
(define-key gnuplot-comint-mode-map "\M-\C-p" 'gnuplot-plot-from-comint)
1426-
(define-key gnuplot-comint-mode-map "\M-\C-f" 'gnuplot-save-and-plot-from-comint)
1427-
(define-key gnuplot-comint-mode-map "\C-d" 'gnuplot-delchar-or-maybe-eof)
1428-
(define-key gnuplot-comint-mode-map "\M-\r" 'completion-at-point)
1429-
(define-key gnuplot-comint-mode-map "\M-\t" 'completion-at-point)
1430-
(define-key gnuplot-comint-mode-map "\C-c\C-d" 'gnuplot-info-lookup-symbol)
1431-
(define-key gnuplot-comint-mode-map "\C-c\C-i" 'gnuplot-insert-filename)
1432-
(define-key gnuplot-comint-mode-map "\C-c\C-n" 'gnuplot-negate-option)
1433-
(define-key gnuplot-comint-mode-map "\C-c\C-z" 'gnuplot-customize)
1434-
(define-key gnuplot-comint-mode-map "\C-c\C-e" 'gnuplot-pop-to-recent-buffer)
1435-
(define-key gnuplot-comint-mode-map "\C-c\M-i" 'gnuplot-inline-image-mode)
1422+
(define-key gnuplot-comint-mode-map "\M-\C-p" #'gnuplot-plot-from-comint)
1423+
(define-key gnuplot-comint-mode-map "\M-\C-f" #'gnuplot-save-and-plot-from-comint)
1424+
(define-key gnuplot-comint-mode-map "\C-d" #'gnuplot-delchar-or-maybe-eof)
1425+
(define-key gnuplot-comint-mode-map "\M-\r" #'completion-at-point)
1426+
(define-key gnuplot-comint-mode-map "\M-\t" #'completion-at-point)
1427+
(define-key gnuplot-comint-mode-map "\C-c\C-d" #'gnuplot-info-lookup-symbol)
1428+
(define-key gnuplot-comint-mode-map "\C-c\C-i" #'gnuplot-insert-filename)
1429+
(define-key gnuplot-comint-mode-map "\C-c\C-n" #'gnuplot-negate-option)
1430+
(define-key gnuplot-comint-mode-map "\C-c\C-z" #'gnuplot-customize)
1431+
(define-key gnuplot-comint-mode-map "\C-c\C-e" #'gnuplot-pop-to-recent-buffer)
14361432

14371433
;; Menu for gnuplot-comint-mode
14381434
(defvar gnuplot-comint-mode-menu nil
@@ -1444,7 +1440,7 @@ buffer."
14441440
(unless (and gnuplot-process (eq (process-status gnuplot-process) 'run)
14451441
gnuplot-buffer (buffer-live-p gnuplot-buffer))
14461442
(message "Starting gnuplot plotting program...")
1447-
(let ((gnuplot-cmd (list 'make-comint gnuplot-process-name gnuplot-program)))
1443+
(let ((gnuplot-cmd (list #'make-comint gnuplot-process-name gnuplot-program)))
14481444
(when gnuplot-program-args
14491445
(setq gnuplot-cmd (append gnuplot-cmd '(nil) (split-string gnuplot-program-args))))
14501446
(setq gnuplot-buffer (eval gnuplot-cmd)
@@ -1571,10 +1567,10 @@ gnuplot process buffer will be displayed in a window."
15711567
(format "set terminal %s\n" gnuplot-image-format))
15721568
(gnuplot-inline-image-set-output)
15731569
(add-hook 'comint-output-filter-functions
1574-
'gnuplot-insert-inline-image-output nil t))
1570+
#'gnuplot-insert-inline-image-output nil t))
15751571
(gnuplot-send-hiding-output "set terminal pop\n")
15761572
(remove-hook 'comint-output-filter-functions
1577-
'gnuplot-insert-inline-image-output t)))))
1573+
#'gnuplot-insert-inline-image-output t)))))
15781574

15791575
(defun gnuplot-inline-image-set-output ()
15801576
"Set Gnuplot's output file to `gnuplot-inline-image-filename'."
@@ -1630,7 +1626,7 @@ updates Gnuplot with the appropriate 'set output' command."
16301626
"Send STRING to the running Gnuplot process invisibly."
16311627
(with-current-buffer gnuplot-buffer
16321628
(add-hook 'comint-preoutput-filter-functions
1633-
'gnuplot-discard-output nil t))
1629+
#'gnuplot-discard-output nil t))
16341630
(with-current-buffer (get-buffer-create gnuplot-hidden-output-buffer)
16351631
(erase-buffer))
16361632
(comint-send-string (get-buffer-process gnuplot-buffer) string))
@@ -2214,7 +2210,7 @@ a list:
22142210
(setq-local beginning-of-defun-function #'gnuplot-beginning-of-defun)
22152211
(setq-local end-of-defun-function #'gnuplot-end-of-continuation)
22162212

2217-
(add-hook 'completion-at-point-functions 'gnuplot-completion-at-point nil t)
2213+
(add-hook 'completion-at-point-functions #'gnuplot-completion-at-point nil t)
22182214

22192215
(set-syntax-table gnuplot-mode-syntax-table)
22202216

0 commit comments

Comments
 (0)