Subject: bug#3350: 23.0.93; Deactivation of region by the insert function

From: Lennart Borgman <[email-masked]>
Date: Fri, 22 May 2009 14:45:59 +0200

Start from

  emacs -Q

and enter this in the *scratch* buffer and eval it:

(defvar msgtrc-buffer
  "*Messages*"
  "Buffer or name of buffer for trace messages.
See `msgtrc'.")

(defun msgtrc (format-string &rest args)
  "Print message to `msgtrc-buffer'.
Arguments FORMAT-STRING and ARGS are like for `message'."
  (let ((trc-buffer (get-buffer-create msgtrc-buffer)))
    (with-current-buffer trc-buffer
      (goto-char (point-max))
      ;;(insert "MU:" (apply 'format format-string args) "\n")
      (insert "constant string\n")
      (when buffer-file-name (write-region nil nil buffer-file-name)))))

(defun msgtrc-post-command ()
  (msgtrc "msgtrc post-command here"))

(add-hook 'post-command-hook 'msgtrc-post-command nil t)

Then try activating the region with S-<arrow key>. This does not work.
However if the (insert ...) statement in msgtrc is commented out then
it works.

I have not tested if this is a regression from Emacs 22.

In GNU Emacs 23.0.93.1 (i386-mingw-nt5.1.2600)
 of 2009-05-03
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/g/include -fno-crossjumping'