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

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

Re: Emacs: adding 1 to every number made of 2 digits inside a marked reg


From: Emanuel Berg
Subject: Re: Emacs: adding 1 to every number made of 2 digits inside a marked region.
Date: Wed, 22 Sep 2021 23:04:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stephen Berman wrote:

> `string-to-int' was made obsolete long ago and removed in
> Emacs 26 (see NEWS.26); replace it with `string-to-number'
> in those code snippets and they'll work.

That so, I have used the vocabulary/phrasing in my code, like
here

(defun isbn--char-to-int (c)
  "Convert a char C into the integer it displays, e.g. 9 for ?9."
  (- c ?0) )

does that mean I should change that into ditto number on
might wonder?

  https://dataswamp.org/~incal/emacs-init/isbn-verify.el

There is also the mention of "digit" all the time ... but
that's in the Emacs regexps so can't be all bad. The word
"bit" = "binary digit" BTW, not ditto "in----r" as many
people think.

But the `pi' isn't pi in Emacs anymore but `float-pi'!

(defun roll-out (chainring sprocket bsd tire)
  (let*((diameter (+ bsd (* 2 tire)))
        (circum   (* diameter float-pi))
        (roll-out (* (/ chainring sprocket 1.0) circum)) )
    (list chainring sprocket roll-out) ))
;; (roll-out 34 25 622 23) ; (34 25 2854.0740906720002)

  https://dataswamp.org/~incal/emacs-init/bike.el

Here, BSD = Bead Seat Diameter.
<https://en.wikipedia.org/wiki/Bicycle_wheel>

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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