From: Deniz Dogan <deniz@dogan.se>
To: help-gnu-emacs@gnu.org
Subject: Faking an active region
Date: Sat, 03 Sep 2011 18:09:46 +0200 [thread overview]
Message-ID: <4E62514A.7040905@dogan.se> (raw)
I am writing a minor mode in which I want to remap `undo' to ALWAYS act
as if a specific region was active and transient-mark-mode was on.
So how would I go about "faking" this active region in Emacs Lisp? This
is what I have so far:
(define-key map [remap undo] 'nima-undo-undo)
(defun nima-undo-undo ()
(interactive)
(let ((transient-mark-mode t))
(push-mark nima-prompt-end t t) ;; a marker
(goto-char (point-max))
(undo)))
This doesn't work, and I'm not surprised because I feel like I'm just
throwing everything I can find at this problem right now.
Thanks in advance,
Deniz
next reply other threads:[~2011-09-03 16:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-03 16:09 Deniz Dogan [this message]
2011-09-03 16:19 ` Faking an active region Eli Zaretskii
2011-09-03 16:40 ` Drew Adams
2011-09-03 17:30 ` Deniz Dogan
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E62514A.7040905@dogan.se \
--to=deniz@dogan.se \
--cc=help-gnu-emacs@gnu.org \
/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.
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).