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: Sat, 26 Oct 2019 05:16:01 +0200 Message-ID: <87eez0kxhq.fsf@telefonica.net> References: <87lfwitcyf.fsf@telefonica.net> <83blxekwhz.fsf@gnu.org> <87ef2ataoj.fsf@telefonica.net> <837e82kssb.fsf@gnu.org> <87a7cxu16y.fsf@telefonica.net> <87h875qbrv.fsf@gmail.com> <83r268kiss.fsf@gnu.org> <875znkrj6y.fsf@gmail.com> <83mugwkh8u.fsf@gnu.org> <871ry8rfge.fsf@gmail.com> <83k1c0kcbw.fsf@gnu.org> <87wog0pwg6.fsf@gmail.com> <83ftmok8tt.fsf@gnu.org> <874l34smwx.fsf@telefonica.net> <83blxck5gf.fsf@gnu.org> <87v9vkr1je.fsf@telefonica.net> <83wofzimq8.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="264292"; 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 Sat Oct 26 05:17:13 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 1iOCZk-0016Vc-3E for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Oct 2019 05:17:12 +0200 Original-Received: from localhost ([::1]:38078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOCZi-0005QE-9R for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Oct 2019 23:17:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33776) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOCZb-0005IX-Hz for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 23:17:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOCZa-0001rq-Fg for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 23:17:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58999) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOCZa-0001rm-Ch for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 23:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iOCZa-0005Y9-57 for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 23:17: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: Sat, 26 Oct 2019 03:17: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.157205977221266 (code B ref 36828); Sat, 26 Oct 2019 03:17:02 +0000 Original-Received: (at 36828) by debbugs.gnu.org; 26 Oct 2019 03:16:12 +0000 Original-Received: from localhost ([127.0.0.1]:39587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOCYm-0005Wv-8H for submit@debbugs.gnu.org; Fri, 25 Oct 2019 23:16:12 -0400 Original-Received: from relayout04.e.movistar.es ([86.109.101.204]:33727 helo=relayout04-redir.e.movistar.es) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOCYj-0005Wg-DO for 36828@debbugs.gnu.org; Fri, 25 Oct 2019 23:16:10 -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 relayout04.e.movistar.es (Postfix) with ESMTPSA id 470R2V05gVz12G3; Sat, 26 Oct 2019 05:16:01 +0200 (CEST) In-Reply-To: <83wofzimq8.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 30 Jul 2019 18:08:31 +0300") 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 relayout04 X-TnetOut-MsgID: 470R2V05gVz12G3.A9235 X-TnetOut-SpamCheck: no es spam, Unknown X-TnetOut-From: ofv@wanadoo.es X-TnetOut-Watermark: 1572664563.07716@I5oPT7CbZE6F1HFbG/V5VQ 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:170173 Archived-At: Sorry for the long delay. Eli Zaretskii writes: >> >> M-x describe-function shows the docstrings of the Emacs I'm executing, >> > >> > How do you know? What is the value of doc-directory? >> >> /home/oscar/dev/emacs/stable/build/etc/ >> >> The installed version is in /usr/local. > > Hmm... then this is not the use case I had in mind, and some other > factor is at work here. Your use case is supposed to be handled by > this fragment from init_callproc: What follows is the result of a debug session for the chunk of code you indicated. if (data_dir == 0) { Lisp_Object tem, srcdir; Lisp_Object lispdir = Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0)); srcdir = Fexpand_file_name (build_string ("../src/"), lispdir); tem = Fexpand_file_name (build_string ("NEWS"), Vdata_directory); Vdata_directory is "/usr/local/share/emacs/27.0.50/etc/" tem is "/usr/local/share/emacs/27.0.50/etc/NEWS" srcdir is "/home/oscar/dev/emacs/emacs/src/" Vinvocation_directory is "/home/oscar/dev/emacs/debug/src/" if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (Ffile_exists_p (tem))) { Execution never enters this block, because srcdir != Vinvocation_directory (because this is an out-of-source build) and "/usr/local/share/emacs/27.0.50/etc/NEWS" exists (because emacs was installed on the past). Lisp_Object newdir; newdir = Fexpand_file_name (build_string ("../etc/"), lispdir); tem = Fexpand_file_name (build_string ("NEWS"), newdir); if (!NILP (Ffile_exists_p (tem))) Vdata_directory = newdir; } } The code basically ignores the local, non-installed NEWS when there is an installed NEWS and we are executing from an out-of-source build tree. I propose the reverse: unconditionally test for the non-installed NEWS and adjust Vdata_directory if it exists. Something like this (untested for the installed emacs case): modified src/callproc.c @@ -1560,21 +1560,13 @@ init_callproc (void) source directory. */ if (data_dir == 0) { - Lisp_Object tem, srcdir; + Lisp_Object tem, etcdir; Lisp_Object lispdir = Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0)); - srcdir = Fexpand_file_name (build_string ("../src/"), lispdir); - - tem = Fexpand_file_name (build_string ("NEWS"), Vdata_directory); - if (!NILP (Fequal (srcdir, Vinvocation_directory)) - || NILP (Ffile_exists_p (tem))) - { - Lisp_Object newdir; - newdir = Fexpand_file_name (build_string ("../etc/"), lispdir); - tem = Fexpand_file_name (build_string ("NEWS"), newdir); - if (!NILP (Ffile_exists_p (tem))) - Vdata_directory = newdir; - } + etcdir = Fexpand_file_name (build_string ("../etc/"), lispdir); + tem = Fexpand_file_name (build_string ("NEWS"), etcdir); + if (!NILP (Ffile_exists_p (tem))) + Vdata_directory = newdir; } if (!will_dump_p ())