From: Johan Claesson <johanclaesson@bredband.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18037@debbugs.gnu.org
Subject: bug#18037: 24.3; term.el cannot track non-ascii directories
Date: Wed, 16 Jul 2014 21:52:07 +0200 [thread overview]
Message-ID: <87k37dcc9k.fsf@bredband.net> (raw)
In-Reply-To: <83oawp6rrr.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Jul 2014 22:13:44 +0300")
[-- Attachment #1: Type: text/plain, Size: 19 bytes --]
Ok, good catch.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: term.el.diff --]
[-- Type: text/x-diff, Size: 530 bytes --]
--- a/term.el 2014-07-16 19:22:09.348823919 +0200
+++ b/term.el 2014-07-16 21:30:28.272894153 +0200
@@ -3424,7 +3424,8 @@
(substring string (1+ first-colon) second-colon))))
(setq term-pending-frame (cons filename fileline))))
((= (aref string 0) ?/)
- (cd (substring string 1)))
+ (cd (decode-coding-string (substring string 1)
+ locale-coding-system)))
;; Allowing the inferior to call functions in Emacs is
;; probably too big a security hole.
;; ((= (aref string 0) ?!)
[-- Attachment #3: Type: text/plain, Size: 1310 bytes --]
Regards,
/Johan
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Johan Claesson <johanclaesson@bredband.net>
>> Date: Wed, 16 Jul 2014 20:09:48 +0200
>>
>> --- a/term.el 2014-07-16 19:22:09.348823919 +0200
>> +++ b/term.el 2014-07-16 19:25:33.920825786 +0200
>> @@ -3424,7 +3424,7 @@
>> (substring string (1+ first-colon) second-colon))))
>> (setq term-pending-frame (cons filename fileline))))
>> ((= (aref string 0) ?/)
>> - (cd (substring string 1)))
>> + (cd (string-as-multibyte (substring string 1))))
>> ;; Allowing the inferior to call functions in Emacs is
>> ;; probably too big a security hole.
>> ;; ((= (aref string 0) ?!)
>
> string-as-multibyte is not right.
>
>> (Motivation: in term-exec-1 the coding-system-for-read is set to 'binary
>> with the following comment:
>>
>> ;; The process's output contains not just chars but also binary
>> ;; escape codes, so we need to see the raw output. We will have to
>> ;; do the decoding by hand on the parts that are made of chars.
>>
>> I think term-command-hook is one place where such decoding is needed.)
>
> Indeed; but string-as-multibyte is not the way to decode the string.
> You need to use decode-coding-string and locale-coding-system.
next prev parent reply other threads:[~2014-07-16 19:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 18:09 bug#18037: 24.3; term.el cannot track non-ascii directories Johan Claesson
2014-07-16 19:13 ` Eli Zaretskii
2014-07-16 19:52 ` Johan Claesson [this message]
2014-11-14 16:37 ` Johan Claesson
2014-11-14 16:52 ` Eli Zaretskii
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=87k37dcc9k.fsf@bredband.net \
--to=johanclaesson@bredband.net \
--cc=18037@debbugs.gnu.org \
--cc=eliz@gnu.org \
/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).