all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Faking an active region
Date: Sat, 03 Sep 2011 19:19:42 +0300	[thread overview]
Message-ID: <83vct9zjhd.fsf@gnu.org> (raw)
In-Reply-To: <4E62514A.7040905@dogan.se>

> Date: Sat, 03 Sep 2011 18:09:46 +0200
> From: Deniz Dogan <deniz@dogan.se>
> 
> 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.

See region-active-p and push-mark.



  reply	other threads:[~2011-09-03 16:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-03 16:09 Faking an active region Deniz Dogan
2011-09-03 16:19 ` Eli Zaretskii [this message]
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

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

  git send-email \
    --in-reply-to=83vct9zjhd.fsf@gnu.org \
    --to=eliz@gnu.org \
    --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.
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.