/* Record indices of function doc strings stored in a file.
- Copyright (C) 1985-1986, 1993-1995, 1997-2011
+ Copyright (C) 1985-1986, 1993-1995, 1997-2012
Free Software Foundation, Inc.
This file is part of GNU Emacs.
If it is relative, combine it with Vdoc_directory. */
tem = Ffile_name_absolute_p (file);
+ file = ENCODE_FILE (file);
if (NILP (tem))
{
- minsize = SCHARS (Vdoc_directory);
+ Lisp_Object docdir = ENCODE_FILE (Vdoc_directory);
+ minsize = SCHARS (docdir);
/* sizeof ("../etc/") == 8 */
if (minsize < 8)
minsize = 8;
name = (char *) alloca (minsize + SCHARS (file) + 8);
- strcpy (name, SSDATA (Vdoc_directory));
+ strcpy (name, SSDATA (docdir));
strcat (name, SSDATA (file));
}
else
if (!NILP (Vpurify_flag))
{
/* Preparing to dump; DOC file is probably not installed.
- So check in ../etc. */
+ So check in ../etc. */
strcpy (name, "../etc/");
strcat (name, SSDATA (file));
/* Scanning the DOC files and placing docstring offsets into functions. */
static void
-store_function_docstring (Lisp_Object fun, EMACS_INT offset)
+store_function_docstring (Lisp_Object obj, EMACS_INT offset)
/* Use EMACS_INT because we get offset from pointer subtraction. */
{
- fun = indirect_function (fun);
+ /* Don't use indirect_function here, or defaliases will apply their
+ docstrings to the base functions (Bug#2603). */
+ Lisp_Object fun = SYMBOLP (obj) ? XSYMBOL (obj)->function : obj;
/* The type determines where the docstring is stored. */