Function: gnuplot-trim-comint-buffer
gnuplot-trim-comint-buffer is a natively compiled function defined in
gnuplot.el.
Signature
(gnuplot-trim-comint-buffer)
Documentation
Trim lines from the beginning of the *gnuplot* buffer.
This keeps that buffer from growing excessively in size. Normally,
this function is attached to gnuplot-after-plot-hook
Source Code
;; Defined in /nix/store/xvcy7r1jiw71avhnh6kmin403kpqrdhc-emacs-packages-deps/share/emacs/site-lisp/elpa/gnuplot-20260623.1111/gnuplot.el
(defun gnuplot-trim-comint-buffer ()
"Trim lines from the beginning of the *gnuplot* buffer.
This keeps that buffer from growing excessively in size. Normally,
this function is attached to `gnuplot-after-plot-hook'"
(when (> gnuplot-buffer-max-size 0)
(with-current-buffer gnuplot-buffer
(let ((gnuplot-lines (count-lines (point-min) (point-max))))
(dotimes (_n (- gnuplot-lines gnuplot-buffer-max-size))
(goto-char (point-min))
(delete-region (line-beginning-position) (1+ (line-end-position))))
(goto-char (point-max))))))