[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: `insert' deactivates active region



> Please read and try the following Lisp code.  In the *testing*
> buffer, you may see you cannot activate the region by using
> C-SPC and C-f, etc.

I could reproduce this bug with your example.

> Furthermore, M-w cannot be used to copy
> text, either.

Here is a work-around:

(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)
  (set (make-local-variable 'mark-even-if-inactive) t)
  (add-hook 'post-command-hook
	    (lambda nil
	      (with-temp-buffer
		(insert "foo")
		))
	    nil t))

Masatake YAMATO