GNU bug report logs - #64730
30.0.50; Mark activation doesn't work after insert

Previous Next

Package: emacs;

Reported by: Bruno Boal <egomet <at> bboal.com>

Date: Wed, 19 Jul 2023 14:08:01 UTC

Severity: normal

Tags: notabug

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #18 received at 64730 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Boal <egomet <at> bboal.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: public <at> protesilaos.com, 64730 <at> debbugs.gnu.org
Subject: Re: bug#64730: 30.0.50; Mark activation doesn't work after insert
Date: Thu, 20 Jul 2023 09:28:48 +0100
Thank you for such a quick and helpful reply.
Best regards,
BB

Eli Zaretskii <eliz <at> gnu.org> writes:

> tags 64730 notabug
> thanks
>
>> Cc: public <at> protesilaos.com
>> From: Bruno Boal <egomet <at> bboal.com>
>> 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 " "))




This bug report was last modified 1 year and 364 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.