summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-graph.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2021-09-11 17:13:14 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2021-09-11 17:17:34 +0200
commitd5c6f701a64413667fb573e12e05b89f8704c3f7 (patch)
tree91d0db3521e1b8798122e17809c9fd6ab12a274b /lisp/calc/calc-graph.el
parent09ae3f9f653ff3b98195a81eef6d4748d2817043 (diff)
downloademacs-d5c6f701a64413667fb573e12e05b89f8704c3f7.tar.gz
emacs-d5c6f701a64413667fb573e12e05b89f8704c3f7.tar.bz2
emacs-d5c6f701a64413667fb573e12e05b89f8704c3f7.zip
Fix byte-compilation warnings
* lisp/calc/calc-graph.el (calc-gnuplot-check-for-errors): * lisp/calendar/holidays.el (list-holidays): Dodge 'save-excursion+set-buffer' warnings that appeared after the progn flattening was introduced.
Diffstat (limited to 'lisp/calc/calc-graph.el')
-rw-r--r--lisp/calc/calc-graph.el14
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el
index 9dfdba39308..7891e35c40f 100644
--- a/lisp/calc/calc-graph.el
+++ b/lisp/calc/calc-graph.el
@@ -1403,14 +1403,12 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
(or calc-graph-no-auto-view (sit-for 0))))
(defun calc-gnuplot-check-for-errors ()
- (if (save-excursion
- (prog2
- (progn
- (set-buffer calc-gnuplot-buffer)
- (goto-char calc-gnuplot-last-error-pos))
- (re-search-forward "^[ \t]+\\^$" nil t)
- (goto-char (point-max))
- (setq calc-gnuplot-last-error-pos (point-max))))
+ (if (with-current-buffer calc-gnuplot-buffer
+ (goto-char calc-gnuplot-last-error-pos)
+ (prog1
+ (re-search-forward "^[ \t]+\\^$" nil t)
+ (goto-char (point-max))
+ (setq calc-gnuplot-last-error-pos (point-max))))
(calc-graph-view-trail)))
(defun calc-gnuplot-command (&rest args)