unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 36828@debbugs.gnu.org, stepnem@gmail.com
Subject: bug#36828: 27.0.50; Uninstalled emacs shows installed documentation
Date: Mon, 28 Oct 2019 22:45:44 +0100	[thread overview]
Message-ID: <87a79kk0hj.fsf@telefonica.net> (raw)
In-Reply-To: <83ftjcr4gj.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Oct 2019 22:38:04 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> We have plenty to choose (lib-src/emacsclient, for instance) but IMO if
>> Makefile exists in installation-directory that's a sure sign.
>
> If it is not nil, and the test of equality between srcdir and
> invocation-directory fails, then you already know that you are running
> uninstalled, but outside of the src directory.  Right?  Then you don't
> need looking for Makefile or anything else, right?

Indeed, this simple patch does the trick:

modified   src/callproc.c
@@ -1567,7 +1567,7 @@ init_callproc (void)
 
       tem = Fexpand_file_name (build_string ("NEWS"), Vdata_directory);
       if (!NILP (Fequal (srcdir, Vinvocation_directory))
-	  || NILP (Ffile_exists_p (tem)))
+	  || NILP (Ffile_exists_p (tem)) || !NILP (Vinstallation_directory))
 	{
 	  Lisp_Object newdir;
 	  newdir = Fexpand_file_name (build_string ("../etc/"), lispdir);

But then we can also get rid of

!NILP (Fequal (srcdir, Vinvocation_directory))

because that condition should always be true when Vinvocation_directory
is non-nil, right?

Actually, we can remove the `if' altogether because if we enter

  if (data_dir == 0)
    {

then we know that this is a non-installed emacs and even if we end
assigning a non-existent directory to Vdata_directory within that `if'
(for reasons I can't imagine) it is not a regression: Vdata_directory
would contain a wrong directory anyways.

All that function looks unnecessarily complex to me. It comes from a
long time ago and it smells like it didn't adapt to the availability of
new variables. I'm a bit reluctant to adding yet another condition and
cause future hackers to scratch their heads trying to figure out whas is
about with the redundant stuff.

Said that, if you don't want me to touch other parts of the function and
just add the new condition, ok. Later I'll try to adapt C-h i to show
the non-installed `dir' file.





  reply	other threads:[~2019-10-28 21:45 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-28 15:07 bug#36828: 27.0.50; Uninstalled emacs shows installed documentation Óscar Fuentes
2019-07-28 15:30 ` Eli Zaretskii
2019-07-28 15:56   ` Óscar Fuentes
2019-07-28 16:50     ` Eli Zaretskii
2019-07-29  0:36       ` Óscar Fuentes
2019-07-29 12:13         ` Štěpán Němec
2019-07-29 14:25           ` Óscar Fuentes
2019-07-29 14:41             ` Štěpán Němec
2019-07-29 14:38           ` Eli Zaretskii
2019-07-29 14:47             ` Štěpán Němec
2019-07-29 15:11               ` Eli Zaretskii
2019-07-29 15:20                 ` Eli Zaretskii
2019-07-29 16:08                 ` Štěpán Němec
2019-07-29 16:57                   ` Eli Zaretskii
2019-07-29 17:44                     ` Štěpán Němec
2019-07-29 18:13                       ` Eli Zaretskii
2019-07-29 18:33                         ` Štěpán Němec
2019-07-29 18:48                           ` Eli Zaretskii
2019-07-29 19:20                             ` Štěpán Němec
2019-07-29 19:31                               ` Eli Zaretskii
2019-07-29 18:42                         ` Óscar Fuentes
2019-07-29 19:26                           ` Eli Zaretskii
2019-07-29 21:09                             ` Óscar Fuentes
2019-07-30 15:08                               ` Eli Zaretskii
2019-08-07 14:25                                 ` Eli Zaretskii
2019-08-07 15:00                                   ` Óscar Fuentes
2019-08-07 15:03                                     ` Eli Zaretskii
2019-10-26  3:16                                 ` Óscar Fuentes
2019-10-26  8:51                                   ` Eli Zaretskii
2019-10-26 11:55                                     ` Óscar Fuentes
2019-10-26 12:29                                       ` Eli Zaretskii
2019-10-26 13:27                                         ` Óscar Fuentes
2019-10-26 13:45                                           ` Eli Zaretskii
2019-10-26 20:05                                             ` Óscar Fuentes
2019-10-26 20:21                                               ` Eli Zaretskii
2019-10-26 20:40                                                 ` Óscar Fuentes
2019-10-27  5:13                                                   ` Eli Zaretskii
2019-10-27 23:50                                                     ` Óscar Fuentes
2019-10-28 15:58                                                       ` Eli Zaretskii
2019-10-28 19:40                                                         ` Óscar Fuentes
2019-10-28 20:03                                                           ` Eli Zaretskii
2019-10-28 20:21                                                             ` Óscar Fuentes
2019-10-28 20:38                                                               ` Eli Zaretskii
2019-10-28 21:45                                                                 ` Óscar Fuentes [this message]
2019-10-29 11:56                                                                   ` Eli Zaretskii
2019-11-02 17:08                                                                     ` Óscar Fuentes
2019-10-29  3:09                                                         ` Richard Stallman
2019-10-26  3:33                                 ` Óscar Fuentes

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=87a79kk0hj.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=36828@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=stepnem@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).