From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.help Subject: Faking an active region Date: Sat, 03 Sep 2011 18:09:46 +0200 Message-ID: <4E62514A.7040905@dogan.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1315066250 18618 80.91.229.12 (3 Sep 2011 16:10:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 3 Sep 2011 16:10:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 03 18:10:45 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qzsns-00063z-TG for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Sep 2011 18:10:45 +0200 Original-Received: from localhost ([::1]:46061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qzsns-0005Ry-1o for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Sep 2011 12:10:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qzsno-0005Rj-5N for help-gnu-emacs@gnu.org; Sat, 03 Sep 2011 12:10:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qzsnn-0002Jp-Dv for help-gnu-emacs@gnu.org; Sat, 03 Sep 2011 12:10:40 -0400 Original-Received: from ch-smtp04.sth.basefarm.net ([80.76.153.5]:42471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qzsnn-0002Jf-13 for help-gnu-emacs@gnu.org; Sat, 03 Sep 2011 12:10:39 -0400 Original-Received: from c80-216-107-100.bredband.comhem.se ([80.216.107.100]:52088 helo=[192.168.0.11]) by ch-smtp04.sth.basefarm.net with esmtp (Exim 4.76) (envelope-from ) id 1Qzsne-0004a3-F0 for help-gnu-emacs@gnu.org; Sat, 03 Sep 2011 18:10:32 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1 X-Originating-IP: 80.216.107.100 X-Scan-Result: No virus found in message 1Qzsne-0004a3-F0. X-Scan-Signature: ch-smtp04.sth.basefarm.net 1Qzsne-0004a3-F0 d704b31f80db29edd221ce63c1eea18b X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.76.153.5 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82129 Archived-At: 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