emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/files.el


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/lisp/files.el
Date: Thu, 23 Jan 2003 00:59:47 -0500

Index: emacs/lisp/files.el
diff -c emacs/lisp/files.el:1.630 emacs/lisp/files.el:1.631
*** emacs/lisp/files.el:1.630   Mon Jan 13 03:05:13 2003
--- emacs/lisp/files.el Thu Jan 23 00:59:47 2003
***************
*** 4017,4028 ****
  
          ;; Read the actual directory using `insert-directory-program'.
          ;; RESULT gets the status code.
!         (let* ((coding-system-for-read
                  (and enable-multibyte-characters
                       (or file-name-coding-system
!                          default-file-name-coding-system)))
!                ;; This is to control encoding the arguments in call-process.
!                (coding-system-for-write coding-system-for-read))
            (setq result
                  (if wildcard
                      ;; Run ls in the directory part of the file pattern
--- 4017,4031 ----
  
          ;; Read the actual directory using `insert-directory-program'.
          ;; RESULT gets the status code.
!         (let* (;; We at first read by no-conversion, then after
!                ;; putting text property `dired-filename, decode one
!                ;; bunch by one to preserve that property.
!                (coding-system-for-read 'no-conversion)
!                ;; This is to control encoding the arguments in call-process.
!                (coding-system-for-write 
                  (and enable-multibyte-characters
                       (or file-name-coding-system
!                          default-file-name-coding-system))))
            (setq result
                  (if wildcard
                      ;; Run ls in the directory part of the file pattern
***************
*** 4105,4110 ****
--- 4108,4130 ----
              (goto-char end)
              (beginning-of-line)
              (delete-region (point) (progn (forward-line 2) (point)))))
+ 
+         ;; Now decode what read if necessary.
+         (let ((coding (or coding-system-for-write
+                           (detect-coding-region beg (point) t)))
+               val pos)
+           (if (not (eq (coding-system-base coding) 'undecided))
+               (save-restriction
+                 (narrow-to-region beg (point))
+                 (goto-char (point-min))
+                 (while (not (eobp))
+                   (setq pos (point)
+                         val (get-text-property (point) 'dired-filename))
+                   (goto-char (next-single-property-change
+                               (point) 'dired-filename nil (point-max)))
+                   (decode-coding-region pos (point) coding)
+                   (if val
+                       (put-text-property pos (point) 'dired-filename t))))))
  
          (if full-directory-p
              ;; Try to insert the amount of free space.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]