emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 0a327af: Fix the 'T' command in Dired with non_ASCI


From: Eli Zaretskii
Subject: [Emacs-diffs] master 0a327af: Fix the 'T' command in Dired with non_ASCII file names
Date: Sat, 6 Aug 2016 09:45:56 +0000 (UTC)

branch: master
commit 0a327afe2e416777e09b24c18292f854536bdb23
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix the 'T' command in Dired with non_ASCII file names
    
    * lisp/dired-aux.el (dired-do-chxxx): Bind coding-system-for-write
    to correctly encode file names passed to the invoked PROGRAM.
    (Bug#24162)
---
 lisp/dired-aux.el |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 4732d9c..83fcf48 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -279,6 +279,14 @@ List has a form of (file-name full-file-name 
(attribute-list))."
                                                      ((eq op-symbol 'chgrp)
                                                       (system-groups)))))
         (operation (concat program " " new-attribute))
+         ;; When file-name-coding-system is set to something different
+         ;; from locale-coding-system, leaving the encoding
+         ;; determination to call-process will do the wrong thing,
+         ;; because the arguments in this case are file names, not
+         ;; just some arbitrary text.  (This must be bound last, to
+         ;; avoid adverse effects on any of the preceding forms.)
+         (coding-system-for-write (or file-name-coding-system
+                                      default-file-name-coding-system))
         failures)
     (setq failures
          (dired-bunch-files 10000



reply via email to

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