[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `insert' deactivates active region
>>>>> In <email@example.com> Masatake YAMATO wrote:
> I could reproduce this bug with your example.
Thanks for the confirmation.
> Here is a work-around:
> (set (make-local-variable 'mark-even-if-inactive) t)
It enables users to copy or kill the region. However, that the
region is not highlighted does not satisfy those who use the
transient-mark-mode. The solution I'm testing now is:
(let ((buffer (get-buffer-create "*testing*")))
(insert "Hello World\n")
(set (make-local-variable 'transient-mark-mode) t)
(let ((mk (when (and transient-mark-mode mark-active)
(run-at-time 1e-9 nil #'push-mark mk t t)))))