From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#36828: 27.0.50; Uninstalled emacs shows installed documentation Date: Tue, 29 Oct 2019 13:56:58 +0200 Message-ID: <83tv7rpxx1.fsf@gnu.org> 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> <87a79kk0hj.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="209137"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36828@debbugs.gnu.org, stepnem@gmail.com To: =?UTF-8?Q?=C3=93scar?= Fuentes Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 29 13:04:57 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 1iPQF7-000sBx-AX for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Oct 2019 13:04:57 +0100 Original-Received: from localhost ([::1]:55890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPQF6-0005da-71 for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Oct 2019 08:04:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42179) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPQ8R-000603-1R for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2019 07:58:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPQ8P-0006e9-SF for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2019 07:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38150) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iPQ8P-0006e2-OC for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2019 07:58:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iPQ8P-0006rA-LC for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2019 07:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Oct 2019 11:58:01 +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.157235023326299 (code B ref 36828); Tue, 29 Oct 2019 11:58:01 +0000 Original-Received: (at 36828) by debbugs.gnu.org; 29 Oct 2019 11:57:13 +0000 Original-Received: from localhost ([127.0.0.1]:46971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPQ7d-0006q6-C8 for submit@debbugs.gnu.org; Tue, 29 Oct 2019 07:57:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPQ7c-0006pv-1t for 36828@debbugs.gnu.org; Tue, 29 Oct 2019 07:57:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iPQ7W-0006EA-Ds; Tue, 29 Oct 2019 07:57:06 -0400 Original-Received: from [176.228.60.248] (port=3578 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iPQ7S-0001va-VY; Tue, 29 Oct 2019 07:57:03 -0400 In-reply-to: <87a79kk0hj.fsf@telefonica.net> (message from =?UTF-8?Q?=C3=93scar?= Fuentes on Mon, 28 Oct 2019 22:45:44 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:170363 Archived-At: > From: Óscar Fuentes > Cc: stepnem@gmail.com, 36828@debbugs.gnu.org > Date: Mon, 28 Oct 2019 22:45:44 +0100 > > 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? We could, but I'd like to leave it for now, with a FIXME comment saying whether this condition is necessary. The reason is that I'm not sure whether there aren't any additional use cases which this condition allows. > 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. Sorry, I don't follow: data_dir being NULL just means EMACSDATA is not defined in the environment. If EMACSDATA is defined, its value tramps everything else, and we still want to support that. How is EMACSDATA related to the issue at hand? it's a completely separate use case. > 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. I don't think I agree. That function calculates values of several variables: exec-path exec-directory doc-directory data-directory shell-file-name shared-game-score-directory It also emits warnings if exec-directory or data-directory are inaccessible. Each of the above variables takes just a few lines of code to compute, so I don't think I see the complexity, let alone an unnecessary one. Can you elaborate on what looks redundant there, and how would you suggest to use the available new variables? > 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. Yes, let's for now make a simple and safe change. Thanks.