emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: `insert' deactivates active region


From: Katsumi Yamaoka
Subject: Re: `insert' deactivates active region
Date: Fri, 08 Jul 2005 10:05:30 +0900
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>>>>> In <address@hidden> 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*")))
  (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
              (let ((mk (when (and transient-mark-mode mark-active)
                          (mark))))
                (prog1
                    (with-temp-buffer
                      (insert "foo")
                      )
                  (when mk
                    (run-at-time 1e-9 nil #'push-mark mk t t)))))
            nil t))




reply via email to

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