Skip to content

Commit ce57dda

Browse files
committed
Move more variables to private namespace
1 parent 8b864eb commit ce57dda

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

gnuplot.el

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ non-nil."
341341

342342
(defvar gnuplot-mode-menu nil)
343343

344-
(defvar gnuplot-display-options-menu
344+
(defvar gnuplot--display-options-menu
345345
(cl-flet ((make-image-setter (type)
346346
`[,(concat (upcase type) " images")
347347
(lambda () (interactive) (gnuplot-set-image-format ,type))
@@ -362,7 +362,7 @@ non-nil."
362362
,@(mapcar #'make-image-setter (list "png" "jpeg" "svg"))
363363
["Other image type..." gnuplot-set-image-format])))
364364

365-
(defvar gnuplot-menu
365+
(defvar gnuplot--menu
366366
`("Gnuplot"
367367
["Send line to gnuplot" gnuplot-send-line-to-gnuplot t]
368368
["Send line & move forward" gnuplot-send-line-and-forward (not (eobp))]
@@ -371,7 +371,7 @@ non-nil."
371371
["Send buffer to gnuplot" gnuplot-send-buffer-to-gnuplot t]
372372
["Send file to gnuplot" gnuplot-send-file-to-gnuplot t]
373373
"---"
374-
,gnuplot-display-options-menu
374+
,gnuplot--display-options-menu
375375
["Contextual completion and help" gnuplot-context-sensitive-mode
376376
:style toggle
377377
:selected gnuplot-context-sensitive-mode]
@@ -400,8 +400,8 @@ non-nil."
400400

401401
;;; --- insertions variables and menus
402402

403-
(defvar gnuplot-mode-insertions-menu nil)
404-
(defvar gnuplot-insertions-menu nil
403+
(defvar gnuplot--mode-insertions-menu nil)
404+
(defvar gnuplot--insertions-menu nil
405405
"Menu for insertions in `gnuplot-mode'.
406406
407407
The insertions menu is composed of several sub-menus. The variables
@@ -444,7 +444,7 @@ adding the \"regis\" terminal type to the terminal sub-menu:
444444

445445
(defvar gnuplot-insertions-top ()
446446
"Top part of insertions menu.
447-
See the document string for `gnuplot-insertions-menu'")
447+
See the document string for `gnuplot--insertions-menu'")
448448

449449
(defcustom gnuplot-insertions-menu-flag t
450450
"Non-nil means to place the insertion menu in the menubar.
@@ -475,7 +475,7 @@ create a `gnuplot-mode' buffer."
475475
["zeroaxis" (gnuplot-insert "set zeroaxis") t])
476476

477477
"Adornments submenu in the insertions menu.
478-
See the document string for `gnuplot-insertions-menu'
478+
See the document string for `gnuplot--insertions-menu'
479479
Changing this will not effect a change in any currently existing
480480
`gnuplot-mode' buffer. You will see the change the next time you
481481
create a `gnuplot-mode' buffer."
@@ -501,7 +501,7 @@ create a `gnuplot-mode' buffer."
501501
["output" (gnuplot-insert "set output ") t]
502502
["zero" (gnuplot-insert "set zero ") t])
503503
"Plot options submenu in the insertions menu.
504-
See the document string for `gnuplot-insertions-menu'
504+
See the document string for `gnuplot--insertions-menu'
505505
Changing this will not effect a change in any currently existing
506506
`gnuplot-mode' buffer. You will see the change the next time you
507507
create a `gnuplot-mode' buffer."
@@ -531,7 +531,7 @@ create a `gnuplot-mode' buffer."
531531
["vttek" (gnuplot-insert "set terminal vttek") t]
532532
["x11" (gnuplot-insert "set terminal x11") t])
533533
"Terminal submenu in the insertions menu.
534-
See the document string for `gnuplot-insertions-menu'
534+
See the document string for `gnuplot--insertions-menu'
535535
Changing this will not effect a change in any currently existing
536536
`gnuplot-mode' buffer. You will see the change the next time you
537537
create a `gnuplot-mode' buffer."
@@ -553,7 +553,7 @@ create a `gnuplot-mode' buffer."
553553
["xdtics" (gnuplot-insert "set xdtics ") t]
554554
["xmtics" (gnuplot-insert "set xmtics ") t])
555555
"X-axis submenu in the insertions menu.
556-
See the document string for `gnuplot-insertions-menu'
556+
See the document string for `gnuplot--insertions-menu'
557557
Changing this will not effect a change in any currently existing
558558
`gnuplot-mode' buffer. You will see the change the next time you
559559
create a `gnuplot-mode' buffer."
@@ -575,7 +575,7 @@ create a `gnuplot-mode' buffer."
575575
["x2dtics" (gnuplot-insert "set xdtics ") t]
576576
["x2mtics" (gnuplot-insert "set xmtics ") t])
577577
"X2-axis submenu in the insertions menu.
578-
See the document string for `gnuplot-insertions-menu'
578+
See the document string for `gnuplot--insertions-menu'
579579
Changing this will not effect a change in any currently existing
580580
`gnuplot-mode' buffer. You will see the change the next time you
581581
create a `gnuplot-mode' buffer."
@@ -597,7 +597,7 @@ create a `gnuplot-mode' buffer."
597597
["ydtics" (gnuplot-insert "set ydtics ") t]
598598
["mytics" (gnuplot-insert "set mytics ") t])
599599
"Y-axis submenu in the insertions menu.
600-
See the document string for `gnuplot-insertions-menu'
600+
See the document string for `gnuplot--insertions-menu'
601601
Changing this will not effect a change in any currently existing
602602
`gnuplot-mode' buffer. You will see the change the next time you
603603
create a `gnuplot-mode' buffer."
@@ -619,7 +619,7 @@ create a `gnuplot-mode' buffer."
619619
["y2mtics" (gnuplot-insert "set ymtics ") t]
620620
["y2dtics" (gnuplot-insert "set ydtics ") t])
621621
"Y2-axis submenu in the insertions menu.
622-
See the document string for `gnuplot-insertions-menu'
622+
See the document string for `gnuplot--insertions-menu'
623623
Changing this will not effect a change in any currently existing
624624
`gnuplot-mode' buffer. You will see the change the next time you
625625
create a `gnuplot-mode' buffer."
@@ -640,7 +640,7 @@ create a `gnuplot-mode' buffer."
640640
["zdtics" (gnuplot-insert "set zdtics ") t]
641641
["zmtics" (gnuplot-insert "set zmtics ") t])
642642
"Z-axis submenu in the insertions menu.
643-
See the document string for `gnuplot-insertions-menu'
643+
See the document string for `gnuplot--insertions-menu'
644644
Changing this will not effect a change in any currently existing
645645
`gnuplot-mode' buffer. You will see the change the next time you
646646
create a `gnuplot-mode' buffer."
@@ -660,7 +660,7 @@ create a `gnuplot-mode' buffer."
660660
["urange" (gnuplot-insert "set urange [:]") t]
661661
["vrange" (gnuplot-insert "set vrange [:]") t])
662662
"Parametric plots submenu in the insertions menu.
663-
See the document string for `gnuplot-insertions-menu'
663+
See the document string for `gnuplot--insertions-menu'
664664
Changing this will not effect a change in any currently existing
665665
`gnuplot-mode' buffer. You will see the change the next time you
666666
create a `gnuplot-mode' buffer."
@@ -677,7 +677,7 @@ create a `gnuplot-mode' buffer."
677677
["angles" (gnuplot-insert "set angles ") t]
678678
["rrange" (gnuplot-insert "set rrange [:]") t])
679679
"Polar plots submenu in the insertions menu.
680-
See the document string for `gnuplot-insertions-menu'
680+
See the document string for `gnuplot--insertions-menu'
681681
Changing this will not effect a change in any currently existing
682682
`gnuplot-mode' buffer. You will see the change the next time you
683683
create a `gnuplot-mode' buffer."
@@ -699,7 +699,7 @@ create a `gnuplot-mode' buffer."
699699
["surface" (gnuplot-insert "set surface ") t]
700700
["view" (gnuplot-insert "set view ") t])
701701
"Surface plots submenu in the insertions menu.
702-
See the document string for `gnuplot-insertions-menu'
702+
See the document string for `gnuplot--insertions-menu'
703703
Changing this will not effect a change in any currently existing
704704
`gnuplot-mode' buffer. You will see the change the next time you
705705
create a `gnuplot-mode' buffer."
@@ -726,7 +726,7 @@ opening an argument-setting popup.")
726726
(when gnuplot-insertions-menu-flag
727727
(setq gnuplot-insertions-top
728728
'("insert set expression" "---"))
729-
(setq gnuplot-insertions-menu
729+
(setq gnuplot--insertions-menu
730730
(append (list "Insertions")
731731
gnuplot-insertions-top
732732
(list gnuplot-insertions-adornments)
@@ -741,12 +741,12 @@ opening an argument-setting popup.")
741741
(list gnuplot-insertions-polar-plots)
742742
(list gnuplot-insertions-surface-plots)
743743
gnuplot-insertions-bottom))
744-
(easy-menu-define gnuplot-mode-insertions-menu gnuplot-mode-map
744+
(easy-menu-define gnuplot--mode-insertions-menu gnuplot-mode-map
745745
"Insertions menu used in Gnuplot-mode"
746-
gnuplot-insertions-menu))
746+
gnuplot--insertions-menu))
747747
(easy-menu-define ; set up gnuplot menu
748748
gnuplot-mode-menu gnuplot-mode-map "Menu used in gnuplot-mode"
749-
gnuplot-menu))
749+
gnuplot--menu))
750750

751751
(defun gnuplot--mark-active ()
752752
"Return non-nil if the mark is active and it is not equal to point."
@@ -795,7 +795,7 @@ characters.")
795795
`(regexp-opt ,list 'words))
796796

797797
;; Lists of gnuplot keywords for syntax coloring etc.
798-
(defvar gnuplot-keywords-builtin-functions
798+
(defvar gnuplot--keywords-builtin-functions
799799
'("abs" "acosh" "acos" "arg" "asinh" "asin" "atan" "atanh" "atan2" "besj1"
800800
"besj0" "besy1" "besy0" "ceil" "column" "cosh" "cos" "erfc" "erf" "exp"
801801
"floor" "gamma" "ibeta" "igamma" "imag" "int" "inverf" "invnorm" "lgamma"
@@ -809,7 +809,7 @@ characters.")
809809
810810
These are highlighted using `font-lock-function-name-face'.")
811811

812-
(defvar gnuplot-keywords-plotting
812+
(defvar gnuplot--keywords-plotting
813813
'("axes" "every" "index" "lw" "lt" "ls" "linestyle" "linetype" "linewidth"
814814
"notitle" "pt" "ps" "pointsize" "pointtype" "smooth" "thru" "title" "using"
815815
"with" "noautoscale" "volatile" "matrix" "nonuniform" "binary" "fillstyle"
@@ -818,9 +818,9 @@ These are highlighted using `font-lock-function-name-face'.")
818818
819819
These are highlighted using `font-lock-type-face'.
820820
This list does not include plotting styles -- for that, see
821-
`gnuplot-keywords-plotting-styles'")
821+
`gnuplot--keywords-plotting-styles'")
822822

823-
(defvar gnuplot-keywords-plotting-styles
823+
(defvar gnuplot--keywords-plotting-styles
824824
'("boxerrorbars" "boxes" "boxxyerrorbars" "candlesticks" "dots" "errorbars"
825825
"financebars" "fsteps" "histeps" "impulses" "lines" "linespoints" "points"
826826
"steps" "vector" "xerrorbars" "xyerrorbars" "yerrorbars" "vectors"
@@ -831,7 +831,7 @@ This list does not include plotting styles -- for that, see
831831
832832
These are highlighted using `font-lock-function-name-face'.")
833833

834-
(defvar gnuplot-keywords-misc
834+
(defvar gnuplot--keywords-misc
835835
'("bind" "cd" "clear" "exit" "fit" "help" "history" "load" "pause" "print"
836836
"pwd" "quit" "replot" "save" "set" "show" "unset" "if" "else" "do" "update"
837837
"undefine" "test" "system" "raise" "lower" "eval" "shell" "reset" "reread"
@@ -840,7 +840,7 @@ These are highlighted using `font-lock-function-name-face'.")
840840
841841
These are highlighted using `font-lock-constant-face'.")
842842

843-
(defvar gnuplot-keywords-negatable-options
843+
(defvar gnuplot--keywords-negatable-options
844844
'("arrow" "autoscale" "border" "clabel" "clip" "contour" "dgrid3d" "grid"
845845
"hidden3d" "historysize" "key" "label" "linestyle" "logscale" "mouse"
846846
"multiplot" "mx2tics" "mxtics" "my2tics" "mytics" "mztics" "offsets" "polar"
@@ -852,7 +852,7 @@ These are highlighted using `font-lock-constant-face'.")
852852
"List of gnuplot options which can be negated using `gnuplot-negate-option'.")
853853

854854
(defvar gnuplot-negatable-options-regexp
855-
(gnuplot--make-regexp gnuplot-keywords-negatable-options))
855+
(gnuplot--make-regexp gnuplot--keywords-negatable-options))
856856

857857
;; Set up colorization for gnuplot.
858858
(defvar gnuplot-font-lock-keywords
@@ -864,13 +864,13 @@ These are highlighted using `font-lock-constant-face'.")
864864
(1 'font-lock-variable-name-face))
865865

866866
;; built-in function names
867-
(,(gnuplot--make-regexp gnuplot-keywords-builtin-functions)
867+
(,(gnuplot--make-regexp gnuplot--keywords-builtin-functions)
868868
(0 'font-lock-function-name-face))
869869

870870
;; reserved words associated with plotting
871-
(,(gnuplot--make-regexp gnuplot-keywords-plotting)
871+
(,(gnuplot--make-regexp gnuplot--keywords-plotting)
872872
(0 'font-lock-type-face))
873-
(,(gnuplot--make-regexp gnuplot-keywords-plotting-styles)
873+
(,(gnuplot--make-regexp gnuplot--keywords-plotting-styles)
874874
(0 'font-lock-function-name-face))
875875

876876
;; (s)plot -- also thing (s)plotted
@@ -879,7 +879,7 @@ These are highlighted using `font-lock-constant-face'.")
879879
;; (1 'font-lock-variable-name-face))
880880

881881
;; other common commands
882-
(,(gnuplot--make-regexp gnuplot-keywords-misc)
882+
(,(gnuplot--make-regexp gnuplot--keywords-misc)
883883
(0 'font-lock-constant-face))
884884
("!.*$" (0 'font-lock-constant-face))))
885885

@@ -1209,14 +1209,14 @@ this function is attached to `gnuplot-after-plot-hook'"
12091209
;;; --- functions controlling the gnuplot process
12101210

12111211
;; Menu for the comint-mode buffer
1212-
(defvar gnuplot-comint-menu
1212+
(defvar gnuplot--comint-menu
12131213
`("Gnuplot"
12141214
["Plot most recent gnuplot buffer" gnuplot-plot-from-comint
12151215
(buffer-live-p gnuplot--comint-recent-buffer)]
12161216
["Save and plot most recent gnuplot buffer" gnuplot-save-and-plot-from-comint
12171217
(buffer-live-p gnuplot--comint-recent-buffer)]
12181218
"---"
1219-
,gnuplot-display-options-menu
1219+
,gnuplot--display-options-menu
12201220
["Contextual completion and help" gnuplot-context-sensitive-mode
12211221
:style toggle
12221222
:selected gnuplot-context-sensitive-mode]
@@ -1268,7 +1268,7 @@ buffer."
12681268
;; Set up menu (see below)
12691269
(easy-menu-define
12701270
gnuplot-comint-mode-menu gnuplot-comint-mode-map "Menu used in gnuplot-comint-mode"
1271-
gnuplot-comint-menu))
1271+
gnuplot--comint-menu))
12721272

12731273
;; Key bindings for gnuplot-comint-mode
12741274
(define-key gnuplot-comint-mode-map "\M-\C-p" #'gnuplot-plot-from-comint)
@@ -1299,7 +1299,7 @@ buffer."
12991299
(sleep-for (* 10 gnuplot-delay))
13001300
(gnuplot--setup-comint-for-image-mode)))))
13011301

1302-
(defvar gnuplot-prompt-regexp
1302+
(defvar gnuplot--prompt-regexp
13031303
(regexp-opt '("gnuplot> " "multiplot> "))
13041304
"Regexp for recognizing the GNUPLOT prompt.")
13051305

@@ -1310,7 +1310,7 @@ STRING is the text as originally inserted in the comint buffer."
13101310
(goto-char (point-max))
13111311
(beginning-of-line)
13121312
(let ((b (point)) e)
1313-
(when (re-search-forward gnuplot-prompt-regexp (point-max) t)
1313+
(when (re-search-forward gnuplot--prompt-regexp (point-max) t)
13141314
(setq e (point))
13151315
(put-text-property b e 'rear-nonsticky '(read-only intangible face))
13161316
(put-text-property b e 'intangible t)
@@ -1368,7 +1368,7 @@ gnuplot process buffer will be displayed in a window."
13681368

13691369
;;; Support for displaying plotted images within Emacs
13701370

1371-
(defvar gnuplot-inline-image-filename nil
1371+
(defvar gnuplot--inline-image-filename nil
13721372
"Name of the current Gnuplot output file.")
13731373

13741374
(defvar gnuplot-image-buffer-name "*gnuplot output*")
@@ -1411,9 +1411,9 @@ gnuplot process buffer will be displayed in a window."
14111411
#'gnuplot--insert-inline-image-output t)))))
14121412

14131413
(defun gnuplot--inline-image-set-output ()
1414-
"Set Gnuplot's output file to `gnuplot-inline-image-filename'."
1414+
"Set Gnuplot's output file to `gnuplot--inline-image-filename'."
14151415
(let ((tmp (make-temp-file "gnuplot")))
1416-
(setq gnuplot-inline-image-filename tmp)
1416+
(setq gnuplot--inline-image-filename tmp)
14171417
(gnuplot-send-hiding-output (format "set output '%s'\n" tmp))))
14181418

14191419
(defvar gnuplot--inhibit-filter nil)
@@ -1423,17 +1423,17 @@ gnuplot process buffer will be displayed in a window."
14231423
14241424
Called via `comint-preoutput-filter-functions' hook when
14251425
`gnuplot-inline-image-mode' is enabled. Checks the status of the
1426-
file `gnuplot-inline-image-filename'; if it exists and has
1426+
file `gnuplot--inline-image-filename'; if it exists and has
14271427
nonzero size, inserts it as an inline image, stores a new
1428-
temporary filename in `gnuplot-inline-image-filename', and
1428+
temporary filename in `gnuplot--inline-image-filename', and
14291429
updates Gnuplot with the appropriate \"set output\" command."
14301430
(unless gnuplot--inhibit-filter ; Prevent recursively entering this filter
14311431
(let ((gnuplot--inhibit-filter t)) ; (causing an infinite loop)
14321432
(save-excursion
14331433
(goto-char (point-max))
14341434
(beginning-of-line)
1435-
(when (looking-at gnuplot-prompt-regexp)
1436-
(let* ((filename gnuplot-inline-image-filename)
1435+
(when (looking-at gnuplot--prompt-regexp)
1436+
(let* ((filename gnuplot--inline-image-filename)
14371437
(size (nth 7 (file-attributes filename))))
14381438
(when (and size (> size 0))
14391439
(gnuplot-send-hiding-output "set output\n") ; Flush output file
@@ -1458,7 +1458,7 @@ updates Gnuplot with the appropriate \"set output\" command."
14581458
(gnuplot--inline-image-set-output))))))))))))
14591459

14601460
;;; Send commands to GNUPLOT silently & without generating an extra prompt
1461-
(defvar gnuplot-hidden-output-buffer " *gnuplot output*")
1461+
(defvar gnuplot-hidden-output-buffer " *gnuplot hidden*")
14621462

14631463
(defun gnuplot-send-hiding-output (string)
14641464
"Send STRING to the running Gnuplot process invisibly."
@@ -1476,7 +1476,7 @@ then removes itself from `comint-preoutput-filter-functions'."
14761476
(with-current-buffer
14771477
(get-buffer-create gnuplot-hidden-output-buffer)
14781478
(insert string)
1479-
(when (looking-back gnuplot-prompt-regexp (point-min))
1479+
(when (looking-back gnuplot--prompt-regexp (point-min))
14801480
(with-current-buffer gnuplot-buffer
14811481
(remove-hook 'comint-preoutput-filter-functions
14821482
#'gnuplot--discard-output t))))
@@ -1668,7 +1668,7 @@ ARG is optional arg."
16681668
"Append \"no\" to or remove \"no\" from the set option on the current line.
16691669
This checks if the set option is one which has a negated form.
16701670
1671-
Negatable options are defined in `gnuplot-keywords-negatable-options'."
1671+
Negatable options are defined in `gnuplot--keywords-negatable-options'."
16721672
(interactive nil gnuplot-mode gnuplot-comint-mode)
16731673
(let ((begin (gnuplot--point-at-beginning-of-command))
16741674
(end (gnuplot--point-at-end-of-command))
@@ -1853,11 +1853,11 @@ Report bugs at https://github.com/emacs-gnuplot/gnuplot/issues
18531853
------O------
18541854
18551855
Gnuplot-mode includes two different systems for keyword completion and
1856-
documentation lookup: a newer one, `gnuplot-context-sensitive-mode'
1857-
(enabled by default), and a older one which extracts keywords from
1858-
gnuplot's Info file. Both systems allow looking up documentation in the
1859-
Info file. With the context-sensitive mode active, `gnuplot-mode' can
1860-
also provide Eldoc syntax hints as you type.
1856+
documentation lookup: a newer one, `gnuplot-context-sensitive-mode' ,
1857+
which is enabled by default, and a older one which extracts keywords
1858+
from gnuplot's Info file. Both systems allow looking up documentation
1859+
in the Info file. With the context-sensitive mode active,
1860+
`gnuplot-mode' can also provide Eldoc syntax hints as you type.
18611861
18621862
------O------
18631863

0 commit comments

Comments
 (0)