all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: Barry Margolin <barmar@alum.mit.edu>
Cc: help-gnu-emacs@gnu.org
Subject: Re: how to activate region
Date: Thu, 14 May 2009 10:24:52 +0200	[thread overview]
Message-ID: <4A0BD554.9040206@easy-emacs.de> (raw)
In-Reply-To: <barmar-8F8AFF.00595814052009@mara100-84.onlink.net>

Barry Margolin wrote:
> In article <mailman.7100.1242253215.31690.help-gnu-emacs@gnu.org>,
>  Samuel Wales <samologist@gmail.com> 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




  reply	other threads:[~2009-05-14  8:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.7100.1242253215.31690.help-gnu-emacs@gnu.org>
2009-05-14  4:59 ` how to activate region Barry Margolin
2009-05-14  8:24   ` Andreas Röhler [this message]
2009-05-15  1:46 ` Barry Margolin
2009-05-15 20:16   ` Samuel Wales
2009-05-15 20:43     ` Samuel Wales
2009-05-13 22:19 Samuel Wales
2009-05-13 23:16 ` Leo
2009-05-14  4:32   ` Samuel Wales
2009-05-14  4:33     ` Samuel Wales
2009-05-14  6:04       ` Andreas Röhler
2009-05-14  4:55     ` Kevin Rodgers
     [not found]     ` <mailman.7129.1242276989.31690.help-gnu-emacs@gnu.org>
2009-05-14  5:12       ` Barry Margolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A0BD554.9040206@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=barmar@alum.mit.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.