all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dani Moncayo <dmoncayo@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Building Emacs from a new MinGW environment
Date: Sat, 14 Sep 2013 17:50:40 +0300	[thread overview]
Message-ID: <83ppsbfoe7.fsf@gnu.org> (raw)
In-Reply-To: <CAH8Pv0io_920MRiT_8RsS2BVnhCfGPn0wBjV-AENynHeOXTy2g@mail.gmail.com>

> Date: Sat, 14 Sep 2013 16:25:03 +0200
> From: Dani Moncayo <dmoncayo@gmail.com>
> Cc: Emacs development discussions <emacs-devel@gnu.org>
> 
> I've looked for the first call to "Fexpand_file_name" which returns a
> "bad" file name (bad = containing a literal "%emacs_dir%").  It is
> this one:
> 
>   #0  Fexpand_file_name (name=57476769, default_directory=57476785)
>       at C:/msys/home/dani/emacs/emacs.git/src/fileio.c:1437
>   #1  0x01119643 in Fexpand_file_name (name=57476753,
> default_directory=57422161)
>       at C:/msys/home/dani/emacs/emacs.git/src/fileio.c:930
>   #2  0x011bf86f in init_callproc ()
>       at C:/msys/home/dani/emacs/emacs.git/src/callproc.c:1616
>   #3  0x010dad7c in main (argc=5, argv=0x972af8)
>       at C:/msys/home/dani/emacs/emacs.git/src/emacs.c:1325
> 
> The parameters of the call in frame #0 were:
>   (gdb) p SSDATA(name)
>   $1 = 0x36c4d50 <__register_frame_info+57429328>
> "%emacs_dir%/share/emacs/24.3.50/etc/"
>   (gdb) p SSDATA(default_directory)
>   $3 = 0x36c4d7c <__register_frame_info+57429372>
> "c:/msys/home/dani/emacs/build/src/"
> 
> The parameters of the call in frame #1 were:
>   (gdb) p SSDATA(name)
>   $4 = 0x36c4d48 <__register_frame_info+57429320> "GNU"
>   (gdb) p SSDATA(default_directory)
>   $5 = 0x36c4204 <__register_frame_info+57426436>
> "%emacs_dir%/share/emacs/24.3.50/etc/"
> 
> IIUC, the function call at frame 0 failed to expand the default
> directory passed to the function call at frame 1.
> 
> Now, It seems to me that the code responsible for the expansion of
>  "%emacs_dir%" is this snippet of "Fexpand_file_name":
> 
>   /* If the file name has special constructs in it,
>      call the corresponding file handler.  */
>   handler = Ffind_file_name_handler (name, Qexpand_file_name);
>   if (!NILP (handler))
>     {
>       handled_name = call3 (handler, Qexpand_file_name,
>    name, default_directory);
>       if (STRINGP (handled_name))
> return handled_name;
>       error ("Invalid handler in `file-name-handler-alist'");
>     }
> 
> But I observe that the call to "Ffind_file_name_handler" returns
> "Qnil", and therefore the expansion (the call to "call3") is not
> carried out.
> 
> Debugging inside "Ffind_file_name_handler", I see that the "for" loop
> is never entered.
> 
> Does this gives you a clue of what is failing?  If you need more info,
> just tell me what commands should I run.

You need to step further down into init_callproc.  It should correctly
initialize Vdata_directory here:

  if (data_dir == 0)
    {
      Lisp_Object tem, tem1, srcdir;

      srcdir = Fexpand_file_name (build_string ("../src/"),
				  build_string (PATH_DUMPLOADSEARCH));
      tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory);
      tem1 = Ffile_exists_p (tem);
      if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (tem1))
	{
	  Lisp_Object newdir;
	  newdir = Fexpand_file_name (build_string ("../etc/"),
				      build_string (PATH_DUMPLOADSEARCH));
	  tem = Fexpand_file_name (build_string ("GNU"), newdir);
	  tem1 = Ffile_exists_p (tem);
	  if (!NILP (tem1))
	    Vdata_directory = newdir;  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	}
    }

