emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auto-overlays 2860354 58/93: Fixed obsolete functions a


From: Stefan Monnier
Subject: [elpa] externals/auto-overlays 2860354 58/93: Fixed obsolete functions and other compiler warnings.
Date: Mon, 14 Dec 2020 13:00:38 -0500 (EST)

branch: externals/auto-overlays
commit 286035424e99b8aa50d2f0d9e07cd4513faba746
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>

    Fixed obsolete functions and other compiler warnings.
---
 auto-overlays.el | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/auto-overlays.el b/auto-overlays.el
index c162f17..5c78d9c 100644
--- a/auto-overlays.el
+++ b/auto-overlays.el
@@ -2,10 +2,10 @@
 ;;; auto-overlays.el --- automatic regexp-delimited overlays for emacs
 
 
-;; Copyright (C) 2005-2010 Toby Cubitt
+;; Copyright (C) 2005-2010, 2012 Toby Cubitt
 
 ;; Author: Toby Cubitt <toby-predictive@dr-qubit.org>
-;; Version: 0.9.9
+;; Version: 0.9.10
 ;; Keywords: automatic, overlays
 ;; URL: http://www.dr-qubit.org/emacs.php
 
@@ -30,6 +30,10 @@
 
 ;;; Change Log:
 ;;
+;; Version 0.9.10
+;; * use `with-current-buffer' instead of `save-excursion' + `set-buffer' to
+;;   get rid of byte-compiler message
+;;
 ;; Version 0.9.9
 ;; * added missing (eval-when-compile (require 'cl))
 ;;
@@ -794,8 +798,7 @@ other. TO-BUFFER defaults to the current buffer."
   (unless to-buffer (setq to-buffer (current-buffer)))
   (let (regexps)
     ;; get regexp set from FROM-BUFFER
-    (save-excursion
-      (set-buffer from-buffer)
+    (with-current-buffer from-buffer
       (setq regexps (assq set-id auto-overlay-regexps))
       ;; delete any existing set with same ID, and add regexp set to TO-BUFFER
       (set-buffer to-buffer)
@@ -985,9 +988,7 @@ The overlays can be loaded again later using
            overlay-list)
 
       ;; save the buffer and kill it
-      (save-excursion
-       (set-buffer buff)
-       (write-file file))
+      (with-current-buffer buff (write-file file))
       (kill-buffer buff))
     ))
 
@@ -1039,9 +1040,7 @@ overlays were saved."
            (i 0))
 
        ;; read md5 digests from first two lines of FILE
-       (save-excursion
-         (set-buffer buff)
-         (goto-char (point-min)))
+       (with-current-buffer buff (goto-char (point-min)))
        (setq md5-buff (read buff))
        (setq md5-regexp (read buff))
 
@@ -1057,8 +1056,7 @@ overlays were saved."
            (progn (kill-buffer buff) nil)
 
          ;; count number of overlays, for progress message
-         (save-excursion
-           (set-buffer buff)
+         (with-current-buffer buff
            (setq lines (count-lines (point) (point-max))))
 
          ;; read overlay data from FILE until we reach the end



reply via email to

[Prev in Thread] Current Thread [Next in Thread]