unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Bruno Boal <egomet@bboal.com>
Cc: public@protesilaos.com, 64730@debbugs.gnu.org
Subject: bug#64730: 30.0.50; Mark activation doesn't work after insert
Date: Wed, 19 Jul 2023 18:05:40 +0300	[thread overview]
Message-ID: <83sf9k3prv.fsf@gnu.org> (raw)
In-Reply-To: <87zg3sm9q6.fsf@bboal.com> (message from Bruno Boal on Wed, 19 Jul 2023 12:17:21 +0100)

tags 64730 notabug
thanks

> Cc: public@protesilaos.com
> From: Bruno Boal <egomet@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 " "))





  reply	other threads:[~2023-07-19 15:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 11:17 bug#64730: 30.0.50; Mark activation doesn't work after insert Bruno Boal
2023-07-19 15:05 ` Eli Zaretskii [this message]
2023-07-20  8:28   ` Bruno Boal
2023-07-20 10:20     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83sf9k3prv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64730@debbugs.gnu.org \
    --cc=egomet@bboal.com \
    --cc=public@protesilaos.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).