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

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

Re: beginning-of-buffer computations


From: Robert Thorpe
Subject: Re: beginning-of-buffer computations
Date: Sun, 01 Feb 2015 14:42:24 +0000

Marcin Borkowski <address@hidden> writes:

>                       (/ (+ 10 (* size (prefix-numeric-value arg))) 10)))

This line was in the first version of simple.el put into revision
control in 1991.  I think the aim was to prevent a calculation like (/ 0
10).  On some platforms it's an error to divide zero by anything, and it
triggers an interrupt.  Perhaps that was a problem at the time.

That leaves the question: why is the calculation done this way?  I think
that's because not all Emacs version supported floating point at the
time.  I think in that case numbers described by ratios were used
instead, e.g. 5/6.

I'm not sure on either of these things though.

> (Not to mention the next line - not shown here - which `forward-line's
> by 1.  Why not just (beginning-of-line) instead?)

I think that's because of "field text motion".  See the help for
beginning-of-line.

BR,
Robert Thorpe



reply via email to

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