all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: charles@aurox.ch (Charles A. Roelli)
To: Drew Adams <drew.adams@oracle.com>
Cc: 32956@debbugs.gnu.org
Subject: bug#32956: 26.1.50; t-m-m mark deactivation documentation
Date: Sun, 07 Oct 2018 16:39:07 +0200	[thread overview]
Message-ID: <m2a7np254k.fsf@aurox.ch> (raw)
In-Reply-To: <8e713508-f360-4fcd-9288-e094d450683a@default> (message from Drew Adams on Sun, 7 Oct 2018 01:02:28 +0000 (UTC))

> Date: Sun, 7 Oct 2018 01:02:28 +0000 (UTC)
> From: Drew Adams <drew.adams@oracle.com>
> 
> > Hmm, deactivate-mark is nil by default -- what effect would setting it
> > to "nil" again have?  Is it to counteract the effect of previous
> > function calls within the command, which may have set
> > "deactivate-mark" to "t"?
> 
> This is about defining a command that activates the region
> and wants to leave/keep it activated after the command
> is finished.
> 
> Consider, as one example, a repeatable command that
> does something  with the active region (e.g. indents it).
> Because it is repeatable it wants to keep the region 
> activated, for the next action. It needs to do this at
> the end: (setq deactivate-mark  nil).

I think changing or adding text in the buffer is what eventually tells
the command loop to deactivate the mark (via the variable
deactivate-mark).  The command loop should not do that by default
after each command.  For example, from emacs -Q:

M-: (defun foo () (interactive)) RET C-x h M-x foo RET > does NOT deactivate the mark
M-: (defun foo () (interactive) (insert "text")) RET C-x h M-x foo RET > DOES deactivate the mark

So, developers should only have to add (setq deactivate-mark nil) to
the end of their command if it is a command that changes or adds
buffer text without wanting to deactivate the mark.

This is explained in the Elisp manual (where it belongs, I think).
But the Emacs manual does lack an index entry for "deactivating the
mark", which seems like an area for improvement.





  reply	other threads:[~2018-10-07 14:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<<m2in2f17jo.fsf@aurox.ch>
     [not found] ` <<5399d374-2089-492a-b830-9eb2baac82a6@default>
     [not found]   ` <<m2efd2272p.fsf@aurox.ch>
2018-10-07  1:02     ` bug#32956: 26.1.50; t-m-m mark deactivation documentation Drew Adams
2018-10-07 14:39       ` Charles A. Roelli [this message]
2018-10-07 19:42         ` Charles A. Roelli
2018-10-08  2:28           ` Eli Zaretskii
2018-10-08 17:23             ` Charles A. Roelli
     [not found] <<m2in2f17jo.fsf@aurox.ch>
2018-10-06 14:48 ` Drew Adams
2018-10-06 19:44   ` Charles A. Roelli
2018-10-06 14:19 Charles A. Roelli
2018-10-06 16:39 ` Eli Zaretskii
2018-10-06 19:29   ` Charles A. Roelli

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=m2a7np254k.fsf@aurox.ch \
    --to=charles@aurox.ch \
    --cc=32956@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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.