[Top][All Lists]

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

bug#16990: 24.3.50; Return a useful value for motion functions

From: Drew Adams
Subject: bug#16990: 24.3.50; Return a useful value for motion functions
Date: Fri, 29 Apr 2016 11:55:21 -0700 (PDT)

> > Enhancement request: Return a useful value for motion functions,
> > when possible.
> >
> > The set of candidate functions for enhancement are motion functions.
> > Yes, each needs to be checked in detail, and handled appropriately.
> > One size does not fit all.  A return value choice should be based on
> > what is generally most useful in the context of using the function.
> >
> > This is the promised followup from the discussion for bug #15117.  See
> > that thread for more information (relevant functions, possible return
> > values, etc.)
> I seem to recall that this was about you wanting side-effect-only
> functions to return values?  The rest of us were against it, I think.
> Closing.

You seem to recall wrong.  There was no "rest of us were against
it" - at all.  And no, it was not as superficial and general as
my "wanting side-effect-only functions to return [useful] values".

Please read the Subject line.  This is about motion functions -
at least some of them, and to be examined on a case-by-case basis.

Here's Eli, saying the same thing (in the referenced bug thread)
I say in my 2nd sentence of this thread: one size does not fit all,
and suggesting reasonable (better) values for two such functions:

  Why point?  E.g., forward-to-indentation could returns the
  column where it ended up, forward-same-syntax could return
  the syntax class, forward-visible-line could return the
  number of screen lines traversed, etc.

  Once again, the potentially useful value might well be
  different for each function, and needs to be considered
  separately for each.  There's no "one fits all" here.

He clearly was thinking about the question, not just
applying a knee-jerk reaction that any suggestion of
having a side-effect function return a useful value is
silly.  He was carefully thinking about what the best
value might be for each of the functions he considered.

Yes, nil could be a reasonable return value for some such
functions.  But sometimes a better value is available.  This
bug is about finding such values and making the functions
return them.

reply via email to

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