[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `insert' deactivates active region
>>>>> In <firstname.lastname@example.org> Masatake YAMATO wrote:
> Yamaoka-san, could you try this code?
> (insert "foo")
> (setq deactivate-mark nil)
> (let (deactivate-mark)
> (insert "foo"))
Oh, I didn't know such a special variable. That solution seems
very good! I confirmed it is effective in Emacs 20 through 23.
> If you think this work-around is not enough, talk to emacs-devel.
> I'll write a report my investigation about this bug.
Is it really a bug? The docstring for the deactivate-mark
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.
Now I came to think it is no wonder that `insert' sets
`deactivate-mark', because `insert' really edits the buffer.
The real trouble is that we didn't know it, isn't it? ;-)