# HG changeset patch # User Stefan Monnier # Date 1257454892 0 # Node ID 3367f0022cf2225aa90cb7bfea729f74e5a4e01d # Parent 131bccfc4f5de6efbbe94cf70417a60e72851bb0 * nxml/xsd-regexp.el (xsdre-gen-categories): * nxml/xmltok.el (xmltok-parse-entity): * nxml/rng-parse.el (rng-parse-validate-file): * nxml/rng-maint.el (rng-format-manual, rng-manual-output-force-new-line): * nxml/rng-loc.el (rng-save-schema-location-1): * nxml/rng-cmpct.el (rng-c-parse-file): * nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set): * nxml/nxml-parse.el (nxml-parse-file): Use with-current-buffer. diff -r 131bccfc4f5d -r 3367f0022cf2 lisp/ChangeLog --- a/lisp/ChangeLog Thu Nov 05 21:00:31 2009 +0000 +++ b/lisp/ChangeLog Thu Nov 05 21:01:32 2009 +0000 @@ -1,3 +1,15 @@ +2009-11-05 Stefan Monnier + + * nxml/xsd-regexp.el (xsdre-gen-categories): + * nxml/xmltok.el (xmltok-parse-entity): + * nxml/rng-parse.el (rng-parse-validate-file): + * nxml/rng-maint.el (rng-format-manual) + (rng-manual-output-force-new-line): + * nxml/rng-loc.el (rng-save-schema-location-1): + * nxml/rng-cmpct.el (rng-c-parse-file): + * nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set): + * nxml/nxml-parse.el (nxml-parse-file): Use with-current-buffer. + 2009-11-05 Wilson Snyder * verilog-mode.el (verilog-getopt-file, verilog-set-define): diff -r 131bccfc4f5d -r 3367f0022cf2 lisp/nxml/nxml-maint.el --- a/lisp/nxml/nxml-maint.el Thu Nov 05 21:00:31 2009 +0000 +++ b/lisp/nxml/nxml-maint.el Thu Nov 05 21:01:32 2009 +0000 @@ -74,8 +74,7 @@ (defun nxml-insert-target-repertoire-glyph-set (file var) (interactive "fTarget file: \nSVariable name: ") (let (lst head) - (save-excursion - (set-buffer (find-file-noselect file)) + (with-current-buffer (find-file-noselect file) (goto-char (point-min)) (while (re-search-forward "^ *\\([a-FA-F0-9]\\{2\\}\\)[ \t]+" nil t) (let ((row (match-string 1)) diff -r 131bccfc4f5d -r 3367f0022cf2 lisp/nxml/nxml-parse.el --- a/lisp/nxml/nxml-parse.el Thu Nov 05 21:00:31 2009 +0000 +++ b/lisp/nxml/nxml-parse.el Thu Nov 05 21:01:32 2009 +0000 @@ -98,16 +98,14 @@ If the variable `nxml-validate-function' is non-nil, it will be called twice for each element, and any reported error will be signaled in the same way as well-formedness error." - (save-excursion - (set-buffer (nxml-parse-find-file file)) + (with-current-buffer (nxml-parse-find-file file) (unwind-protect (let ((nxml-parse-file-name file)) (nxml-parse-instance)) (kill-buffer nil)))) (defun nxml-parse-find-file (file) - (save-excursion - (set-buffer (get-buffer-create " *nXML Parse*")) + (with-current-buffer (get-buffer-create " *nXML Parse*") (erase-buffer) (let ((set-auto-coding-function 'nxml-set-xml-coding)) (insert-file-contents file)) diff -r 131bccfc4f5d -r 3367f0022cf2 lisp/nxml/rng-cmpct.el --- a/lisp/nxml/rng-cmpct.el Thu Nov 05 21:00:31 2009 +0000 +++ b/lisp/nxml/rng-cmpct.el Thu Nov 05 21:01:32 2009 +0000 @@ -348,8 +348,7 @@ (defvar rng-c-file-index nil) (defun rng-c-parse-file (filename &optional context) - (save-excursion - (set-buffer (get-buffer-create (rng-c-buffer-name context))) + (with-current-buffer (get-buffer-create (rng-c-buffer-name context)) (erase-buffer) (rng-c-init-buffer) (setq rng-c-file-name diff -r 131bccfc4f5d -r 3367f0022cf2 lisp/nxml/rng-loc.el --- a/lisp/nxml/rng-loc.el Thu Nov 05 21:00:31 2009 +0000 +++ b/lisp/nxml/rng-loc.el Thu Nov 05 21:01:32 2009 +0000 @@ -508,8 +508,7 @@ "schema location") file))))) (t - (save-excursion - (set-buffer (find-file-noselect file)) + (with-current-buffer (find-file-noselect file) (let ((modified (buffer-modified-p))) (if (> (buffer-size) 0) (let (xmltok-dtd) diff -r 131bccfc4f5d -r 3367f0022cf2 lisp/nxml/rng-maint.el --- a/lisp/nxml/rng-maint.el Thu Nov 05 21:00:31 2009 +0000 +++ b/lisp/nxml/rng-maint.el Thu Nov 05 21:01:32 2009 +0000 @@ -46,8 +46,7 @@ rng-dir))) (texi-buf (find-file-noselect (expand-file-name rng-manual-texi rng-dir)))) - (save-excursion - (set-buffer texi-buf) + (with-current-buffer texi-buf (erase-buffer) (let ((standard-output texi-buf)) (princ (format "\\input texinfo @c -*- texinfo -*-\n\ @@ -212,14 +211,12 @@ )))) (defun rng-manual-output-force-new-line () - (save-excursion - (set-buffer standard-output) + (with-current-buffer standard-output (unless (eq (char-before) ?\n) (insert ?\n)))) (defun rng-manual-output-force-blank-line () - (save-excursion - (set-buffer standard-output) + (with-current-buffer standard-output (if (eq (char-before) ?\n) (unless (eq (char-before (1- (point))) ?\n) (insert ?\n)) diff -r 131bccfc4f5d -r 3367f0022cf2 lisp/nxml/rng-parse.el --- a/lisp/nxml/rng-parse.el Thu Nov 05 21:00:31 2009 +0000 +++ b/lisp/nxml/rng-parse.el Thu Nov 05 21:01:32 2009 +0000 @@ -40,8 +40,7 @@ for validation, such as returned by the function `rng-c-load-schema'. If the XML document is invalid with respect to schema, an error will be signaled in the same way as when it is not well-formed." - (save-excursion - (set-buffer (nxml-parse-find-file file)) + (with-current-buffer (nxml-parse-find-file file) (unwind-protect (let ((nxml-parse-file-name file) (nxml-validate-function 'rng-parse-do-validate) diff -r 131bccfc4f5d -r 3367f0022cf2 lisp/nxml/xmltok.el --- a/lisp/nxml/xmltok.el Thu Nov 05 21:00:31 2009 +0000 +++ b/lisp/nxml/xmltok.el Thu Nov 05 21:01:32 2009 +0000 @@ -1759,8 +1759,7 @@ (setcdr name-def 'not-well-formed) ; avoid infinite expansion loops (setq buf (get-buffer-create (format " *Entity %s*" (car name-def)))) - (save-excursion - (set-buffer buf) + (with-current-buffer buf (erase-buffer) (insert def) (goto-char (point-min)) diff -r 131bccfc4f5d -r 3367f0022cf2 lisp/nxml/xsd-regexp.el --- a/lisp/nxml/xsd-regexp.el Thu Nov 05 21:00:31 2009 +0000 +++ b/lisp/nxml/xsd-regexp.el Thu Nov 05 21:01:32 2009 +0000 @@ -710,8 +710,7 @@ "Use a UnicodeData file to generate code to initialize Unicode categories. Code is inserted into the current buffer." (interactive "fUnicodeData file: ") - (save-excursion - (set-buffer (find-file-noselect file)) + (with-current-buffer (find-file-noselect file) (goto-char (point-min)) (mapc (lambda (x) (put x 'xsdre-ranges nil)) xsdre-gen-categories) (while (re-search-forward "^\\([0-9A-Fa-f]*\\);[^;]*;\\([A-Z][a-z]\\);"