[Top][All Lists]

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

Faking an active region

From: Deniz Dogan
Subject: Faking an active region
Date: Sat, 03 Sep 2011 18:09:46 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1

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 ()
  (let ((transient-mark-mode t))
    (push-mark nima-prompt-end t t) ;; a marker
    (goto-char (point-max))

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,

reply via email to

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