From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: how to activate region Date: Thu, 14 May 2009 10:24:52 +0200 Message-ID: <4A0BD554.9040206@easy-emacs.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1242289489 32203 80.91.229.12 (14 May 2009 08:24:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 May 2009 08:24:49 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Barry Margolin Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 14 10:24:41 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M4WF4-0000X0-0W for geh-help-gnu-emacs@m.gmane.org; Thu, 14 May 2009 10:24:38 +0200 Original-Received: from localhost ([127.0.0.1]:45372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4WF3-0002JC-75 for geh-help-gnu-emacs@m.gmane.org; Thu, 14 May 2009 04:24:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M4WEI-00027o-Mk for help-gnu-emacs@gnu.org; Thu, 14 May 2009 04:23:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M4WEE-000265-1w for help-gnu-emacs@gnu.org; Thu, 14 May 2009 04:23:50 -0400 Original-Received: from [199.232.76.173] (port=33173 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4WED-000260-Uz for help-gnu-emacs@gnu.org; Thu, 14 May 2009 04:23:46 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.187]:65420) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M4WED-0003d1-Fq for help-gnu-emacs@gnu.org; Thu, 14 May 2009 04:23:45 -0400 Original-Received: from [192.168.178.27] (p54BE9B95.dip0.t-ipconnect.de [84.190.155.149]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MKv5w-1M4WE517c2-0001Dn; Thu, 14 May 2009 10:23:37 +0200 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: X-Provags-ID: V01U2FsdGVkX1+whitbUxGfLiaeSrNqGmXZdRbEheFq9usy43p ZX1ERwij/LpjuXLIMEG0tWYLf89sgJUfVVl2R6XmupVuE4qo0j X8zP3+O9gBPsRiNS8ui6pec9RWeAhJ9dWH9ctGB350= X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:64411 Archived-At: Barry Margolin wrote: > In article , > Samuel Wales wrote: > > >> When transient-mark-mode is off, there must be a way to activate the >> existing region for commands that require it to be active. Anybody >> know what it is? The manual and apropos have yielded nothing so far. >> >> Thanks. >> > > C-x C-x. This has the side effect of swapping the point and mark, so > you can type it again to get back where you were. > > I don't think there's a standard command that does nothing but activate > the region. It should be trivial to write one, though. > > The question seems too, what "active region" means. AFAIU we have three different states to deal with: - the mark is set - the mark is set and exists at different location from point, i.e. region has an extent - region has an extent and is visible (transient-mark-mode on) Presently region-active-p is defined in simple.el ,---- | (defun region-active-p () | "Return t if Transient Mark mode is enabled and the mark is active. | | Most commands that act on the region if it is active and | Transient Mark mode is enabled, and on the text near point | otherwise, should use `use-region-p' instead. That function | checks the value of `use-empty-active-region' as well." | (and transient-mark-mode mark-active)) `---- i.e. AFAIU it does not require an extent. IMO if the mark is set, a region is active basically. I use (defsubst region-exists-p () "(not (null (mark)))" (not (null (mark)))) Cheers Andreas Röhler