Skip to content

Commit a71779e

Browse files
committed
Move functions to private namespace
Keep obsolete public aliases
1 parent 1577b8d commit a71779e

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

gnuplot.el

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ symbol `complete' in `gnuplot-mode' buffers."
309309
:group 'gnuplot
310310
:type 'boolean)
311311

312-
(defun gnuplot-set-display-mode (variable value &rest _args)
312+
(defun gnuplot--set-display-mode (variable value &rest _args)
313313
"Customize :set function for `gnuplot-inline-image-mode'.
314314
Set VARIABLE to VALUE. ARGS is optional args."
315315
(if (and (eq variable 'gnuplot-inline-image-mode)
@@ -341,7 +341,7 @@ and `gnuplot-dedicated-display-mode'."
341341
(const :tag "In Comint buffer" inline)
342342
(const :tag "In dedicated buffer" dedicated))
343343
:initialize #'custom-initialize-default
344-
:set #'gnuplot-set-display-mode)
344+
:set #'gnuplot--set-display-mode)
345345

346346
(defcustom gnuplot-image-format "png"
347347
"Image format to use for displaying images within Emacs.
@@ -355,7 +355,7 @@ non-nil."
355355
:group 'gnuplot
356356
:type 'string
357357
:initialize #'custom-initialize-default
358-
:set #'gnuplot-set-display-mode)
358+
:set #'gnuplot--set-display-mode)
359359

360360
(defgroup gnuplot-faces nil
361361
"Text faces used by `gnuplot-mode'."
@@ -1088,7 +1088,7 @@ the type of text being sent to gnuplot and is typically one of
10881088
nil, `line', `region', `buffer', or `file'. TEXT may be useful for
10891089
functions in `gnuplot-after-plot-hook'. `gnuplot-after-plot-hook' is
10901090
called by this function after all of STRING is sent to gnuplot."
1091-
(gnuplot-make-gnuplot-buffer) ; make sure a gnuplot buffer exists
1091+
(gnuplot--make-gnuplot-buffer) ; make sure a gnuplot buffer exists
10921092
(setq gnuplot-comint-recent-buffer (current-buffer))
10931093

10941094
;; Create a gnuplot frame if needed
@@ -1116,16 +1116,16 @@ called by this function after all of STRING is sent to gnuplot."
11161116
(goto-char (point-max))))
11171117

11181118
(cond ((equal gnuplot-display-process 'window)
1119-
(gnuplot-display-and-recenter-gnuplot-buffer))
1119+
(gnuplot--display-and-recenter-gnuplot-buffer))
11201120
((equal gnuplot-display-process 'frame)
11211121
;;(raise-frame gnuplot-process-frame)
11221122
(with-selected-frame gnuplot-process-frame
1123-
(gnuplot-display-and-recenter-gnuplot-buffer))))
1123+
(gnuplot--display-and-recenter-gnuplot-buffer))))
11241124

11251125
(setq gnuplot-recently-sent text)
11261126
(run-hooks 'gnuplot-after-plot-hook)))
11271127

1128-
(defun gnuplot-display-and-recenter-gnuplot-buffer ()
1128+
(defun gnuplot--display-and-recenter-gnuplot-buffer ()
11291129
"Make sure the gnuplot comint buffer is displayed.
11301130
Move point to the end if necessary."
11311131
(save-selected-window
@@ -1229,7 +1229,7 @@ This sets `gnuplot-recently-sent' to `file'."
12291229
(let ((string (read-file-name "Name of file to send to gnuplot > " nil nil t)))
12301230
(setq string (concat "load '" (expand-file-name string) "'\n"))
12311231
(message "%S" string)
1232-
(gnuplot-make-gnuplot-buffer) ; make sure a gnuplot buffer exists
1232+
(gnuplot--make-gnuplot-buffer) ; make sure a gnuplot buffer exists
12331233
(gnuplot-send-string-to-gnuplot string 'file)))
12341234

12351235
;; suggested by <JS>
@@ -1372,8 +1372,7 @@ buffer."
13721372
(defvar gnuplot-comint-mode-menu nil
13731373
"Menu for `gnuplot-comint-mode'.")
13741374

1375-
;; Switch to the gnuplot program buffer
1376-
(defun gnuplot-make-gnuplot-buffer ()
1375+
(defun gnuplot--make-gnuplot-buffer ()
13771376
"Switch to the gnuplot program buffer or create one if none exists."
13781377
(unless (and gnuplot-process (eq (process-status gnuplot-process) 'run)
13791378
gnuplot-buffer (buffer-live-p gnuplot-buffer))
@@ -1451,7 +1450,7 @@ the gnuplot process buffer. When that variable is non-nil, the
14511450
gnuplot process buffer will be displayed in a window."
14521451
(interactive)
14531452
(unless (and gnuplot-buffer (get-buffer gnuplot-buffer))
1454-
(gnuplot-make-gnuplot-buffer))
1453+
(gnuplot--make-gnuplot-buffer))
14551454
(cond ((equal gnuplot-display-process 'window)
14561455
(switch-to-buffer-other-window gnuplot-buffer))
14571456
((equal gnuplot-display-process 'frame)
@@ -1475,22 +1474,22 @@ gnuplot process buffer will be displayed in a window."
14751474
(defun gnuplot-external-display-mode ()
14761475
"Display image in external."
14771476
(interactive)
1478-
(gnuplot-set-display-mode 'gnuplot-inline-image-mode nil))
1477+
(gnuplot--set-display-mode 'gnuplot-inline-image-mode nil))
14791478

14801479
(defun gnuplot-inline-display-mode ()
14811480
"Display image in inline."
14821481
(interactive)
1483-
(gnuplot-set-display-mode 'gnuplot-inline-image-mode 'inline))
1482+
(gnuplot--set-display-mode 'gnuplot-inline-image-mode 'inline))
14841483

14851484
(defun gnuplot-dedicated-display-mode ()
14861485
"Display image in dedicated."
14871486
(interactive)
1488-
(gnuplot-set-display-mode 'gnuplot-inline-image-mode 'dedicated))
1487+
(gnuplot--set-display-mode 'gnuplot-inline-image-mode 'dedicated))
14891488

14901489
(defun gnuplot-set-image-format (format)
14911490
"Display image in FORMAT."
14921491
(interactive "sGnuplot image format: ")
1493-
(gnuplot-set-display-mode 'gnuplot-image-format format)
1492+
(gnuplot--set-display-mode 'gnuplot-image-format format)
14941493
(unless gnuplot-inline-image-mode
14951494
(message "Setting will take effect when plots are displayed in Emacs")))
14961495

@@ -1503,14 +1502,14 @@ gnuplot process buffer will be displayed in a window."
15031502
(progn
15041503
(gnuplot-send-hiding-output
15051504
(format "set terminal %s\n" gnuplot-image-format))
1506-
(gnuplot-inline-image-set-output)
1505+
(gnuplot--inline-image-set-output)
15071506
(add-hook 'comint-output-filter-functions
15081507
#'gnuplot--insert-inline-image-output nil t))
15091508
(gnuplot-send-hiding-output "set terminal pop\n")
15101509
(remove-hook 'comint-output-filter-functions
15111510
#'gnuplot--insert-inline-image-output t)))))
15121511

1513-
(defun gnuplot-inline-image-set-output ()
1512+
(defun gnuplot--inline-image-set-output ()
15141513
"Set Gnuplot's output file to `gnuplot-inline-image-filename'."
15151514
(let ((tmp (make-temp-file "gnuplot")))
15161515
(setq gnuplot-inline-image-filename tmp)
@@ -1546,7 +1545,7 @@ updates Gnuplot with the appropriate \"set output\" command."
15461545
(beginning-of-line)
15471546
(insert-image image)
15481547
(insert "\n")
1549-
(gnuplot-inline-image-set-output))))
1548+
(gnuplot--inline-image-set-output))))
15501549
(dedicated
15511550
(with-current-buffer
15521551
(get-buffer-create gnuplot-image-buffer-name)
@@ -1555,7 +1554,7 @@ updates Gnuplot with the appropriate \"set output\" command."
15551554
(insert-file-contents filename)
15561555
(ignore-errors (normal-mode))
15571556
(display-buffer (current-buffer))
1558-
(gnuplot-inline-image-set-output))))))))))))
1557+
(gnuplot--inline-image-set-output))))))))))))
15591558

