GNU bug report logs - #8285
24.0.50; doc of `imenu-generic-expression' and `imenu--generic-function'

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Fri, 18 Mar 2011 16:11:02 UTC

Severity: minor

Found in version 24.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8285 in the body.
You can then email your comments to 8285 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8285; Package emacs. (Fri, 18 Mar 2011 16:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 18 Mar 2011 16:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.50;
	doc of `imenu-generic-expression' and `imenu--generic-function'
Date: Fri, 18 Mar 2011 09:09:47 -0700
1. In the doc string of `imenu--generic-function', these terms are
completely undefined and unexplained: POSITION-MARKER, INDEX-NAME,
FUNCTION, ARGUMENTS, INDEX-POSITION, and INDEX-ALIST.  Please
define/explain these undefined terms.  If you don't understand the
problem, change these names to UU, VV, WW, XX, YY, and ZZ, and see if
you understand the doc.
 
2. Seems a bit odd that this internal-only function (judging by its
name, which contains `--') has all of the important doc for
`imenu-generic-expression'.  In the past, the latter's doc string
described the format.  Now the format is described (only) in the doc
string of an internal function.  This state, which seems inappropriate,
was introduced in Emacs 22.
 

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-03-07 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt --cflags
-Ic:/imagesupport/include'
 





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8285; Package emacs. (Fri, 18 Mar 2011 16:42:01 GMT) Full text and rfc822 format available.

Message #8 received at 8285 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <8285 <at> debbugs.gnu.org>
Subject: RE: bug#8285: 24.0.50;
	doc of `imenu-generic-expression' and `imenu--generic-function'
Date: Fri, 18 Mar 2011 09:41:40 -0700
Even worse: In emacs -Q, `C-h v imenu-generic-expression' shows you the
variable's doc, but that just refers you to `imenu--generic-function' (see
original bug report).  And that function has not been loaded, so (a) its name is
not linked to any doc and (2) `C-h f' does not accept its name.  Result, `C-h v
imenu-generic-expression' gives you no info about the format of the variable
value.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8285; Package emacs. (Fri, 18 Mar 2011 18:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 8285 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 8285 <at> debbugs.gnu.org
Subject: Re: bug#8285: 24.0.50;
	doc of `imenu-generic-expression' and `imenu--generic-function'
Date: Fri, 18 Mar 2011 20:22:46 +0200
> From: "Drew Adams" <drew.adams <at> oracle.com>
> Date: Fri, 18 Mar 2011 09:09:47 -0700
> Cc: 
> 
> If you don't understand the problem, change these names to UU, VV,
> WW, XX, YY, and ZZ, and see if you understand the doc.

This argument is bogus: names of symbols can and should bear
significant semantic information that helps to understand their roles,
and if that information is descriptive enough, there's no need for any
further definitions.

As an extreme example, consider:

 (defun call-func (function &rest arguments)
   "Call FUNCTION with ARGUMENTS."

I see no need to explain the arguments in this example.

I'm not saying that the doc string in question could not use some
improvement.  But since imenu is about creating indices of functions
in a program source file, at least FUNCTION and ARGUMENTS do not need
any further explanations, IMO.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8285; Package emacs. (Fri, 18 Mar 2011 18:57:02 GMT) Full text and rfc822 format available.

Message #14 received at 8285 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>
Cc: 8285 <at> debbugs.gnu.org
Subject: RE: bug#8285: 24.0.50;
	doc of `imenu-generic-expression' and `imenu--generic-function'
Date: Fri, 18 Mar 2011 11:56:38 -0700
> > If you don't understand the problem, change these names to UU, VV,
> > WW, XX, YY, and ZZ, and see if you understand the doc.
> 
> This argument is bogus: names of symbols can and should bear
> significant semantic information that helps to understand their roles,
> and if that information is descriptive enough, there's no need for any
> further definitions.

This doc is bogus.  Using good names helps - always.  It is typically not
sufficient, including in this case.

> As an extreme example, consider:
>  (defun call-func (function &rest arguments)
>    "Call FUNCTION with ARGUMENTS."

Sorry, not interested in your "extreme example".  Speak to the specific case
reported, please.  The meanings of the names I cited are _not_ self-evident.

> I see no need to explain the arguments in this example.

Which example?  Yours?  Agreed.  But irrelevant.
Or the example reported in this bug report?

This report is not immediately about explaining the argument to
`imenu--generic-function'.  That argument, PATTERNS, _is_ described.

But it is described in terms of undefined terms, so it is not described well
enough.  It is the explanations of those terms that are missing, not a
description of the argument, PATTERNS.

> I'm not saying that the doc string in question could not use some
> improvement.  But since imenu is about creating indices of functions
> in a program source file,

Oh no it is NOT.  Imenu is used for indexing _lots_ of things besides just
functions: variables, types, keys,...  Nearly anything you want, in fact.

> at least FUNCTION and ARGUMENTS do not need
> any further explanations, IMO.

If their meanings are obvious to you then surely you can explain what they are.
Please add the explanation to the doc string so the rest of us can understand.

What are they?  Sure, from their names one can understand that they refer to
some function and some arguments (maybe even arguments to function FUNCTION),
respectively.  But which function?  Which arguments to which function?

What's more (forgot to mention), we see this: "with FUNCTION and ARGUMENTS
copied from PATTERNS" as the explanation (!) of these two terms.  PATTERNS is
the argument to `imenu--generic-function'.

But how are FUNCTION and ARGUMENTS "copied" from PATTERNS?  What does that even
mean?  The doc already describes the elements of alist PATTERNS, and FUNCTION
and ARGUMENTS occur inside one type of element.  How are they "copied" from
PATTERNS?

None of the terms I mentioned are explained.  The meanings of none of them are
clear based only on their names.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8285; Package emacs. (Thu, 26 Aug 2021 15:51:02 GMT) Full text and rfc822 format available.

Message #17 received at 8285 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 8285 <at> debbugs.gnu.org
Subject: Re: bug#8285: 24.0.50; doc of `imenu-generic-expression' and
 `imenu--generic-function'
Date: Thu, 26 Aug 2021 17:49:49 +0200
"Drew Adams" <drew.adams <at> oracle.com> writes:

> 1. In the doc string of `imenu--generic-function', these terms are
> completely undefined and unexplained: POSITION-MARKER, INDEX-NAME,
> FUNCTION, ARGUMENTS, INDEX-POSITION, and INDEX-ALIST.  Please
> define/explain these undefined terms.

Eli answered this one...

> 2. Seems a bit odd that this internal-only function (judging by its
> name, which contains `--') has all of the important doc for
> `imenu-generic-expression'.  In the past, the latter's doc string
> described the format.  Now the format is described (only) in the doc
> string of an internal function.  This state, which seems inappropriate,
> was introduced in Emacs 22.

This was fixed in:

commit b7ccbdc2e39ff834a03a7f30516b71cd98e84a44
Author:     Chong Yidong <cyd <at> gnu.org>
AuthorDate: Sun Aug 5 22:14:54 2012 +0800

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 8285 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 26 Aug 2021 15:51:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 24 Sep 2021 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 347 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.