[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `insert' deactivates active region
From: |
Stefan Monnier |
Subject: |
Re: `insert' deactivates active region |
Date: |
Fri, 08 Jul 2005 01:18:51 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> (let ((buffer (get-buffer-create "*testing*")))
> (pop-to-buffer buffer)
> (erase-buffer)
> (insert "Hello World\n")
> (goto-char (point-min))
> (set (make-local-variable 'transient-mark-mode) t)
> (add-hook 'post-command-hook
> (lambda nil
> (with-temp-buffer
> (insert "foo")
> ))
> nil t))
The way Emacs detects when to deactivate the mark is by making all
buffer-modifying functions set the deactivate-mark variable. This variable
is not buffer-local so a modification in one buffer can (incorrectly)
deactivate the mark in another, as in your example.
Until this is fixed, the typical workaround is to wrap your buffer
modification in (let (deactivate-mark) ...).
Stefan
- Re: [emacs-w3m:08264] `insert' deactivates active region, (continued)
- Re: [emacs-w3m:08264] `insert' deactivates active region, Masatake YAMATO, 2005/07/07
- Re: `insert' deactivates active region, Katsumi Yamaoka, 2005/07/07
- Re: `insert' deactivates active region, Masatake YAMATO, 2005/07/07
- Re: `insert' deactivates active region, Katsumi Yamaoka, 2005/07/08
- Re: `insert' deactivates active region, Stefan Monnier, 2005/07/08
- Re: `insert' deactivates active region, Richard M. Stallman, 2005/07/08
- Re: `insert' deactivates active region, Clemens Fischer, 2005/07/09
- Re: `insert' deactivates active region, Stefan Monnier, 2005/07/11
Re: `insert' deactivates active region, Richard M. Stallman, 2005/07/08
Re: `insert' deactivates active region,
Stefan Monnier <=