From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#30755: 25.3; Encoding of load-file-name wrong when path to working dir does not contain accented letter Date: Sun, 11 Mar 2018 18:09:35 +0200 Message-ID: <83bmfutwzk.fsf@gnu.org> References: <5aa26e5f.d05b1c0a.10214.5e41@mx.google.com> <836065weec.fsf@gnu.org> <5aa2ff79.c786df0a.cebf4.23cd@mx.google.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1520784494 20654 195.159.176.226 (11 Mar 2018 16:08:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2018 16:08:14 +0000 (UTC) Cc: 30755@debbugs.gnu.org To: =?UTF-8?Q?M=C3=A1rton?= Marczell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 11 17:08:09 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ev3W3-0005F7-DT for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Mar 2018 17:08:07 +0100 Original-Received: from localhost ([::1]:54828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev3Y5-0003M9-Rw for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Mar 2018 12:10:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev3Xx-0003LY-8f for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2018 12:10:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ev3Xu-0001oJ-3H for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2018 12:10:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ev3Xt-0001o7-V7 for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2018 12:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ev3Xt-0005EP-PX for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2018 12:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Mar 2018 16:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30755 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30755-submit@debbugs.gnu.org id=B30755.152078458420073 (code B ref 30755); Sun, 11 Mar 2018 16:10:01 +0000 Original-Received: (at 30755) by debbugs.gnu.org; 11 Mar 2018 16:09:44 +0000 Original-Received: from localhost ([127.0.0.1]:55602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ev3Xb-0005Dh-Tl for submit@debbugs.gnu.org; Sun, 11 Mar 2018 12:09:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ev3XZ-0005DN-D4 for 30755@debbugs.gnu.org; Sun, 11 Mar 2018 12:09:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ev3XQ-0001cI-W5 for 30755@debbugs.gnu.org; Sun, 11 Mar 2018 12:09:36 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev3XQ-0001cE-S3; Sun, 11 Mar 2018 12:09:32 -0400 Original-Received: from [176.228.60.248] (port=4941 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ev3XQ-0001Bk-Bt; Sun, 11 Mar 2018 12:09:32 -0400 In-reply-to: <5aa2ff79.c786df0a.cebf4.23cd@mx.google.com> (message from =?UTF-8?Q?M=C3=A1rton?= Marczell on Fri, 9 Mar 2018 22:41:12 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144127 Archived-At: > From: Márton Marczell > Date: Fri, 9 Mar 2018 22:41:12 +0100 > > > How is load-file-name of the package's .el file related to its inability to load images? > > It loads images like this: > > (defconst neo-dir > (expand-file-name (if load-file-name > (file-name-directory load-file-name) > default-directory))) > ;… > (defun neo-buffer--get-icon (name) > "Get image by NAME." > (let ((icon-path (neo-path--join neo-dir "icons")) > image) > (setq image (create-image > (neo-path--join icon-path (concat name ".xpm")) > 'xpm nil :ascent 'center :mask '(heuristic t))) > image)) > > So the (wrongly encoded) load-file-name path is used to build the path to the image assets. Which makes image loading fail with the error > Cannot find image file ‘c:/Users/M rton/AppData/Roaming/.emacs.d/elpa/neotree-0.5.2/icons/leaf.xpm’ > > > Also, can you please provide a recipe that takes neotree.el out of the > > equation? AFAIU, it should be enough to have a .el file that is > > loaded in .emacs, and have the contents of that file be just > > (print load-file-name) > > Is that correct? > > Yes that is correct. OK, thanks. I tried reproducing this problem, but failed. I guess there are still important details of the situation that are missing from the description. One detail that might be important is how exactly do you load neotree.el from your init file. In my reproduction attempt, I just created a .emacs file with only one line: (load "~/foo/foo.el") where foo.el had this single line: (print load-file-name) This produced the correct file name in the *Messages* buffer when Emacs was started from a directory that had no non-ASCII characters, while the home directory did include non-ASCII characters, which I believe is your case. Please provide a full description of how you load your file, and preferably also try reproducing the problem with a simple setup such as what I used above (modified to match the exact way you load neotree.el in the real-life use case), and see if you succeed reproducing it. Also, if you repeat your original use case, but before starting Emacs set HOME=c:\Users\Márton\AppData\Roaming in the environment of the shell from which you invoke Emacs, does the problem reproduce itself? (Btw, is the shell from which you start Emacs the stock Windows shell cmd.exe or something else?) And finally, please keep the bug address on the CC list of your responses, so that this discussion gets recorded by the bug tracker. Thanks.