]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix more save-excursion warnings.
authorChong Yidong <cyd@stupidchicken.com>
Sun, 28 Feb 2010 01:22:44 +0000 (20:22 -0500)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 28 Feb 2010 01:22:44 +0000 (20:22 -0500)
* textmodes/reftex-toc.el (reftex-toc-promote-prepare):
* emacs-lisp/elint.el (elint-add-required-env):
* cedet/semantic/db-find.el (semanticdb-find-translate-path-brutish-default):
* cedet/ede/make.el (ede-make-check-version):
* calendar/icalendar.el (icalendar--add-diary-entry):
* calc/calcalg2.el (math-tracing-integral): Use with-current-buffer instead of save-excursion.

lisp/ChangeLog
lisp/calc/calcalg2.el
lisp/calendar/icalendar.el
lisp/cedet/ede/make.el
lisp/cedet/semantic/db-find.el
lisp/emacs-lisp/elint.el
lisp/textmodes/reftex-toc.el

index 27890d66ba6fa4902dd4221dfa7c142a600ed400..1c91ebe48317c2937305db1c8a5e71a00ef36110 100644 (file)
@@ -1,5 +1,12 @@
 2010-02-28  Chong Yidong  <cyd@stupidchicken.com>
 
+       * textmodes/reftex-toc.el (reftex-toc-promote-prepare):
+       * emacs-lisp/elint.el (elint-add-required-env):
+       * cedet/semantic/db-find.el
+       (semanticdb-find-translate-path-brutish-default):
+       * cedet/ede/make.el (ede-make-check-version):
+       * calendar/icalendar.el (icalendar--add-diary-entry):
+       * calc/calcalg2.el (math-tracing-integral):
        * files.el (recover-session-finish): Use with-current-buffer
        instead of save-excursion.
 
index 3d90de3f0b3d0077d5c327ab70f1fafeed8aef72..2b45ce1b2f0bcdea8520ec46f4d47becc76f3ff3 100644 (file)
 (defmacro math-tracing-integral (&rest parts)
   (list 'and
        'trace-buffer
-       (list 'save-excursion
-             '(set-buffer trace-buffer)
+       (list 'with-current-buffer
+             'trace-buffer
              '(goto-char (point-max))
              (list 'and
                    '(bolp)
index 535956be1409f17983f9bb91fc7e40297fbf0ef1..a07402aa0315aa07173734ee92ad11176a89cfff 100644 (file)
@@ -2246,8 +2246,7 @@ the entry."
                  'make-diary-entry)
                string non-marking diary-file)))
   ;; Würgaround to remove the trailing blank char
-  (save-excursion
-    (set-buffer (find-file diary-file))
+  (with-current-buffer (find-file diary-file)
     (goto-char (point-max))
     (if (= (char-before) ? )
         (delete-char -1)))
index e9bc4b3b8e0cb0550165643688323f68c7f1f3da..6b59f510bedfdbf641eba221510aafaf3f54ed9c 100644 (file)
@@ -76,9 +76,8 @@ If NOERROR is nil, then throw an error on failure.  Return t otherwise."
        (rev nil)
        (ans nil)
        )
-    (save-excursion
+    (with-current-buffer b
       ;; Setup, and execute make.
-      (set-buffer b)
       (setq default-directory cd)
       (erase-buffer)
       (call-process ede-make-command nil b nil
index eba04a7ee02c05b906f4277380175f78fb6bd9c5..754ba231c37aa9c50fad5a3e4a27787081278201 100644 (file)
@@ -326,9 +326,8 @@ Default action as described in `semanticdb-find-translate-path'."
         (cond ((null path) semanticdb-current-database)
               ((semanticdb-table-p path) (oref path parent-db))
               (t (let ((tt (semantic-something-to-tag-table path)))
-                   (save-excursion
-                     ;; @todo - What does this DO ??!?!
-                     (set-buffer (semantic-tag-buffer (car tt)))
+                   ;; @todo - What does this DO ??!?!
+                   (with-current-buffer (semantic-tag-buffer (car tt))
                      semanticdb-current-database))))))
     (apply
      #'nconc
index 6e0758680d51869afd7575c41d2b3dcb05fdd7cc..b9aa29decd03c72074bb4ec701d953f298d72683 100644 (file)
@@ -505,11 +505,10 @@ Return nil if there are no more forms, t otherwise."
        ;; (Messes up the "Initializing elint..." message.)
 ;;;    (message nil)
        (if lib
-           (save-excursion
+           (with-current-buffer (find-file-noselect lib)
              ;; FIXME this doesn't use a temp buffer, because it
              ;; stores the result in buffer-local variables so that
              ;; it can be reused.
-             (set-buffer (find-file-noselect lib))
              (elint-update-env)
              (setq env (elint-env-add-env env elint-buffer-env)))
              ;;; (with-temp-buffer
index 1066066462df685964446c77f03d27c0b5134e9a..ae1690416b96da56246748b731c48fb554fb9f58 100644 (file)
@@ -665,9 +665,8 @@ promotion/demotion later."
           (if (and (markerp marker) (marker-buffer marker))
               ;; Buffer is still live and we have the marker.
               (progn
-                (save-excursion
+                (with-current-buffer (marker-buffer marker)
                   ;; Goto the buffer and check of section is unchanged
-                  (set-buffer (marker-buffer marker))
                   (goto-char (marker-position marker))
                   (if (looking-at (regexp-quote literal))
                       ;; OK, get the makro name