(viqr-pre-write-conversion): Use with-temp-buffer.
[bpt/emacs.git] / lisp / language / viet-util.el
index 0520a83..f90dc49 100644 (file)
@@ -283,14 +283,12 @@ positions (integers or markers) specifying the stretch of the region."
 
 ;;;###autoload
 (defun viqr-pre-write-conversion (from to)
-  (let ((old-buf (current-buffer))
-       (work-buf (get-buffer-create " *viet-work*")))
-    (set-buffer work-buf)
-    (erase-buffer)
-    (if (stringp from)
-       (insert from)
-      (insert-buffer-substring old-buf from to))
-    (viet-encode-viqr-region (point-min) (point-max))
+  (let ((old-buf (current-buffer)))
+    (with-temp-buffer
+      (if (stringp from)
+         (insert from)
+       (insert-buffer-substring old-buf from to))
+      (viet-encode-viqr-region (point-min) (point-max)))
     ;; Should return nil as annotations.
     nil))