aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa2003-03-12 08:02:32 +0000
committerKenichi Handa2003-03-12 08:02:32 +0000
commitb6647390d956e5f2762254ef02ef08e7d3d1ee61 (patch)
treefcc0b2768a6ac26695d6595e01b0110f0c1217f9 /lisp
parentd5d6513e177b639a4322f9a691917a716029a2a3 (diff)
downloademacs-b6647390d956e5f2762254ef02ef08e7d3d1ee61.tar.gz
emacs-b6647390d956e5f2762254ef02ef08e7d3d1ee61.zip
(insert-directory): Decode by what specified.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el38
1 files changed, 24 insertions, 14 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 21f5a3bb014..7b975d7c996 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4125,21 +4125,31 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'."
4125 (delete-region (point) (progn (forward-line 2) (point))))) 4125 (delete-region (point) (progn (forward-line 2) (point)))))
4126 4126
4127 ;; Now decode what read if necessary. 4127 ;; Now decode what read if necessary.
4128 (let ((coding (or coding-system-for-write 4128 (let ((coding (or coding-system-for-read
4129 (detect-coding-region beg (point) t))) 4129 file-name-coding-system
4130 default-file-name-coding-system
4131 'undecided))
4130 val pos) 4132 val pos)
4131 (if (not (eq (coding-system-base coding) 'undecided)) 4133 (when (and enable-multibyte-characters
4132 (save-restriction 4134 (not (memq (coding-system-base coding)
4133 (narrow-to-region beg (point)) 4135 '(raw-text no-conversion))))
4134 (goto-char (point-min)) 4136 ;; If no coding system is specified or detection is
4135 (while (not (eobp)) 4137 ;; requested, detect the coding.
4136 (setq pos (point) 4138 (if (eq (coding-system-base coding) 'undecided)
4137 val (get-text-property (point) 'dired-filename)) 4139 (setq coding (detect-coding-region beg (point) t)))
4138 (goto-char (next-single-property-change 4140 (if (not (eq (coding-system-base coding) 'undecided))
4139 (point) 'dired-filename nil (point-max))) 4141 (save-restriction
4140 (decode-coding-region pos (point) coding) 4142 (narrow-to-region beg (point))
4141 (if val 4143 (goto-char (point-min))
4142 (put-text-property pos (point) 'dired-filename t)))))) 4144 (while (not (eobp))
4145 (setq pos (point)
4146 val (get-text-property (point) 'dired-filename))
4147 (goto-char (next-single-property-change
4148 (point) 'dired-filename nil (point-max)))
4149 (decode-coding-region pos (point) coding)
4150 (if val
4151 (put-text-property pos (point)
4152 'dired-filename t)))))))
4143 4153
4144 (if full-directory-p 4154 (if full-directory-p
4145 ;; Try to insert the amount of free space. 4155 ;; Try to insert the amount of free space.