Function: gnuplot-context-sensitive-mode
gnuplot-context-sensitive-mode is an autoloaded, interactive and
natively compiled function defined in gnuplot-context.el.
Signature
(gnuplot-context-sensitive-mode &optional ARG)
Documentation
Use context-sensitive completion and help in gnuplot-mode.
When context-sensitive mode is enabled, gnuplot-mode tries to
provide more useful completions and help suggestions for built-in
keywords and functions by parsing each command as you type. It
attempts to take into account Gnuplot's many abbreviated
keywords. For example, with point at the end of a line reading
"plot \\='datafile\\=' w ", typing M-x completion-at-point (completion-at-point) will pop
up a list of plotting styles.
Key bindings:
M-x completion-at-point (completion-at-point) will complete the keyword at point based
on its context in the command. To make keyword completion work on
pressing TAB, set tab-always-indent to complete.
M-x gnuplot-context-info-at-point (gnuplot-context-info-at-point) will try to find the most relevant
Gnuplot info node for the construction at point, prompting for a
node name if nothing is found.
M-x gnuplot-context-help-at-point (gnuplot-context-help-at-point) will pop up a brief summary of the
syntax at point in the minibuffer. To have one-line syntax
summaries appear in the echo area as you type, toggle
eldoc-mode(var)/eldoc-mode(fun).
To choose whether to use this mode by default in Gnuplot buffers,
customize the variable
gnuplot-use-context-sensitive-completion.
This is a minor mode. If called interactively, toggle the
Gnuplot-Context-Sensitive mode mode. If the prefix argument is
positive, enable the mode, and if it is zero or negative, disable the
mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate the variable gnuplot-context-sensitive-mode(var)/gnuplot-context-sensitive-mode(fun).
The mode's hook is called both when the mode is enabled and when it is disabled.
Key Bindings
This command is not in any keymaps.
Source Code
;; Defined in /nix/store/xvcy7r1jiw71avhnh6kmin403kpqrdhc-emacs-packages-deps/share/emacs/site-lisp/elpa/gnuplot-20260623.1111/gnuplot-context.el
(define-minor-mode gnuplot-context-sensitive-mode
"Use context-sensitive completion and help in `gnuplot-mode'.
When context-sensitive mode is enabled, `gnuplot-mode' tries to
provide more useful completions and help suggestions for built-in
keywords and functions by parsing each command as you type. It
attempts to take into account Gnuplot's many abbreviated
keywords. For example, with point at the end of a line reading
\"plot \\='datafile\\=' w \", typing \\[completion-at-point] will pop
up a list of plotting styles.
Key bindings:
\\[completion-at-point] will complete the keyword at point based
on its context in the command. To make keyword completion work on
pressing TAB, set `tab-always-indent' to `complete'.
\\[gnuplot-context-info-at-point] will try to find the most relevant
Gnuplot info node for the construction at point, prompting for a
node name if nothing is found.
\\[gnuplot-context-help-at-point] will pop up a brief summary of the
syntax at point in the minibuffer. To have one-line syntax
summaries appear in the echo area as you type, toggle
`eldoc-mode'.
To choose whether to use this mode by default in Gnuplot buffers,
customize the variable
`gnuplot-use-context-sensitive-completion'."
:interactive (gnuplot-mode gnuplot-comint-mode)
:keymap
`((,(kbd "C-c C-/") . gnuplot-context-help-at-point)
(,(kbd "C-c C-d") . gnuplot-context-info-at-point))
(unless (derived-mode-p 'gnuplot-mode 'gnuplot-comint-mode)
(message "Gnuplot context-sensitive mode works only in Gnuplot-mode buffers")
(setq gnuplot-context-sensitive-mode nil))
(if gnuplot-context-sensitive-mode
(progn
(remove-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look t)
(add-hook 'completion-at-point-functions #'gnuplot-context-completion-at-point nil t)
(add-hook 'eldoc-documentation-functions #'gnuplot-context-eldoc-function nil 'local))
(add-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look nil t)
(remove-hook 'completion-at-point-functions #'gnuplot-context-completion-at-point t)
(remove-hook 'eldoc-documentation-functions #'gnuplot-context-eldoc-function t)))