all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: emacs-devel@gnu.org
Subject: Re: `insert' inside `with-current-buffer' deactivating the mark?
Date: Mon, 04 Mar 2013 15:59:05 +0100	[thread overview]
Message-ID: <87txoryzwm.fsf@web.de> (raw)
In-Reply-To: <87vc97jk5k@ch.ristopher.com> (Christopher Schmidt's message of "Mon, 4 Mar 2013 14:48:23 +0000 (GMT)")

Christopher Schmidt <christopher@ch.ristopher.com> writes:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
> > if I eval the following in emacs -Q:
> > (defun insert-in-some-other-buffer ()
> >   (with-current-buffer (get-buffer-create "*Test*")
> >     (insert ".")))
> >
> > (add-hook 'post-command-hook 'insert-in-some-other-buffer)
> >
> > the mark in any buffer is deactivated immediately after each command.
> > Looks like a bug to me - the use of `with-current-buffer' should
> > prevent influencing any other buffer than *Test*.  What am I missing?
>
>     deactivate-mark

Thanks.  Yes, I know `deactivate-mark' - but why is it necessary here?
Why does changing another buffer deactivate the mark in the current
buffer?

Even if you activate the mark in one buffer, manually switch to another
buffer, edit it, and come back to the first buffer, the mark is still
active there.


Michael.



  reply	other threads:[~2013-03-04 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 14:19 `insert' inside `with-current-buffer' deactivating the mark? Michael Heerdegen
2013-03-04 14:48 ` Christopher Schmidt
2013-03-04 14:59   ` Michael Heerdegen [this message]
2013-03-04 18:21     ` Stefan Monnier

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=87txoryzwm.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=emacs-devel@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.