* etc/NEWS: Announce new value of `deactivate-mark'.
* lisp/simple.el (deactivate-mark): Handle new value.
(bug#57147)
* src/keyboard.c (syms_of_keyboard): Update doc string of
`deactivate-mark'.
\f
* Lisp Changes in Emacs 29.1
+---
+** New 'dont-save' value of 'deactivate-mark'.
+This value means that Emacs should deactivate the mark as usual, but
+without setting the primary selection should 'select-active-regions'
+be enabled.
+
+++
** New 'declare' form 'interactive-args'.
This can be used to specify what forms to put into 'command-history'
nothing; but if FORCE is non-nil, it deactivates the mark anyway.
Deactivating the mark sets `mark-active' to nil, updates the
-primary selection according to `select-active-regions', and runs
+primary selection according to `select-active-regions' (unless
+`deactivate-mark' is `dont-save'), and runs
`deactivate-mark-hook'.
If Transient Mark mode was temporarily enabled, reset the value
(when (and (if (eq select-active-regions 'only)
(eq (car-safe transient-mark-mode) 'only)
select-active-regions)
+ (not (eq deactivate-mark 'dont-save))
(region-active-p)
(display-selections-p))
;; The var `saved-region-selection', if non-nil, is the text in
DEFSYM (Qdeactivate_mark, "deactivate-mark");
DEFVAR_LISP ("deactivate-mark", Vdeactivate_mark,
- doc: /* If an editing command sets this to t, deactivate the mark afterward.
+ doc: /* If an editing command sets this to t, deactivate the mark afterward.
The command loop sets this to nil before each command,
and tests the value when the command returns.
-Buffer modification stores t in this variable. */);
+Buffer modification stores t in this variable.
+
+By default, deactivating the mark will save the contents of the region
+according to `select-active-regions'. If this is set to the symbol
+`dont-save', the region will not be saved.*/);
Vdeactivate_mark = Qnil;
Fmake_variable_buffer_local (Qdeactivate_mark);