From: Uwe Brauer <email@example.com>
Subject: [SOLVED] (was: how to randomize (scample) regions in a an org buffer)
Date: Wed, 06 Oct 2021 18:37:03 +0200 [thread overview]
Message-ID: <firstname.lastname@example.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]
>>> "UB" == Uwe Brauer <email@example.com> writes:
> I need to replace private information in my org files, but only region wide.
> I found
> Where two such functions are discussed, one is even for org files,
> however only buffer wide and the code looks rather complicated to me.
No it was actually quite simple:
(defun randomise-region ()
"Like `ap/replace-words-randomly', but only replace inside region if it is active.
If the region is not active, replace from point to the end of the
buffer. The region is never considered active outside
(if (or (and (boundp 'zmacs-region-active-p) zmacs-region-active-p)
(and (boundp 'transient-mark-mode) transient-mark-mode mark-active))
(narrow-to-region (point) (mark))
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
prev parent reply other threads:[~2021-10-06 16:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-06 15:52 how to randomize (scample) regions in a an org buffer Uwe Brauer
2021-10-06 16:37 ` Uwe Brauer [this message]
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:
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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 public inbox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).