From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Boal Newsgroups: gmane.emacs.bugs Subject: bug#64730: 30.0.50; Mark activation doesn't work after insert Date: Thu, 20 Jul 2023 09:28:48 +0100 Message-ID: <87r0p33s1r.fsf@bboal.com> References: <87zg3sm9q6.fsf@bboal.com> <83sf9k3prv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33593"; mail-complaints-to="usenet@ciao.gmane.io" Cc: public@protesilaos.com, 64730@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 20 12:36:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qMR1D-0008Sv-JD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Jul 2023 12:36:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMR0z-0006lA-Ty; Thu, 20 Jul 2023 06:36:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMR0s-0006kp-Rh for bug-gnu-emacs@gnu.org; Thu, 20 Jul 2023 06:36:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qMR0s-0002gV-IY for bug-gnu-emacs@gnu.org; Thu, 20 Jul 2023 06:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qMR0s-0001jb-E3 for bug-gnu-emacs@gnu.org; Thu, 20 Jul 2023 06:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bruno Boal Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Jul 2023 10:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64730 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 64730-submit@debbugs.gnu.org id=B64730.16898493536652 (code B ref 64730); Thu, 20 Jul 2023 10:36:02 +0000 Original-Received: (at 64730) by debbugs.gnu.org; 20 Jul 2023 10:35:53 +0000 Original-Received: from localhost ([127.0.0.1]:57765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMR0i-0001jD-OQ for submit@debbugs.gnu.org; Thu, 20 Jul 2023 06:35:53 -0400 Original-Received: from mout-p-101.mailbox.org ([80.241.56.151]:57168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMP1u-0006T1-54 for 64730@debbugs.gnu.org; Thu, 20 Jul 2023 04:28:59 -0400 Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4R65SL3ZyPz9smc; Thu, 20 Jul 2023 10:28:50 +0200 (CEST) In-Reply-To: <83sf9k3prv.fsf@gnu.org> X-Rspamd-Queue-Id: 4R65SL3ZyPz9smc X-Mailman-Approved-At: Thu, 20 Jul 2023 06:35:51 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265588 Archived-At: Thank you for such a quick and helpful reply. Best regards, BB Eli Zaretskii writes: > tags 64730 notabug > thanks > >> Cc: public@protesilaos.com >> From: Bruno Boal >> Date: Wed, 19 Jul 2023 12:17:21 +0100 >>=20 >> I'm trying to evaluate the following snippet in emacs -Q, however as >> soon as I try to insert a character, the region is not highlighted >> anymore. `activate- mark' doesn't make it work either. Whereas >> interactively with `exchange-point-and-mark' the region gets proper high= light. >>=20 >> (progn >> (insert "") >> (push-mark (line-beginning-position) :no-message :activate)) >>=20 >> (progn >> (insert "a") >> (push-mark (line-beginning-position) :no-message :activate)) > > This is the intended behavior. The ELisp manual says in the node "The > Mark": > > -- Variable: deactivate-mark > If an editor command sets this variable non-=E2=80=98nil=E2=80=99, t= hen 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 =E2=80=98deactivate-mark=E2=80=99, to deactivate the = mark when the > command is finished. Setting this variable makes it buffer-local. > > To write Lisp code that modifies the buffer without causing > deactivation of the mark at the end of the command, bind > =E2=80=98deactivate-mark=E2=80=99 to =E2=80=98nil=E2=80=99 around th= e code that does the > modification. For example: > > (let (deactivate-mark) > (insert " "))