[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gnuplot 07a8027 183/184: Do not add lines to kill-ring whe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gnuplot 07a8027 183/184: Do not add lines to kill-ring when trimming the gnuplot buffer (#72) |
Date: |
Sun, 29 Aug 2021 11:03:41 -0400 (EDT) |
branch: elpa/gnuplot
commit 07a80272b86c081b40602ec0b080571f3269749d
Author: Maxime Tréca <16440823+mtreca@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Do not add lines to kill-ring when trimming the gnuplot buffer (#72)
I noticed that when the number of lines in the gnuplot comint buffer
exceeds the maximum amount of lines, the extra lines are killed using
kill-line, which causes the kill-ring to be polluted with those lines.
This commit replaces kill-ring by delete-region, which does not have
this side effect. The while loop also has been replaced by dotimes for
clarity.
---
gnuplot.el | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/gnuplot.el b/gnuplot.el
index 5345b26..b74a91b 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -1357,13 +1357,12 @@ This keeps that buffer from growing excessively in
size. Normally,
this function is attached to `gnuplot-after-plot-hook'"
(if (> gnuplot-buffer-max-size 0)
(with-current-buffer gnuplot-buffer
- (let ((nlines (count-lines (point-min) (point-max)))
- (kill-whole-line t))
- (while (> nlines gnuplot-buffer-max-size)
+ (let (gnuplot-lines (count-lines (point-min) (point-max)))
+ (dotimes (tmp (- gnuplot-lines gnuplot-buffer-max-size))
(goto-char (point-min))
- (kill-line)
- (setq nlines (1- nlines)))
+ (delete-region (line-beginning-position) (1+ (line-end-position))))
(goto-char (point-max))))))
+
(add-hook 'gnuplot-after-plot-hook 'gnuplot-trim-gnuplot-buffer nil nil)
- [nongnu] elpa/gnuplot 706e810 161/184: Merge pull request #54 from vxid/delete-xemacs, (continued)
- [nongnu] elpa/gnuplot 706e810 161/184: Merge pull request #54 from vxid/delete-xemacs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot c1e6018 158/184: Add GitHub Actions CI configure files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 8d5b7f5 157/184: Merge pull request #51 from vxid/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 1dd661e 180/184: Fix testing in Github CI. Simplify compilation and testing process., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 2c1e7cb 177/184: Rewrite README.org, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot fbb15b6 168/184: Merge pull request #60 from conao3/fix-ci, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 24dd2d0 170/184: Merge pull request #64 from mtreca/info-update, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 1f8f051 166/184: use actions/setup-python@v2 instead of v1.1.1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 90bfd6d 179/184: Simplify Makefile situation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot f0001c3 163/184: Merge pull request #55 from emacsorphanage/revert-54-delete-xemacs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 07a8027 183/184: Do not add lines to kill-ring when trimming the gnuplot buffer (#72),
ELPA Syncer <=
- [nongnu] elpa/gnuplot 7138b13 184/184: Fixup parens in gnuplot-trim-gnuplot-buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 10f0d54 004/184: updated README.org, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot b51d4a9 001/184: initial commit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot b0beecd 008/184: Improved gnuplot-send-string-to-gnuplot, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 00dadc3 011/184: Restored the check for XEmacs before calling make-local-hook, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 0beb68b 009/184: Corrected a couple typos in contact info, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 316d7df 006/184: Again README.org, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 10cf107 021/184: Fixed some more XEmacs compatibility that I broke, ho hum!, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 958db84 018/184: Use `add-hook' instead of `make-local-variable' in `gnuplot-comint-mode', ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot db98e06 012/184: Changed set up of info-look documentation and completion, ELPA Syncer, 2021/08/29