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

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

Re: Controling modifications and cuting invisible ?


From: Oliver Scholz
Subject: Re: Controling modifications and cuting invisible ?
Date: Fri, 23 May 2003 14:07:05 +0200
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt)

François Fleuret <francois.fleuret@noos.fr> writes:
[...]
> Also, I use the invisible attribute to hide data field in each line
> (basically the filename associated to a mp3), so that I can use those
> field when I invoke mpg321, while keeping a neat display for the
> user. This works pretty well, but for a reason I do not understand,
> cut/paste operation do not preserve this attribute ... Any clue ?

I'd rather consider this as a feature. When I copy&paste ... erm ...
kill-ring-save&yank something from a buffer, I don't want to be
surprised by invisible text.

> And the last one: I use an overlay to highlight the current mp3. This
> is neat, but I was not able to find how to make the overlay to cover
> the complete line (i.e. all the width, even if the line stops before),
> without creating weird effect when the user modifies the
> buffer. Basically, to make the overlay as large as the window, I used
> something like:
>
> (move-overlay mp3play-current-overlay (point-at-bol) (1+ (point-at-eol)))
>
> the 1+ puting the \n in the overlay. This works as long as I do not
> move a line accross the overlay with the following code:
>
> (transpose-regions (line-beginning-position) (1+ (line-end-position))
>                    (line-beginning-position 2) (1+ (line-end-position 2)))
>
> Doing that make the overlay include the line I am moving ...

IIRC a overlay is implemented with markers or something similar. (But
I have not read the code, so I may be wrong.) So there is no way but
to update your overlay after `transpose-region', for example with
`move-overlay'.

    Oliver
-- 
4 Prairial an 211 de la Révolution
Liberté, Egalité, Fraternité!


reply via email to

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