From: Stefan Kangas <stefan@marxist.se>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Peter Dyballa <Peter_Dyballa@freenet.de>,
Stefan Monnier <monnier@iro.umontreal.ca>,
4157@debbugs.gnu.org
Subject: bug#4157: 23.1.50; faulty character characterisation for ä
Date: Thu, 10 Oct 2019 14:41:51 +0200 [thread overview]
Message-ID: <CADwFkmnHZRNSkxrb8wSiZLqxePtc7O_rdZBb5JhJAg5J_7e3dg@mail.gmail.com> (raw)
In-Reply-To: <CADwFkmk0tBAcV2WBYMEu_j_37BkN_28VM+1+g6sy27y6BOfMoQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 189 bytes --]
Stefan Kangas <stefan@marxist.se> writes:
> How about something like the attached diff? Would that be a
> reasonable approach?
Fixed a typo in the attached.
Best regards,
Stefan Kangas
[-- Attachment #2: setlang2.diff --]
[-- Type: application/octet-stream, Size: 1658 bytes --]
diff --git a/lisp/dired.el b/lisp/dired.el
index 6e48d28b4c..f7c8f853b9 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1280,6 +1280,22 @@ dired-switches-recursive-p
"Return non-nil if the string SWITCHES contains -R or --recursive."
(dired-check-switches switches "R" "recursive"))
+(defmacro dired--with-encoding (encoding remote &rest body)
+ "Temporarily set LANG environment variable to ENCODING and run BODY.
+If REMOTE is non-nil, just run BODY."
+ (declare (indent 2))
+ `(if (not remote)
+ (let ((orig (getenv "LANG"))
+ (new orig))
+ (unwind-protect
+ (progn
+ (while (string-match "\\.\\([^.@]+\\)" new)
+ (setq new (replace-match encoding nil nil new)))
+ (setenv "LANG" new)
+ ,@body)
+ (setenv "LANG" orig)))
+ ,@body))
+
(defun dired-insert-directory (dir switches &optional file-list wildcard hdr)
"Insert a directory listing of DIR, Dired style.
Use SWITCHES to make the listings.
@@ -1330,8 +1346,9 @@ dired-insert-directory
(executable-find "sh")))
(switch (if remotep "-c" shell-command-switch)))
(unless
- (zerop
- (process-file sh nil (current-buffer) nil switch script))
+ (dired--with-encoding "UTF-8" remotep
+ (zerop
+ (process-file sh nil (current-buffer) nil switch script)))
(user-error
"%s: No files matching wildcard" (cdr dir-wildcard)))
(insert-directory-clean (point) switches)))
next prev parent reply other threads:[~2019-10-10 12:41 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-16 2:19 bug#4157: 23.1.50; faulty character characterisation for ä Peter Dyballa
2009-08-18 1:09 ` Kenichi Handa
2009-08-18 13:40 ` Peter Dyballa
2009-08-19 0:23 ` bug#4157: " Kenichi Handa
2009-08-19 22:47 ` Peter Dyballa
2009-08-24 11:30 ` Peter Dyballa
2009-08-24 12:22 ` bug#4157: " Kenichi Handa
2009-08-24 15:21 ` Peter Dyballa
2009-08-25 0:46 ` bug#4157: " Kenichi Handa
2009-08-25 7:51 ` Peter Dyballa
2009-08-25 22:19 ` Peter Dyballa
2009-08-27 6:52 ` bug#4157: " Kenichi Handa
2009-08-27 8:50 ` Peter Dyballa
2009-08-27 11:33 ` bug#4157: " Kenichi Handa
2009-08-27 12:38 ` Peter Dyballa
2009-08-28 19:27 ` Peter Dyballa
2009-08-31 21:11 ` Peter Dyballa
2009-09-01 0:04 ` Stefan Monnier
2009-09-04 0:58 ` Kenichi Handa
2009-08-22 4:09 ` Stefan Monnier
2009-08-22 8:50 ` Peter Dyballa
2009-08-23 1:49 ` Stefan Monnier
2009-08-23 9:57 ` Peter Dyballa
2019-10-09 14:29 ` Stefan Kangas
2019-10-09 18:48 ` Eli Zaretskii
2019-10-09 19:47 ` Stefan Monnier
2019-10-09 22:42 ` Peter Dyballa
2019-11-11 1:49 ` Stefan Kangas
2019-11-11 16:36 ` Peter Dyballa
2019-10-10 0:10 ` Stefan Kangas
2019-10-10 7:20 ` Eli Zaretskii
2019-10-10 10:36 ` Stefan Kangas
2019-10-10 11:20 ` Eli Zaretskii
2019-10-10 11:52 ` Stefan Kangas
2019-10-10 12:39 ` Stefan Kangas
2019-10-10 12:41 ` Stefan Kangas [this message]
2019-10-10 18:33 ` Peter Dyballa
2019-10-10 18:57 ` Eli Zaretskii
2019-10-10 21:07 ` Stefan Monnier
2019-10-11 13:33 ` Stefan Kangas
2019-10-11 7:10 ` Andreas Schwab
2019-10-11 7:23 ` Peter Dyballa
2019-10-10 8:15 ` Andreas Schwab
2019-10-10 12:54 ` Stefan Monnier
2019-10-10 13:12 ` Stefan Kangas
2019-11-17 20:58 ` Stefan Kangas
-- strict thread matches above, loose matches on Subject: below --
2009-09-04 5:51 川幡太一
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADwFkmnHZRNSkxrb8wSiZLqxePtc7O_rdZBb5JhJAg5J_7e3dg@mail.gmail.com \
--to=stefan@marxist.se \
--cc=4157@debbugs.gnu.org \
--cc=Peter_Dyballa@freenet.de \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).