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: Andreas Röhler
Subject: Re: Emacs: adding 1 to every number made of 2 digits inside a marked region.
Date: Thu, 23 Sep 2021 15:51:41 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:78.0) Gecko/20100101 Thunderbird/78.14.0


On 23.09.21 15:14, Hongyi Zhao wrote:
On Thu, Sep 23, 2021 at 7:59 PM Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
On 23.09.21 11:58, Hongyi Zhao wrote:
On Thu, Sep 23, 2021 at 4:38 PM Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
https://github.com/andreas-roehler/numbers-at-point

comes with

ar-raise-in-region-maybe

which should do the trick.
It really does the trick with the following configuration:

(use-package thingatpt-utils-core
    :straight (:host github :type git :repo "andreas-roehler/numbers-at-point")
    :config
    (load "numbers-at-point.el" nil t t))

But how to increase/decrease in steps that are not equal to 1?

HZ

It takes a numerical argument for higher steps the common way:

M-[STEP] ar-raise-in-region-maybe RET
It should be used as follows: First select/mark the data region and
place the point at the end of it, then perform the following
operation:

M-[STEP] M-x ar-raise-in-region-maybe RET,

e.g., use 2 as the step,

M-2 M-x ar-raise-in-region-maybe RET

Best regards, HZ


Hmm, in fact current behavior doesn't care if at the beginning or the end of a region.






reply via email to

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