From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: `insert' inside `with-current-buffer' deactivating the mark? Date: Mon, 04 Mar 2013 15:59:05 +0100 Message-ID: <87txoryzwm.fsf@web.de> References: <87mwujl02o.fsf@web.de> <87vc97jk5k@ch.ristopher.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362409044 27402 80.91.229.3 (4 Mar 2013 14:57:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Mar 2013 14:57:24 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 04 15:57:49 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UCWpj-0004pP-V0 for ged-emacs-devel@m.gmane.org; Mon, 04 Mar 2013 15:57:44 +0100 Original-Received: from localhost ([::1]:45928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCWpL-0002WD-KT for ged-emacs-devel@m.gmane.org; Mon, 04 Mar 2013 09:57:19 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCWpH-0002Vu-4n for emacs-devel@gnu.org; Mon, 04 Mar 2013 09:57:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCWpF-0006uj-T8 for emacs-devel@gnu.org; Mon, 04 Mar 2013 09:57:15 -0500 Original-Received: from mout.web.de ([212.227.15.3]:54775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCWpF-0006u7-Jx for emacs-devel@gnu.org; Mon, 04 Mar 2013 09:57:13 -0500 Original-Received: from drachen.dragon ([92.74.177.220]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0Lxf5f-1Ut2RY3sXz-016ttP; Mon, 04 Mar 2013 15:57:12 +0100 Mail-Followup-To: emacs-devel@gnu.org In-Reply-To: <87vc97jk5k@ch.ristopher.com> (Christopher Schmidt's message of "Mon, 4 Mar 2013 14:48:23 +0000 (GMT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V02:K0:7X3K1NWlG8fhTbce/hV7DB7EZ0jPH76tR5OtWO9NwA6 P4nuj7tZZIkCHfYhdsUlGg0WBvGzuwgl+ojWWg7OQlWjtelhal PfqCeP/klvxRoK3V8ilM5IqzOFgx3GPUIzdi+rNqDKXPw5R5vz nVq+DB4Go7Xjy2Vp+JhLqjHxhLOs/P3Zq2iuSjGog1Yb1bdMVY FvmVdMjwogY9h7EWltKGDDbmISVPhPGSJ2YpsgwMqQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157507 Archived-At: Christopher Schmidt writes: > Michael Heerdegen 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.