From 1449fa1d08009f384f1867aecf1aa8a46220dcc4 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 6 Feb 2012 21:43:39 +0800 Subject: * doc.c (store_function_docstring): Avoid applying docstring of alias to base function. Fixes: debbugs:2603 --- src/doc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/doc.c') diff --git a/src/doc.c b/src/doc.c index 7bdb8c658b0..ad2c667e771 100644 --- a/src/doc.c +++ b/src/doc.c @@ -502,10 +502,12 @@ aren't strings. */) /* 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 sym, 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 = XSYMBOL (sym)->function; /* The type determines where the docstring is stored. */ -- cgit v1.2.1 From 4a6c7bb8744bbbadf3b3b0be8660a2100ae3e7aa Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 7 Feb 2012 00:53:51 +0800 Subject: * doc.c (store_function_docstring): Fix last change. --- src/doc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/doc.c') diff --git a/src/doc.c b/src/doc.c index ad2c667e771..02db4dde072 100644 --- a/src/doc.c +++ b/src/doc.c @@ -502,12 +502,12 @@ aren't strings. */) /* Scanning the DOC files and placing docstring offsets into functions. */ static void -store_function_docstring (Lisp_Object sym, EMACS_INT offset) +store_function_docstring (Lisp_Object obj, EMACS_INT offset) /* Use EMACS_INT because we get offset from pointer subtraction. */ { /* Don't use indirect_function here, or defaliases will apply their docstrings to the base functions (Bug#2603). */ - Lisp_Object fun = XSYMBOL (sym)->function; + Lisp_Object fun = SYMBOLP (obj) ? XSYMBOL (obj)->function : obj; /* The type determines where the docstring is stored. */ -- cgit v1.2.1