From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64730: 30.0.50; Mark activation doesn't work after insert Date: Wed, 19 Jul 2023 18:05:40 +0300 Message-ID: <83sf9k3prv.fsf@gnu.org> References: <87zg3sm9q6.fsf@bboal.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11664"; mail-complaints-to="usenet@ciao.gmane.io" Cc: public@protesilaos.com, 64730@debbugs.gnu.org To: Bruno Boal Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 19 17:06:24 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 1qM8kx-0002lt-PE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jul 2023 17:06:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qM8kd-0004m5-9m; Wed, 19 Jul 2023 11:06:03 -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 1qM8kc-0004lj-66 for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2023 11:06: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 1qM8kb-0003bO-UT for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2023 11:06:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qM8kb-0005kA-Pm for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2023 11:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jul 2023 15:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64730 X-GNU-PR-Package: emacs Original-Received: via spool by 64730-submit@debbugs.gnu.org id=B64730.168977913222023 (code B ref 64730); Wed, 19 Jul 2023 15:06:01 +0000 Original-Received: (at 64730) by debbugs.gnu.org; 19 Jul 2023 15:05:32 +0000 Original-Received: from localhost ([127.0.0.1]:56950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8k7-0005j8-RO for submit@debbugs.gnu.org; Wed, 19 Jul 2023 11:05:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8k4-0005in-0g; Wed, 19 Jul 2023 11:05:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qM8jx-0003QO-58; Wed, 19 Jul 2023 11:05:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=QCp0qPWrZP2XjVQ/bJKevCxmU7g19KLg4hAB9cJj868=; b=QAGV4z6SLlttgIxG2084 2RZmfq3V4awokTxpxoIlu+tDm4rZr4SN4WuArwKDwrvhzaqm6WCk3Bp0QG/LsLFYI4ODY4xQYLbRy dIC+Ht8e5FDTzDRg8fDTfuN09LaCrK0+QcdVSXZXxF+ncPfrZuJZBgpx4/14mMQ1OhIa4KW6SEzV9 zky3qeAOYB147PR4KznB4Yt583S04iT5siWbLE34bp8x+Exnwa+GGfEaZluKoGDBp/UpnrdKrYZ1h tYaxi6By+kU/oo5BzXeBjY0+iKIXVjTr+Vp9JiyFEgkHtYUZN6BEFl2or1AO7/KI++uESX6gsbgr7 Wl1FCiDWPJ4q9Q==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qM8jl-0005kQ-By; Wed, 19 Jul 2023 11:05:20 -0400 In-Reply-To: <87zg3sm9q6.fsf@bboal.com> (message from Bruno Boal on Wed, 19 Jul 2023 12:17:21 +0100) 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:265543 Archived-At: tags 64730 notabug thanks > Cc: public@protesilaos.com > From: Bruno Boal > Date: Wed, 19 Jul 2023 12:17:21 +0100 > > 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 highlight. > > (progn > (insert "") > (push-mark (line-beginning-position) :no-message :activate)) > > (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-‘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. 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 ‘deactivate-mark’ to ‘nil’ around the code that does the modification. For example: (let (deactivate-mark) (insert " "))