GNU bug report logs -
#36828
27.0.50; Uninstalled emacs shows installed documentation
Previous Next
Reported by: Óscar Fuentes <ofv <at> wanadoo.es>
Date: Sun, 28 Jul 2019 15:08:01 UTC
Severity: minor
Found in version 27.0.50
Done: Óscar Fuentes <ofv <at> wanadoo.es>
Bug is archived. No further changes may be made.
Full log
Message #90 received at 36828 <at> debbugs.gnu.org (full text, mbox):
Sorry for the long delay.
Eli Zaretskii <eliz <at> gnu.org> 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 ())
This bug report was last modified 5 years and 280 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.