all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Roehler <andreas.roehler@online.de>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: Alan Mackenzie <acm@muc.de>,
	Kevin Rodgers <kevin.d.rodgers@gmail.com>,
	Stefan Monnier <monnier@IRO.UMontreal.CA>,
	emacs-devel@gnu.org
Subject: Re: Documentation of transient-mark-mode is sloppy, wrong, and confused.
Date: Tue, 02 Jun 2009 08:23:45 +0200	[thread overview]
Message-ID: <4A24C571.4070300@online.de> (raw)
In-Reply-To: <87vdngbs1w.fsf@uwakimon.sk.tsukuba.ac.jp>

Stephen J. Turnbull wrote:
> Alan Mackenzie writes:
> 
>  > Does XEmacs have a definition of an "active region"?  ;-)
> 
> Yes, although it's a little hard to find because of the heritage of
> XEmacs in the Lisp machine world.  C-h v zmacs-regions RET sez:
> 
> ------------------------------------------------------------------------
> `zmacs-regions' is a built-in boolean variable.
>   -- loaded from "/playpen/src/XEmacs/xemacs/src/editfns.c"
> 
> Value: t
> 
> Documentation:
> *Whether LISPM-style active regions should be used.
> This means that commands which operate on the region (the area between the
> point and the mark) will only work while the region is in the ``active''
> state, which is indicated by highlighting.  Executing most commands causes
> the region to not be in the active state, so (for example) C-w will only
> work immediately after activating the region.
> 
> More specifically:
> 
>  - Commands which operate on the region only work if the region is active.
>  - Only a very small set of commands cause the region to become active:
>    Those commands whose semantics are to mark an area, like `mark-defun'.
>  - The region is deactivated after each command that is executed, except that:
>  - "Motion" commands do not change whether the region is active or not.
> 
> set-mark-command (C-SPC) pushes a mark and activates the region.  Moving the
> cursor with normal motion commands (C-n, C-p, etc) will cause the region
> between point and the recently-pushed mark to be highlighted.  It will
> remain highlighted until some non-motion command is executed.
> 
> exchange-point-and-mark (C-x C-x) activates the region.  So if you mark a
> region and execute a command that operates on it, you can reactivate the
> same region with C-x C-x (or perhaps C-x C-x C-x C-x) to operate on it
> again.
> 
> Generally, commands which push marks as a means of navigation (like
> beginning-of-buffer and end-of-buffer (M-< and M->)) do not activate the
> region.  But commands which push marks as a means of marking an area of
> text (like mark-defun (M-C-h), mark-word (M-@) or mark-whole-buffer (C-x h))
> do activate the region.
> 
> The way the command loop actually works with regard to deactivating the
> region is as follows:
> 
> - If the variable `zmacs-region-stays' has been set to t during the command
>   just executed, the region is left alone (this is how the motion commands
>   make the region stay around; see the `_' flag in the `interactive'
>   specification).  `zmacs-region-stays' is reset to nil before each command
>   is executed.
> - If the function `zmacs-activate-region' has been called during the command
>   just executed, the region is left alone.  Very few functions should
>   actually call this function.
> - Otherwise, if the region is active, the region is deactivated and
>   the `zmacs-deactivate-region-hook' is called.
> ------------------------------------------------------------------------
> 
>  > Here, it has manifestly lead to massive confusion.
> 
> I suspect that is mostly just the unfortunate Emacs terminology,
> variable names, and documentation for the concept (sorry guys, but
> "unfortunate" is the nicest thing I can say about the stuff quoted in
> this thread), not because the word "active" itself is confusing.
> 
>  > "But EVERYBODY know what \"active\" means!" just won't do.
> 
> I don't think XEmacs's definition has that problem.
> 
> 
> 

IMHO XEmacs has another problem, see the docstrings of
related functions


` ...
(region-active-p)

...
Return non-nil if the region is active in the current buffer.
If `zmacs-regions' is true, this is equivalent to `region-exists-p'.
Otherwise, this function always returns false.

`  ...
(region-exists-p)
...
Return t if the region exists.
If active regions are in use (i.e. `zmacs-regions' is true), this means that
 the region is active.  Otherwise, this means that the user has pushed
 a mark in this buffer at some point in the past.


AFAIU definitions (including zmacs-regions) are here intermixed. At
least one may be dropped.

For me GNU variable `mark-active' is more straightforward by its value,
but should be named `mark-set' rather.

Info about an existing extend I understand by
`region-exists-p' in the word-sense (not the current definition).
Writing `region-extends-p' might be still better.

Third command may (but must not) require a visibility of region.

Would leave that to the programmers to decide, delivering
`region-visible-p' for the purpose.


My wishlist so far for all Emacsen:

`mark-set'
`region-extends-p'
`region-visible-p'

Andreas













  parent reply	other threads:[~2009-06-02  6:23 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
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 [this message]
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=4A24C571.4070300@online.de \
    --to=andreas.roehler@online.de \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=kevin.d.rodgers@gmail.com \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=stephen@xemacs.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.