[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Saving "relative point" in a paragraph or line
From: |
Suvayu Ali |
Subject: |
Re: Saving "relative point" in a paragraph or line |
Date: |
Thu, 12 Sep 2013 13:26:25 +0200 |
User-agent: |
Mutt/1.5.21 (2012-12-30) |
On Thu, Sep 12, 2013 at 12:06:55PM +0200, Andreas Röhler wrote:
> Am 12.09.2013 11:51, schrieb Suvayu Ali:
> >On Thu, Sep 12, 2013 at 10:49:37AM +0200, Andreas Röhler wrote:
> >>Am 12.09.2013 10:06, schrieb Suvayu Ali:
> >>>Hi,
> >>>
> >>>I'm trying to write a few wrappers for transpose functions. I would
> >>>like to restore the point to the relative position of the element I am
> >>>trying to transpose. Are there any standard ways/functions people use
> >>>for something like this?
> >>>
> >>>An example (cursor at -!-):
> >>>
> >>>- Lorem ipsum dolor -!- sit amet, consectetur adipiscing elit.
> >>>- Vestibulum porttitor metus sed est varius, id dapibus est rhoncus.
> >>>
> >>> |
> >>> v
> >>>
> >>>- Vestibulum porttitor metus sed est varius, id dapibus est rhoncus.
> >>>- Lorem ipsum dolor -!- sit amet, consectetur adipiscing elit.
> >>
> >>(setq my-point (copy-marker (point)))
> >
> >After the transpose my-point will be somewhere inside the other line.
> >Hence my use of the terminology "relative point".
>
> Hmm, you example shows point after "dolor" as in start. That's what
> copy-marker would provide.
> Maybe move the point indicated in example after change, i.e. end-of
> "porttitor"?
Ah, I think I misunderstood what copy-marker does. Thank you. I'll
test both your and Jambu's suggestion later in the day.
Cheers,
--
Suvayu
Open source is the future. It sets us free.