all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Davis Herring <herring@lanl.gov>
Cc: Chong Yidong <cyd@stupidchicken.com>, emacs-devel@gnu.org
Subject: Re: Documentation of transient-mark-mode is sloppy, wrong, and confused.
Date: Fri, 29 May 2009 11:01:29 +0000	[thread overview]
Message-ID: <20090529110129.GD2793@muc.de> (raw)
In-Reply-To: <44395.130.55.118.19.1243554794.squirrel@webmail.lanl.gov>

Hi, Davis!

On Thu, May 28, 2009 at 04:53:14PM -0700, Davis Herring wrote:
> >>   Some commands, which ordinarily operate on the region when the
> >>   mark is active, instead act on the entire buffer.

> > That is a definition of "active", surely, as I suggested above.
> > Surely, it is better to regard the mark and region as being inactive
> > when t-m-m is disabled?

> It seems to me that there are two kinds of activeness of the mark (and
> the region; they have between them only one state).  The first kind
> (call it active1) is associated with commands like `kill-region', which
> refuse to do anything unless the region is active1.  Outside of
> transient mark mode, the mark is always active1 if it exists at all;
> with tmm, the mark is frequently activated1 and deactivated1.

> The other kind (active2) is associated with commands like `undo',
> `insert-parentheses', and `how-many', which restrict, extend, or change
> (respectively) their area of effect to be the region iff it is active2. 
> Outside of transient mark mode, the mark is never active2 at all; with
> tmm, the mark is active2 iff it is active1.

Bingo!  That's the answer!  Thanks!

So an honest @dfn{active} would be along the lines:

    Historically, @dfn{active region} has had two distinct, sometimes
    contradictory meanings:
    @itemize @bullet
    @item
    Certain commands which use the region, such as @key{C-w}
    (@code{kill-region}) are disabled when the region isn't @dfn{active}.
    As from Emacs 23, the region is now always ``active'' in this sense,
    unless you set the user option @code{mark-even-when-inactive}
    (@pxref{...}).
    @item
    Certain commands work in an enhanced manner when the region is
    @dfn{active}: for example, `fill-paragraph' (@pxref{..}) fills the
    region when it is active, rather than just the current paragraph.
    When the region is ``active'' in this sense, it is highlit.
    @end @itemize

    Most uses of ``active'' in this manual have the second meaning.

> So we see that while there are two predicates, they can be resolved as (or
> (not transient-mark-mode) (mark-active)) and (and transient-mark-mode
> (mark-active)).

I think these can be more simply expressed as (i) mark-active and (ii)
(use-region-p).

> Since my imaginary function `mark-active' is only ever called when tmm
> is on, we may take it to return nil otherwise and replace active2 with
> just (mark-active).  There is then only one variable "active", but tmm
> has different effects on different interpretations of its value.

> Sidebar: I like the 22 feature of turning tmm on temporarily; I don't like
> it in general (partly because I like the mark being active1), but
> otherwise I cannot have an active2 mark at all.

Doesn't (setq mark-even-if-inactive t) do what you want?

> Davis

-- 
Alan Mackenzie (Nuremberg, Germany).




  reply	other threads:[~2009-05-29 11:01 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28 12:29 Documentation of transient-mark-mode is sloppy, wrong, and confused Alan Mackenzie
2009-05-28 16:54 ` Chong Yidong
2009-05-28 20:15   ` Alan Mackenzie
2009-05-28 20:48     ` Chong Yidong
2009-05-28 23:03       ` Alan Mackenzie
2009-05-28 23:53         ` Davis Herring
2009-05-29 11:01           ` Alan Mackenzie [this message]
2009-05-29  0:21         ` Chong Yidong
2009-05-29  1:55         ` Stefan Monnier
2009-05-29  4:30           ` Kevin Rodgers
2009-05-29  5:47             ` Andreas Roehler
2009-05-29  8:25               ` Stephen J. Turnbull
2009-05-29  8:58                 ` Alan Mackenzie
2009-06-01  2:34                   ` Stephen J. Turnbull
2009-06-01  9:40                     ` Lennart Borgman
2009-06-02  6:23                     ` Andreas Roehler
2009-06-02 11:50                       ` Stephen J. Turnbull
2009-05-29  8:37           ` Eli Zaretskii
2009-05-29  9:27             ` Alan Mackenzie
2009-05-29 10:11               ` Eli Zaretskii
2009-05-29 13:13                 ` Alan Mackenzie
2009-05-29 14:19                 ` Stefan Monnier
2009-05-29 16:40                   ` Drew Adams
2009-05-29 22:20                     ` Alan Mackenzie
2009-05-30  0:11                       ` Drew Adams
2009-05-29  9:55             ` Stephen J. Turnbull
2009-05-29 10:14               ` Eli Zaretskii
2009-06-01  2:09                 ` Stephen J. Turnbull
2009-05-29 10:45               ` Andreas Roehler
2009-05-29  8:38         ` Eli Zaretskii
2009-05-29  9:35           ` Alan Mackenzie
2009-05-29  9:48             ` Eli Zaretskii
2009-05-29 13:17               ` Alan Mackenzie

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=20090529110129.GD2793@muc.de \
    --to=acm@muc.de \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=herring@lanl.gov \
    /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.