unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Márton Marczell" <dalokmarcinak@gmail.com>
Cc: 30755@debbugs.gnu.org
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	[thread overview]
Message-ID: <83bmfutwzk.fsf@gnu.org> (raw)
In-Reply-To: <5aa2ff79.c786df0a.cebf4.23cd@mx.google.com> (message from Márton Marczell on Fri, 9 Mar 2018 22:41:12 +0100)

> From: Márton Marczell <dalokmarcinak@gmail.com>
> 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.





  parent reply	other threads:[~2018-03-11 16:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 11:22 bug#30755: 25.3; Encoding of load-file-name wrong when path to working dir does not contain accented letter Márton Marczell
2018-03-09 13:46 ` Eli Zaretskii
     [not found]   ` <5aa2ff79.c786df0a.cebf4.23cd@mx.google.com>
2018-03-11 16:09     ` Eli Zaretskii [this message]
2018-03-17 14:19       ` bug#30755: 25.3; Encoding of load-file-name wrong when path toworking " Márton Marczell
2018-03-17 14:58         ` Eli Zaretskii
     [not found]           ` <CAChNUDE1RMe2SM9m0UJ2QdVYgCuewo_MWVhbPWKadd6pPm65=Q@mail.gmail.com>
     [not found]             ` <CAChNUDE+Et1DtkgS_4-f3EKVvvxbo4PVxPVgGuGP=rScUH=qng@mail.gmail.com>
2018-05-09  9:06               ` Márton Marczell
2018-05-09 17:28             ` Eli Zaretskii
2018-05-10 22:23               ` bug#30755: 25.3; Encoding of load-file-name wrong when pathtoworking " Márton Marczell
2018-05-15 17:22                 ` Eli Zaretskii
2018-05-16  7:42                   ` bug#30755: 25.3; Encoding of load-file-name wrong whenpathtoworking " Márton Marczell
2018-05-16  8:07                     ` Eli Zaretskii
2018-05-17 14:54                       ` bug#30755: 25.3; Encoding of load-file-name wrongwhenpathtoworking " Márton Marczell
2018-05-17 15:19                         ` Eli Zaretskii
2018-05-18 13:06                           ` Márton Marczell
2018-05-18 13:38                             ` 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=83bmfutwzk.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=30755@debbugs.gnu.org \
    --cc=dalokmarcinak@gmail.com \
    /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).