[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master d5c6f70 3/3: Fix byte-compilation warnings
From: |
Mattias Engdeg�rd |
Subject: |
master d5c6f70 3/3: Fix byte-compilation warnings |
Date: |
Sat, 11 Sep 2021 11:36:40 -0400 (EDT) |
branch: master
commit d5c6f701a64413667fb573e12e05b89f8704c3f7
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
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 9dfdba3..7891e35 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 3eae2dc..bda5dc5 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)