If that doesn't work, perhaps PATH_DUMPLOADSEARCH has the wrong value
(it comes from src/epaths.h).  If PATH_DUMPLOADSEARCH looks OK (it
should not have any %emacs_dir% in it, then look at the value of 'tem'
3 lines above the line I marked:

  (gdb) p tem
  (gdb) xtype
  (gdb) xstring

If the result of 'xstring' indeed shows the etc subdirectory of your
Emacs source tree, then perhaps the trouble happens inside
Ffile_exists_p: it should return non-nil in this case.  You can
display its result:

  (gdb) p tem1
  (gdb) xtype
  (gdb) xsymbol




  reply	other threads:[~2013-09-14 14:50 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-26 18:38 Building Emacs from a new MinGW environment Dani Moncayo
2013-08-26 19:38 ` Eli Zaretskii
2013-08-26 20:08   ` Dani Moncayo
2013-09-13 14:31     ` Dani Moncayo
2013-09-14  9:32       ` Eli Zaretskii
2013-09-14  9:41         ` Dani Moncayo
2013-09-14 10:07           ` Eli Zaretskii
2013-09-14 14:25         ` Dani Moncayo
2013-09-14 14:50           ` Eli Zaretskii [this message]
2013-09-14 15:42             ` Dani Moncayo
2013-09-14 16:10               ` Eli Zaretskii
2013-09-14 16:34                 ` Dani Moncayo
2013-09-14 17:18                   ` Eli Zaretskii
2013-09-14 19:57                     ` Dani Moncayo
2013-09-14 20:56                       ` Eli Zaretskii
2013-09-14 21:19                         ` Dani Moncayo
2013-09-14 22:30                           ` Dani Moncayo
2013-09-15  9:35                             ` Eli Zaretskii
2013-09-15  9:28                           ` Eli Zaretskii
2013-09-16 16:48                             ` Dani Moncayo
2013-09-16 17:37                               ` Eli Zaretskii
2013-09-16 19:25                                 ` Dani Moncayo
2013-09-16 19:40                                   ` Eli Zaretskii
2013-09-16 19:44                                     ` Dani Moncayo
2013-09-16 20:19                                       ` Eli Zaretskii
2013-09-17  7:16                                         ` Eli Zaretskii
2013-09-17  8:17                                           ` Dani Moncayo
2013-09-17  8:30                                             ` Eli Zaretskii
2013-09-17 16:09                                               ` Dani Moncayo
2013-09-17 16:17                                                 ` Glenn Morris
2013-09-17 17:27                                                 ` Eli Zaretskii
2013-09-17 20:29                                                   ` Dani Moncayo
2013-09-18  7:46                                                     ` Eli Zaretskii
2013-09-18  9:32                                                       ` Dani Moncayo
2013-09-18 10:00                                                         ` Eli Zaretskii
2013-09-18 10:38                                                           ` Dani Moncayo
2013-09-18 11:21                                                             ` Eli Zaretskii
2013-09-18 12:39                                                               ` Dani Moncayo
2013-09-18 12:31                                                             ` Dani Moncayo
2013-09-18 13:14                                                               ` Eli Zaretskii
2013-09-18 16:51                                                                 ` Dani Moncayo
2013-09-18 19:20                                                                   ` Eli Zaretskii
2013-09-19 22:56                                                                     ` Dani Moncayo
2013-09-20  8:14                                                                       ` Eli Zaretskii
2013-09-20  9:29                                                                         ` Andy Moreton
2013-09-20 11:08                                                                           ` Dani Moncayo
2013-09-20 11:21                                                                             ` Eli Zaretskii
2013-09-20 12:22                                                                               ` Dani Moncayo
2013-09-20 12:30                                                                                 ` Dani Moncayo
2013-09-20 13:16                                                                                   ` Eli Zaretskii
2013-09-20 13:12                                                                                 ` Eli Zaretskii
2013-09-20 14:12                                                                             ` Eli Zaretskii
2013-09-20 15:05                                                                               ` Dani Moncayo
2013-09-18 10:46                                                           ` Andy Moreton
2013-09-18 11:24                                                             ` Eli Zaretskii
2013-09-18 12:44                                                               ` Sean Sieger
2013-09-18 13:16                                                                 ` Eli Zaretskii
2013-09-18 13:19                                                                   ` Sean Sieger
2013-09-18 14:33                                                                     ` Eli Zaretskii
2013-09-18 13:21                                                               ` Andy Moreton
2013-09-18 14:45                                                                 ` Eli Zaretskii
2013-09-18 20:51                                                                   ` Andy Moreton
2013-09-19  8:45                                                         ` Eli Zaretskii
2013-09-19  8:56                                                           ` Dani Moncayo
2013-09-19  9:38                                                             ` Eli Zaretskii
2013-09-19 10:04                                                               ` Dani Moncayo
2013-09-19 10:11                                                                 ` Eli Zaretskii
2013-11-09 14:47                                                                   ` Dani Moncayo
2013-11-10 16:32                                                                     ` Dani Moncayo
2013-11-12  2:56                                                                       ` Glenn Morris

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ppsbfoe7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dmoncayo@gmail.com \
    --cc=emacs-devel@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.