From d5c6f701a64413667fb573e12e05b89f8704c3f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sat, 11 Sep 2021 17:13:14 +0200 Subject: [PATCH] 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. --- lisp/calc/calc-graph.el | 14 ++++++-------- lisp/calendar/holidays.el | 2 +- 2 files changed, 7 insertions(+), 9 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) diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 3eae2dcc7f1..bda5dc5a6bb 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -482,7 +482,7 @@ The optional LABEL is used to label the buffer created." (calendar-increment-month displayed-month displayed-year 3) (setq s (calendar-absolute-from-gregorian (list displayed-month 1 displayed-year)))) - (save-excursion + (save-current-buffer (calendar-in-read-only-buffer holiday-buffer (calendar-set-mode-line (if (= y1 y2) -- 2.39.5