comparison lisp/tar-mode.el @ 64431:4c5a14fead4a

(tar-subfile-save-buffer): Use `insert-buffer-substring', not `insert-buffer'.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 18 Jul 2005 10:46:17 +0000
parents 6fb026ad601f
children 41bb365f41c4
comparison
equal deleted inserted replaced
64430:52b011251c32 64431:4c5a14fead4a
1118 (subfile-multibyte enable-multibyte-characters) 1118 (subfile-multibyte enable-multibyte-characters)
1119 (coding buffer-file-coding-system) 1119 (coding buffer-file-coding-system)
1120 (descriptor tar-superior-descriptor) 1120 (descriptor tar-superior-descriptor)
1121 subfile-size) 1121 subfile-size)
1122 ;; We must make the current buffer unibyte temporarily to avoid 1122 ;; We must make the current buffer unibyte temporarily to avoid
1123 ;; multibyte->unibyte conversion in `insert-buffer'. 1123 ;; multibyte->unibyte conversion in `insert-buffer-substring'.
1124 (set-buffer-multibyte nil) 1124 (set-buffer-multibyte nil)
1125 (setq subfile-size (buffer-size)) 1125 (setq subfile-size (buffer-size))
1126 (set-buffer tar-superior-buffer) 1126 (set-buffer tar-superior-buffer)
1127 (let* ((tokens (tar-desc-tokens descriptor)) 1127 (let* ((tokens (tar-desc-tokens descriptor))
1128 (start (tar-desc-data-start descriptor)) 1128 (start (tar-desc-data-start descriptor))
1142 (let* ((data-start (+ start (- tar-header-offset (point-min)))) 1142 (let* ((data-start (+ start (- tar-header-offset (point-min))))
1143 (data-end (+ data-start (ash (ash (+ size 511) -9) 9)))) 1143 (data-end (+ data-start (ash (ash (+ size 511) -9) 9))))
1144 (delete-region data-start data-end) 1144 (delete-region data-start data-end)
1145 ;; insert the new data... 1145 ;; insert the new data...
1146 (goto-char data-start) 1146 (goto-char data-start)
1147 (insert-buffer subfile) 1147 (insert-buffer-substring subfile)
1148 (setq subfile-size 1148 (setq subfile-size
1149 (encode-coding-region 1149 (encode-coding-region
1150 data-start (+ data-start subfile-size) coding)) 1150 data-start (+ data-start subfile-size) coding))
1151 ;; 1151 ;;
1152 ;; pad the new data out to a multiple of 512... 1152 ;; pad the new data out to a multiple of 512...