emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Systematic implicit aliases for option variables


From: Drew Adams
Subject: RE: [External] : Systematic implicit aliases for option variables
Date: Tue, 1 Mar 2022 17:43:13 +0000

> `occur' is an alias for the command `list-matching-lines'.
> `occur' may be used by more people than `list-matching-lines'.

Definitely.  Just as more users might think
of `flush-lines' and `keep-lines' than
`delete-matching-lines' and
`delete-non-matching-lines'.

> There are options named `list-matching-lines-*', but people who know
> the command as `occur' may not think to look for options with those
> names.
> 
> Does it make sense to define a command `customize-command' which takes
> a command name as argument and shows you the options that are
> pertinent to customizing that command?

Not sure.  The options relevant for some
commands can be diverse.

Also, is this only relevance for "customizing
that command", by which I guess you mean
options that change its behavior?  Or does it
include relevance in other senses?

> If you give it `occur', it would recognize that that is an alias
> for `list-matching-lines', and show you the options pertinent to
> `list-matching-lines'.  You wouldn't need to know that `occur'
> is an alias.

That would come for free, I think, if we just
aliased those options (like we do the commands),
to let users see them also/alternatively as
"occur" options: use prefix `occur-' for aliases
of options that have prefix `list-matching-lines'.

This would help users find and access such things.
It leverages existing search, apropos, completion,
and other help aids (ways to "ask Emacs").

See also: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54157

> I think the hard part of this would be adding a data base to find the
> custom groups that are pertinent to any particular command.

Dunno.  If this is (only) about options that
change the behavior of a command then the option
doc strings will often mention the command(s)
they affect.

In that case, `apropos-doc' tells us which
options affect which commands.

And it can sometimes provide info about
potential aliasing.  For example,
`M-x apropos-doc list-matching-lines' shows
that the doc of command `occur' mentions option
`list-matching-lines-default-context-lines'.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]