]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix byte-compilation warnings
authorMattias Engdegård <mattiase@acm.org>
Sat, 11 Sep 2021 15:13:14 +0000 (17:13 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sat, 11 Sep 2021 15:17:34 +0000 (17:17 +0200)
* 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
lisp/calendar/holidays.el

index 9dfdba3930808b774f1fff46e1ad6e486fe8c26f..7891e35c40f067194f63a3dbf960b490d2425732 100644 (file)
@@ -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)
index 3eae2dcc7f1096c768d79a7a7161fe81bafd3b04..bda5dc5a6bb6d52d0aea423215f3acc9f1b1ee0f 100644 (file)
@@ -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)