all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#31962: 27.0; imenu.el constructs - names and doc
@ 2018-06-25  1:51 Drew Adams
  2018-06-30  9:28 ` Eli Zaretskii
  2019-10-19  1:09 ` Stefan Kangas
  0 siblings, 2 replies; 3+ messages in thread
From: Drew Adams @ 2018-06-25  1:51 UTC (permalink / raw)
  To: 31962

1. `imenu--generic-function' should not have a double-hyphen in its
name.  It is the main function in the library, and it is explicitly
referenced by multiple doc strings in the file, including that of a user
option (`imenu-generic-skip-comments-and-strings') and that of the
principal configuration variable (`imenu-generic-expression'), which is
defined per mode.  The function should be renamed to
`imenu-generic-function', and the old name should be deprecated.

2. The doc string of `imenu--generic-function' says this, with zero
description of INDEX-NAME INDEX-POSITION FUNCTION and ARGUMENTS:

  The return value is an alist of the form
   (INDEX-NAME . INDEX-POSITION)
  or
   (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...)
  The return value may also consist of nested index alists like:
   (INDEX-NAME . INDEX-ALIST)
  depending on PATTERNS.

Each of those pieces of the return value should be specified, not just
named.

3. Similarly, other functions and variables should be renamed to use a
single, not a double, hyphen, starting with `imenu--sort-by-name' and
`imenu--index-alist'.  I don't argue now that NO functions wnd variables
in the library should have names declaring that they are internal, but a
better judgment call is in order.

They too are referenced from other doc strings.  For example, the doc
string of `imenu-sort-function' says to look at `imenu--sort-by-name'
for an example of a sort function.  And the doc string of autoloaded
variable `imenu-create-index-function' refers to `imenu--index-alist'
for the format of the buffer index alist.

We are documenting the structure and behavior of Imenu by referring to
"internal" variables and functions.  That makes no sense - or rather, it
points out how silly was declaring these to be "internal".



In GNU Emacs 27.0.50 (build 3, x86_64-w64-mingw32)
 of 2018-03-21
Repository revision: e70d0c9e66d7a8609450b2889869d16aeb0363b5
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install -C 'CFLAGS=-O2 -static -g3''





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-19  1:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-25  1:51 bug#31962: 27.0; imenu.el constructs - names and doc Drew Adams
2018-06-30  9:28 ` Eli Zaretskii
2019-10-19  1:09 ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.