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

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

RE: [External] : mark multi regions, kill and yank


From: Drew Adams
Subject: RE: [External] : mark multi regions, kill and yank
Date: Mon, 30 Oct 2023 21:42:19 +0000

> > You can show the current set of zones, in
> > various ways (e.g., highlight/unhighlight),
> > so you can easily see what you're acting on.
> 
> > You can define a command that deletes or
> > kills the text in a set of zones.
> 
> Ok, it seems that I have to combine zones with the
> ancient multi-region-mark-region, so the steps are
> 
>     1. Mark say a line
>     2. Run multi-region-mark-region
>     3. Mark another line
>     4. Run multi-region-mark-region, this way various noncontiguous are
>        higlighted.
>     5. Run zz-add-zone on each highlighted region (I prefer to do this
>        once all regions are highlighted)
>     6. Run your function (zz-copy-izones-as-kill 'zz-izones)
> 
> Voila.

Command `hlt-highlight-zones' from library `highlight.el'
highlights zones.  So just `C-x n a' to add each zone
and then `M-x hlt-highlight-zones'.

(`M-x hlt-unhighlight-zones' to unhighlight them.)

Or if you really want to use your `multi-region-mark-region'
then you can use `M-x zz-add-zones-from-highlighting' to
create the zones from the `multi-region-mark-region'
highlighting (assuming it uses text or overlay property
`face' or `font-lock-face').

All of this should be clear from looking at file `zones.el'.

> A last question about a function I do not find listed in your package:
> 
> Can I purge all zones in one go?

Just set the izones variable to nil.  E.g., for the
default variable, which is `zz-izones', use this:

  M-: (setq zz-izones nil)

___

https://www.emacswiki.org/emacs/HighlightLibrary

https://www.emacswiki.org/emacs/download/highlight.el





reply via email to

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