[Top][All Lists]

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

`insert' deactivates active region

From: Katsumi Yamaoka
Subject: `insert' deactivates active region
Date: Thu, 07 Jul 2005 18:08:54 +0900
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)


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.  Furthermore, M-w cannot be used to copy
text, either.

(let ((buffer (get-buffer-create "*testing*")))
  (pop-to-buffer buffer)
  (insert "Hello World\n")
  (goto-char (point-min))
  (set (make-local-variable 'transient-mark-mode) t)
  (add-hook 'post-command-hook
            (lambda nil
                (insert "foo")
            nil t))

One of the ways to solve the problem I found is to remove the
`(insert "foo")' line.  This problem occurs not only with Emacs
22, but also 21 and 20.  A similar code is used in emacs-w3m and
we are discussing the solution which is effective on all Emacs
versions (there's already a promising solution).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]