From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Perry Smith Newsgroups: gmane.emacs.help Subject: Re: How to programmatically highlight region? Date: Wed, 15 Nov 2006 15:41:21 -0600 Message-ID: <147F5C25-BD32-4B93-96E7-00E3D8D596CD@easesoftware.com> References: <87d57osc7s.fsf@pereiro.luannocracy.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: multipart/mixed; boundary="===============0163325348==" X-Trace: sea.gmane.org 1163627014 25620 80.91.229.2 (15 Nov 2006 21:43:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 15 Nov 2006 21:43:34 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 15 22:43:29 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GkSXF-0007Rh-39 for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Nov 2006 22:43:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GkSXE-00058m-2r for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Nov 2006 16:43:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GkSWa-0004vm-FE for help-gnu-emacs@gnu.org; Wed, 15 Nov 2006 16:42:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GkSWZ-0004uz-Fy for help-gnu-emacs@gnu.org; Wed, 15 Nov 2006 16:42:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GkSWZ-0004uq-5H for help-gnu-emacs@gnu.org; Wed, 15 Nov 2006 16:42:27 -0500 Original-Received: from [199.232.41.67] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GkSWD-00042L-43 for help-gnu-emacs@gnu.org; Wed, 15 Nov 2006 16:42:05 -0500 Original-Received: from [64.192.143.210] (helo=easeserver.easesoftware.com) by mx20.gnu.org with esmtp (Exim 4.52) id 1GkSVj-0000IG-HB for help-gnu-emacs@gnu.org; Wed, 15 Nov 2006 16:41:35 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by easeserver.easesoftware.com (Postfix) with ESMTP id 78B1151A6FC; Wed, 15 Nov 2006 15:41:28 -0600 (CST) Original-Received: from easeserver.easesoftware.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29766-08; Wed, 15 Nov 2006 15:41:23 -0600 (CST) Original-Received: from [64.192.143.210] (easeserver.easesoftware.com [64.192.143.210]) by easeserver.easesoftware.com (Postfix) with ESMTP id B308351A6CF; Wed, 15 Nov 2006 15:41:23 -0600 (CST) In-Reply-To: <87d57osc7s.fsf@pereiro.luannocracy.com> Original-To: David Abrahams X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: by amavisd-new at easesoftware.net X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38744 Archived-At: --===============0163325348== Content-Type: multipart/alternative; boundary=Apple-Mail-70-636088236 --Apple-Mail-70-636088236 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Nov 15, 2006, at 2:10 PM, David Abrahams wrote: > Hi, > > Could someone tell me how to get the effect of an "activated mark" in > transient mark mode from within elisp? In other words, I'd like to be > able to set up the point and mark, and when my elisp completes, see > the region highlighted. Seems like it should be simple, but nothing I > do seems to work. You might be asking how transient mark mode works. It seems to be just a variable that commands look at. But this works for me: (defun dog-test () (interactive) (transient-mark-mode 1) (set-mark (point)) (forward-char 20)) execute dog-test from the minibuffer and the current point plus 20 characters are highlighted -- basically just turn on transient mark more, set point and mark, and thats it. HTH, Perry Smith Ease Software, Inc. pedz@easesoftware.com http://www.easesoftware.com Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems --Apple-Mail-70-636088236 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1
On Nov 15, 2006, = at 2:10 PM, David Abrahams wrote:

Hi,

Could someone tell me how to get = the effect of an "activated mark" in
transient = mark mode from within elisp?=A0 = In other words, I'd like to be
able to = set up the point and mark, and when my elisp completes, see
the region highlighted.=A0 Seems like it should be = simple, but nothing I
do seems to = work.

You might be asking how = transient mark mode works.=A0 It seems to be just a variable that = commands look at.=A0 But this works for me:

(defun dog-test = ()
=A0 (interactive)
=A0 (transient-mark-mode = 1)
=A0 (set-mark (point))
=A0 (forward-char = 20))

execute dog-test from = the minibuffer and the current point plus 20 characters are highlighted = -- basically just turn on transient mark more, set point and mark, and = thats it.

HTH,
Perry = Smith
Ease Software, Inc.
=

Low cost = SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems


=

= --Apple-Mail-70-636088236-- --===============0163325348== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============0163325348==--