summaryrefslogtreecommitdiff
path: root/lisp/international/mule.el
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2005-02-21 12:53:33 +0000
committerKenichi Handa <handa@m17n.org>2005-02-21 12:53:33 +0000
commit002dc23966fa58f46a9f6274c365563f56d7eaae (patch)
treecce98e59ffe6101eb86bf88de7e9b1e909463825 /lisp/international/mule.el
parentd782c34829ed3aca9e4debb63b30568178407486 (diff)
downloademacs-002dc23966fa58f46a9f6274c365563f56d7eaae.tar.gz
(ctext-pre-write-conversion): Always use
" *code-converting-work*" buffer for work.
Diffstat (limited to 'lisp/international/mule.el')
-rw-r--r--lisp/international/mule.el24
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 5ba6f1d69e4..9a5646217ec 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1467,18 +1467,20 @@ If FROM is a string, or if the current buffer is not the one set up for us
by encode-coding-string, generate a new temp buffer, insert the
text, and convert it in the temporary buffer. Otherwise, convert in-place."
(save-match-data
- ;; Setup a working buffer if necessary.
- (cond ((stringp from)
- (let ((buf (current-buffer)))
- (set-buffer (generate-new-buffer " *temp"))
+ (let ((workbuf (get-buffer-create " *code-conversion-work*")))
+ ;; Setup a working buffer if necessary.
+ (cond ((stringp from)
+ (set-buffer workbuf)
+ (erase-buffer)
(set-buffer-multibyte (multibyte-string-p from))
- (insert from)))
- ((not (string= (buffer-name) " *code-converting-work*"))
- (let ((buf (current-buffer))
- (multibyte enable-multibyte-characters))
- (set-buffer (generate-new-buffer " *temp"))
- (set-buffer-multibyte multibyte)
- (insert-buffer-substring buf from to))))
+ (insert from))
+ ((not (eq (current-buffer) workbuf))
+ (let ((buf (current-buffer))
+ (multibyte enable-multibyte-characters))
+ (set-buffer workbuf)
+ (erase-buffer)
+ (set-buffer-multibyte multibyte)
+ (insert-buffer-substring buf from to)))))
;; Now we can encode the whole buffer.
(let ((encoding-table (ctext-non-standard-encodings-table))