15601559
;;; Send commands to GNUPLOT silently & without generating an extra prompt
15611560
(defvar gnuplot-hidden-output-buffer " *gnuplot output*")
@@ -2068,7 +2067,7 @@ following in your .emacs file:
20682067
(defun run-gnuplot ()
20692068
"Run an inferior Gnuplot process."
20702069
(interactive)
2071-
(gnuplot-make-gnuplot-buffer)
2070+
(gnuplot--make-gnuplot-buffer)
20722071
(pop-to-buffer gnuplot-buffer))
20732072

20742073
;;;###autoload
@@ -2080,17 +2079,21 @@ following in your .emacs file:
20802079
(define-obsolete-function-alias 'gnuplot-close-down #'gnuplot--close-down "0.8.1")
20812080
(define-obsolete-function-alias 'gnuplot-continuation-line-p #'gnuplot--continuation-line-p "0.8.1")
20822081
(define-obsolete-function-alias 'gnuplot-discard-output #'gnuplot--discard-output "0.8.1")
2082+
(define-obsolete-function-alias 'gnuplot-display-and-recenter-gnuplot-buffer #'gnuplot--display-and-recenter-gnuplot-buffer "0.8.1")
20832083
(define-obsolete-function-alias 'gnuplot-end-of-command #'gnuplot--end-of-command "0.8.1")
20842084
(define-obsolete-function-alias 'gnuplot-end-of-continuation #'gnuplot--end-of-continuation "0.8.1")
20852085
(define-obsolete-function-alias 'gnuplot-in-comment #'gnuplot--in-comment "0.8.1")
20862086
(define-obsolete-function-alias 'gnuplot-in-string #'gnuplot--in-string "0.8.1")
20872087
(define-obsolete-function-alias 'gnuplot-in-string-or-comment #'gnuplot--in-string-or-comment "0.8.1")
2088+
(define-obsolete-function-alias 'gnuplot-inline-image-set-output #'gnuplot--inline-image-set-output "0.8.1")
20882089
(define-obsolete-function-alias 'gnuplot-insert-inline-image-output #'gnuplot--insert-inline-image-output "0.8.1")
2090+
(define-obsolete-function-alias 'gnuplot-make-gnuplot-buffer #'gnuplot--make-gnuplot-buffer "0.8.1")
20892091
(define-obsolete-function-alias 'gnuplot-point-at-beginning-of-command #'gnuplot--point-at-beginning-of-command "0.8.1")
20902092
(define-obsolete-function-alias 'gnuplot-point-at-beginning-of-continuation #'gnuplot--point-at-beginning-of-continuation "0.8.1")
20912093
(define-obsolete-function-alias 'gnuplot-point-at-end-of-command #'gnuplot--point-at-end-of-command "0.8.1")
20922094
(define-obsolete-function-alias 'gnuplot-point-at-end-of-continuation #'gnuplot--point-at-end-of-continuation "0.8.1")
20932095
(define-obsolete-function-alias 'gnuplot-protect-prompt-fn #'gnuplot--protect-prompt-fn "0.8.1")
2096+
(define-obsolete-function-alias 'gnuplot-set-display-mode #'gnuplot--set-display-mode "0.8.1")
20942097
(define-obsolete-function-alias 'gnuplot-set-keywords-list #'gnuplot--set-keywords-list "0.8.1")
20952098
(define-obsolete-function-alias 'gnuplot-setup-comint-for-image-mode #'gnuplot--setup-comint-for-image-mode "0.8.1")
20962099
(define-obsolete-function-alias 'gnuplot-split-string #'gnuplot--split-string "0.8.1")

0 commit comments

Comments
 (0)