From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 6011d39b6a: Fix drag-and-drop of files with multibyte filenames Date: Sun, 05 Jun 2022 12:21:52 +0300 Message-ID: <83r143a2j3.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23621"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 05 11:25:47 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxmW3-0005uo-1h for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jun 2022 11:25:47 +0200 Original-Received: from localhost ([::1]:35144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxmVq-0000zf-PH for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jun 2022 05:25:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxmSW-0008LI-Mn for emacs-devel@gnu.org; Sun, 05 Jun 2022 05:22:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxmSW-0007jM-6Q; Sun, 05 Jun 2022 05:22:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=GUdG0tUh48lnxWv7jdv6LHxRlaJIF2amyolngDKVyz4=; b=FqZyGdA79/yXWH 5q83HDA+ggJaT21pUpsd0Mtgy2cG/aun6esUOIl8PYPfs4b3Ty8vp8QyIn5jTW9D0BiLAsKJV2PBP cmGgGRIKWBxF+V57VdyaZW2l5DHTdPqN/+ibVh9NJVd9rL5UXjcJXRREmAlDm5AYCLFLRrD3EtpZi 4ntc44kHbNqL/5mzJrTeokdI9d2lWoZZIiV9DKgcrglek+mMoE/ysyD7OB0yaGmS4r4PMx8lFed9U wu71+roE4AwFeNVPhHHKVpHnFCliY4BK01/PDfyTPETXeqRbjhU9onDoevcRZ8MP9HFNOSL3zfj58 95QUbIO+lGaP+Lpg8E+w==; Original-Received: from [87.69.77.57] (port=2398 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxmSV-0008Ic-KS; Sun, 05 Jun 2022 05:22:07 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290682 Archived-At: > --- a/lisp/select.el > +++ b/lisp/select.el > @@ -630,20 +630,20 @@ two markers or an overlay. Otherwise, it is nil." > (xselect--encode-string 'TEXT (buffer-file-name (nth 2 value)))) > (if (and (stringp value) > (file-exists-p value)) > - (xselect--encode-string 'TEXT (expand-file-name value) > - nil t) > + ;; Motif expects this to be STRING, but it treats the data as > + ;; a sequence of bytes instead of a Latin-1 string. > + (cons 'STRING (encode-coding-string (expand-file-name value) > + 'raw-text-unix)) I don't think I understand this change. raw-text basically doesn't do any conversion, except if the text includes raw bytes. Is that the problem here, and if so, how come a file name can include raw bytes in its name? And what does "Motif expects this to be STRING, but it treats the data as a sequence of bytes instead of a Latin-1 string" mean in this context? The difference between raw bytes and Latin-1 strings is only meaningful to Emacs; how does Motif distinguish between them?