From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Faking an active region Date: Sat, 03 Sep 2011 19:19:42 +0300 Message-ID: <83vct9zjhd.fsf@gnu.org> References: <4E62514A.7040905@dogan.se> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1315066886 22670 80.91.229.12 (3 Sep 2011 16:21:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 3 Sep 2011 16:21:26 +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:21:20 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 1Qzsy7-0001Wt-RF for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Sep 2011 18:21:19 +0200 Original-Received: from localhost ([::1]:55584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qzsy7-0000zq-3z for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Sep 2011 12:21:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qzsy3-0000zl-7p for help-gnu-emacs@gnu.org; Sat, 03 Sep 2011 12:21:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qzsy2-0004Bd-7s for help-gnu-emacs@gnu.org; Sat, 03 Sep 2011 12:21:15 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:42598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qzsy2-0004BV-09 for help-gnu-emacs@gnu.org; Sat, 03 Sep 2011 12:21:14 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LQY00M00FPVF600@a-mtaout21.012.net.il> for help-gnu-emacs@gnu.org; Sat, 03 Sep 2011 19:19:39 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.229.83.44]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LQY00M1HG0Q7JB0@a-mtaout21.012.net.il> for help-gnu-emacs@gnu.org; Sat, 03 Sep 2011 19:19:39 +0300 (IDT) In-reply-to: <4E62514A.7040905@dogan.se> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.169 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:82130 Archived-At: > Date: Sat, 03 Sep 2011 18:09:46 +0200 > From: Deniz Dogan > > 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.