From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.bugs Subject: bug#6497: documentation `indirect-function', `symbol-function' do not enumerate return value type Date: Tue, 22 Jun 2010 19:42:57 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1277251158 17975 80.91.229.12 (22 Jun 2010 23:59:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Jun 2010 23:59:18 +0000 (UTC) To: 6497@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 23 01:59:16 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ORDN2-0000Gg-Dg for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Jun 2010 01:59:14 +0200 Original-Received: from localhost ([127.0.0.1]:43154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORDMw-0004ZS-Fe for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Jun 2010 19:59:06 -0400 Original-Received: from [140.186.70.92] (port=49404 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORDMq-0004XF-Mg for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2010 19:59:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORDMp-00036j-Ag for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2010 19:59:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56662) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORDMp-00036e-96 for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2010 19:58:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1ORD8M-0003qj-HA; Tue, 22 Jun 2010 19:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: MON KEY Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Jun 2010 23:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6497 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.127725018714786 (code B ref -1); Tue, 22 Jun 2010 23:44:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Jun 2010 23:43:07 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORD7S-0003qR-VF for submit@debbugs.gnu.org; Tue, 22 Jun 2010 19:43:07 -0400 Original-Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORD7Q-0003q5-Oy for submit@debbugs.gnu.org; Tue, 22 Jun 2010 19:43:05 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:50773) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ORD7M-0001ZE-Tc for submit@debbugs.gnu.org; Tue, 22 Jun 2010 19:43:00 -0400 Original-Received: from [140.186.70.92] (port=51685 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORD7L-00028G-OI for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2010 19:43:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORD7K-00019D-HG for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2010 19:42:59 -0400 Original-Received: from mail-yw0-f192.google.com ([209.85.211.192]:52737) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORD7K-000197-Eu for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2010 19:42:58 -0400 Original-Received: by ywh30 with SMTP id 30so4524258ywh.24 for ; Tue, 22 Jun 2010 16:42:57 -0700 (PDT) Original-Received: by 10.151.94.1 with SMTP id w1mr7100586ybl.72.1277250177242; Tue, 22 Jun 2010 16:42:57 -0700 (PDT) Original-Received: by 10.150.181.11 with HTTP; Tue, 22 Jun 2010 16:42:57 -0700 (PDT) X-Google-Sender-Auth: yId8E5fMr2OBhG9rmbopuJxlYtw X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 22 Jun 2010 19:44:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37958 Archived-At: documentation of function `indirect-function' and `symbol-function' do not adequately enumerate all of the types of return values (nor does it even make mention of them) and docstring of `indirect-function' too closeley mirrors that of `indirect-variable'. Additionally, the value of its argument OBJECT does not reflect that of the `symbol-function' arg SYMBOL it should because its return value more closely resembles that of `symbol-function' than `indirect-variable'. ,---- (documentation 'indirect-variable) | | Return the variable at the end of OBJECT's variable chain. | If OBJECT is a symbol, follow all variable indirections and return the | final variable. If OBJECT is not a symbol, just return it. Signal a | cyclic-variable-indirection error if there is a loop in the variable | chain of symbols. | | (fn OBJECT) | `---- ,---- (documentation 'indirect-function) | | Return the function at the end of OBJECT's function chain. | If OBJECT is not a symbol, just return it. Otherwise, follow all | function indirections to find the final function binding and return | it. If the final symbol in the chain is unbound, signal a | void-function error. Optional arg NOERROR non-nil means to return nil | instead of signalling. Signal a cyclic-function-indirection error if | there is a loop in the function chain of symbols. | | (fn OBJECT &optional NOERROR) | `---- ,---- (documentation 'symbol-function) | | Return SYMBOL's function definition. Error if that is void. | | (fn SYMBOL) | `---- Given the similarity of docstrings for `indirect-variable' and `indirect-function' it is possible for a user to assume the quoting rules of `indirect-variable' apply as well to `indirect-function'. In the following example `indirect-variable' returns regardless of whether the arg OBJECT is quoted: (indirect-variable font-lock-comment-face) (indirect-variable 'font-lock-comment-face) Whereas, in the following evaluation of `indirect-function' the first use of an arg as unquoted symbol signals an error. (indirect-function lisp-mode-variables) (indirect-function 'lisp-mode-variables) This problem isn't an issue were it not for the close resemblance of the `indirect-function' `indirect-variable' docstrings. More troublesome though is that neither `indirect-function' nor `symbol-function' document their return values in any meaningful way: Following is an attempt at fleshing out those return values not specified by the existing docstrings (substitute OBJECT for SYMBOL accordingly): ,---- | | If OBJECT satisfies the predicate `subrp' return an unreadable | object of the form: | | # | | If OBJECT is an "autuload object" type its return value is a list of | values suitable for use as arguments to the `autoload' function and | of the form: | | (autoload "" ) | | Note, the element for OBJECT's return value as "autoload | object" is nil for a function and `macro' or `t' for a macro. | | If value of OBJECT is a "byte-code function" type, e.g. it would | satisfy the predicate `byte-code-function-p', and OBJECT is not a | "Lisp macro" its value is returned as an unreadable vector of the | form: | | #[ ... ] | | if OBJECT is a "Lisp macro" in it value is returned as a cons of the | form: | | (macro . #[ ... ]) | `---- -- /s_P\