unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <help-gnu-emacs@gnu.org>
Subject: RE: leaving the region highlighted after a command
Date: Thu, 7 Jun 2007 07:30:21 -0700	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICOEDMDNAA.drew.adams@oracle.com> (raw)
In-Reply-To: <F2DDC2A1-720E-435A-97D2-ACF7FC051D87@pobox.com>

> > (defun foo ()
> >   (when (not executing-kbd-macro) (setq deactivate-mark nil)))
> >
> > In general, see the Elisp manual for `deactivate-mark'.
>
> That did it! I still don't understand why my mb function doesn't work
> above, when all it does is call mark-whole-buffer...but adding
> deactivate-mark fixed it.

Did you "see the Elisp manual for `deactivate-mark'?"? That explains that

    "If an editor command sets this variable non-`nil', then the editor
     command loop deactivates the mark after the command returns (if
     Transient Mark mode is enabled).  All the primitives that change
     the buffer set `deactivate-mark', to deactivate the mark when the
     command is finished.
     To write Lisp code that modifies the buffer without causing
     deactivation of the mark at the end of the command, bind
     `deactivate-mark' to `nil' around the code that does the
     modification."

IOW, your code did not work because the marke was automatically deactivated
after your command returned.

  reply	other threads:[~2007-06-07 14:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 13:24 leaving the region highlighted after a command Jonathan Swartz
2007-06-06 15:15 ` Drew Adams
2007-06-06 19:25   ` Jonathan Swartz
2007-06-07 14:30     ` Drew Adams [this message]
     [not found] <mailman.1639.1181136259.32220.help-gnu-emacs@gnu.org>
2007-06-10 10:15 ` Johan Bockgård

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICOEDMDNAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).