all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Uwe Brauer <oub@mat.ucm.es>,
	"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: [External] : mark multi regions, kill and yank
Date: Mon, 30 Oct 2023 19:39:43 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488D1AA2F07559A07351EDFF3A1A@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87il6ovvvg.fsf@mat.ucm.es>

> The multi-region looks very much what I need,
> but the kill operation only works for one marked
> region and append-next-kill does not work with
> this package (which is very old, it is a miracle
> that it somehow still works, well it is Emacs
> of course)

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.

It's easy to define any actions you want
on a set of zones (or on selected zones).
See, for example, functions `zz-do-izones'
and `zz-map-izones':

 Map FUNCTION over IZONES, applying it to each izone.
 IZONES is a list like `zz-izones', that is, zones with identifiers.
 IZONES defaults to the value of the variable that is the value of
 `zz-izones-var'.
 Non-nil optional arg UNITE-P means first unite the zones and then
 iterate over the resulting list.

Some common vanilla-Emacs commands that
act on the region work out of the box on
a noncontiguous region.  There are similar
commands that work on a set of zones. E.g.

`zz(-map)-query-replace(-regexp)-zones', 
`zz-replace-(string|regexp)-zones'

E.g. `C-x n M-%' does `query-replace' on
the zones in the current buffer.

Pretty much anything you can do with the
Emacs region you can do with a set of zones
(i.e., with a non-contiguous "region").

But most existing Emacs commands that act on
the region don't know about non-contiguous
regions.  What you will need to do is define
new commands that take them into account.

> > If you don't want to kill the regions, and you
> > just want to copy them together (concatenated)
> > to the kill-ring, you can use library zones.el
> > for that....
> 
> Ok thanks for pointint that out I will have look
> and for sure use the function you provided below




  reply	other threads:[~2023-10-30 19:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 16:02 mark multi regions, kill and yank Uwe Brauer
2023-10-30 17:11 ` Bob Newell
2023-10-30 17:56   ` Uwe Brauer
2023-10-30 19:56     ` Bob Newell
2023-10-30 17:32 ` [External] : " Drew Adams
2023-10-30 17:54   ` Uwe Brauer
2023-10-30 19:39     ` Drew Adams [this message]
2023-10-30 20:32       ` Uwe Brauer
2023-10-30 21:42         ` Drew Adams
2023-10-31  8:53           ` Uwe Brauer
2023-10-31 16:39             ` Drew Adams
2023-10-31 16:52               ` Uwe Brauer
2023-10-31 17:48                 ` Drew Adams
2023-10-31 20:36                   ` Uwe Brauer
2023-10-31 21:08                     ` Drew Adams
2023-11-01  7:05                       ` Uwe Brauer
2023-11-01 15:00                         ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB5488D1AA2F07559A07351EDFF3A1A@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=oub@mat.ucm.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.