Subject: Re: bug#7167: 23.2; w32-shell-execute doc
From: Eli Zaretskii <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked], [email-masked]
Date: Fri, 08 Oct 2010 11:52:47 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Thu, 07 Oct 2010 20:12:47 +0200
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> 
> > From: Juanma Barranquero <[email-masked]>
> > Date: Thu, 7 Oct 2010 12:15:55 +0200
> > Cc: Sean Sieger <[email-masked]>, [email-masked]
> > 
> > [Sean, I've Cc:ed you because you're doing binary tarballs now]
> > 
> > On Thu, Oct 7, 2010 at 05:57, Christoph <[email-masked]> wrote:
> > 
> > > Juanma, let me know if I can help troubleshoot this.
> > 
> > I think it is an issue with the binary distribution of Emacs 23.2 for
> > Windows, not with 23.2 per se, because I have my own build of it and
> > the problem is not present.
> > 
> > Likely the fix will simply be to rebuild the official binary
> > distribution of 23.2.
> 
> Not sure, because my binary, which I built myself, also has this
> problem.
> 
> Will try to investigate tomorrow.

Found the problem.  There's nothing wrong with the Windows build
system per se.  The problem is that emacs-23.2 tarball comes with a
src/buildobj.h from a Unix system where it was tarred, which is
baaaaad, and not only on Windows.  This causes Make not to create
src/buildobj.h as suitable for the actual build on the target
platform, and the rest is history.

I've just installed a fix in the emacs-23 branch (revno 100091 and a
followup change in 100092) to exclude this file from the tarball.

To fix this locally, just remove src/buildobj.h and rebuild Emacs.

While at that, I would suggest that this code in help-fns.el:

      (let ((file (catch 'loop
		    (while t
		      (let ((pnt (search-forward (concat "" name "\n"))))
			(re-search-backward "S\\(.*\\)")
			(let ((file (match-string 1)))
			  (if (member file build-files)
			      (throw 'loop file)
			    (goto-char pnt))))))))
	(if (string-match "^ns.*\\(\\.o\\|obj\\)\\'" file)
	    (setq file (replace-match ".m" t t file 1))
	  (if (string-match "\\.\\(o\\|obj\\)\\'" file)
	      (setq file (replace-match ".c" t t file))))
	(if (string-match "\\.\\(c\\|m\\)\\'" file)
	    (concat "src/" file)
	  file)))))

be made smarter wrt the error message it displays when the function or
variable it looks for is found in etc/DOC, but the file in which it is
defined is not in build-files.  (This happens when you click or type
RET on the link to the source file where the function is defined.)
Currently, the error message, which comes from search-forward, is
quite cryptic for a naive user:

    Search failed: "^_Fw32-shell-execute
    "

It should at least mention the fact that the problem could be with
build-files, or, better, say that w32-shell-execute's definition is in
a file that is not in build-files.  Volunteers are welcome to make
this improvement.