bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#40460: [External] : Re: bug#40460: 26.3; Make arg of `forward-whites


From: Drew Adams
Subject: bug#40460: [External] : Re: bug#40460: 26.3; Make arg of `forward-whitespace' and `forward-symbol' optional
Date: Mon, 1 Mar 2021 16:12:06 +0000

> > The numeric argument to most `forward-*' commands is optional,
> > defaulting to 1.  This should be the case in general.  These three
> > commands require their ARG, but they should not.  It should be
> > optional and default to 1.
> >
> >  `forward-button'
> >  `forward-symbol'
> >  `forward-whitespace'
> 
> It's true that this is somewhat inconsistent -- but I also think it's a
> mistake that the other `forward-*' functions have an optional argument.

Why do you think so?

It's not just vanilla Emacs that defines
`forward-*' commands.  Users are encouraged to
do so as well.

The point of thingatpt.el (as one example) is
to leverage `forward-*' functions to identify
things at point.  If 3rd-party code and users
define `forward-*' functions they get free
support for identifying the `*' things from
`thingatpt.el'.

So it's important that a convention be more or
less followed in the definition of `forward-*'
commands.

And yes, defaulting to 1 is exactly what Emacs
does, for all kinds of motion (and other!)
commands.  Why have `interactive' default but
not also let Elisp calls default?

For Lisp, defaulting means the arg is optional.
This is exactly what Emacs does for this kind
of thing.  It always has, since Day One.

There's an inconsistency here, and instead of
fixing it - the right way (to fit the rest of
Emacs) or even the wrong way (to fit what you
apparently think is better - no defaulting),
you prefer to keep the inconsistency.

The question is why?

> So I don't think making these follow that pattern is a move in the
> right direction, and I'm closing this bug report.

The question is why you don't think following
the Emacs pattern is right.





reply via email to

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