From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=C3=93scar?= Fuentes Newsgroups: gmane.emacs.bugs Subject: bug#36828: 27.0.50; Uninstalled emacs shows installed documentation Date: Mon, 28 Oct 2019 22:45:44 +0100 Message-ID: <87a79kk0hj.fsf@telefonica.net> References: <87lfwitcyf.fsf@telefonica.net> <874l34smwx.fsf@telefonica.net> <83blxck5gf.fsf@gnu.org> <87v9vkr1je.fsf@telefonica.net> <83wofzimq8.fsf@gnu.org> <87eez0kxhq.fsf@telefonica.net> <83v9sbvqhl.fsf@gnu.org> <874kzvlo0w.fsf@telefonica.net> <838sp7vgfl.fsf@gnu.org> <87zhhnk57f.fsf@telefonica.net> <83y2x7tyb1.fsf@gnu.org> <87v9sbjms0.fsf@telefonica.net> <83d0ejtfzu.fsf@gnu.org> <87r22zjl44.fsf@telefonica.net> <835zkau5y6.fsf@gnu.org> <87mudlkato.fsf@telefonica.net> <838sp4svy9.fsf@gnu.org> <87imo8k6b0.fsf@telefonica.net> <83k18or62j.fsf@gnu.org> <87eeywk4e6.fsf@telefonica.net> <83ftjcr4gj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="183766"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 36828@debbugs.gnu.org, stepnem@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 28 22:47:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iPCr5-000lek-Nx for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Oct 2019 22:47:15 +0100 Original-Received: from localhost ([::1]:44180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPCr4-0007Bl-0v for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Oct 2019 17:47:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46040) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPCpv-0005vR-J9 for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 17:46:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPCpu-0001nI-Bl for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 17:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37646) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iPCpu-0001n4-7v for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 17:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iPCpu-0006Lr-3T for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 17:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C3=93scar?= Fuentes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Oct 2019 21:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36828 X-GNU-PR-Package: emacs Original-Received: via spool by 36828-submit@debbugs.gnu.org id=B36828.157229915524396 (code B ref 36828); Mon, 28 Oct 2019 21:46:02 +0000 Original-Received: (at 36828) by debbugs.gnu.org; 28 Oct 2019 21:45:55 +0000 Original-Received: from localhost ([127.0.0.1]:46467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPCpm-0006LP-Sg for submit@debbugs.gnu.org; Mon, 28 Oct 2019 17:45:55 -0400 Original-Received: from relayout02.e.movistar.es ([86.109.101.202]:52517 helo=relayout02-redir.e.movistar.es) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPCpl-0006LA-17 for 36828@debbugs.gnu.org; Mon, 28 Oct 2019 17:45:53 -0400 Original-Received: from sky (238.red-79-144-110.dynamicip.rima-tde.net [79.144.110.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout02.e.movistar.es (Postfix) with ESMTPSA id 4727Z12L4FzdZn3; Mon, 28 Oct 2019 22:45:45 +0100 (CET) In-Reply-To: <83ftjcr4gj.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Oct 2019 22:38:04 +0200") X-CTCH-Score: 0.000 X-CTCH-ScoreCust: 0.000 X-TnetOut-Country: IP: 79.144.110.238 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout02 X-TnetOut-MsgID: 4727Z12L4FzdZn3.A1D82 X-TnetOut-SpamCheck: no es spam, Unknown X-TnetOut-From: ofv@wanadoo.es X-TnetOut-Watermark: 1572903946.35862@g4lbD9EqtpiYkFubDT3xTA 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: 209.51.188.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:170330 Archived-At: Eli Zaretskii 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.