]> git.eshelyaron.com Git - emacs.git/commitdiff
* keyboard.c (command_loop_1): Make sure the mark is really alive
authorChong Yidong <cyd@stupidchicken.com>
Sun, 3 Oct 2010 00:59:02 +0000 (20:59 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 3 Oct 2010 00:59:02 +0000 (20:59 -0400)
before using it (Bug#7044).

src/ChangeLog
src/keyboard.c

index a8ef551d885cb7356eff7dc3046a2b841b969904..ee022b78dddaeef05051dc1477093d5de19fbe32 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-03  Chong Yidong  <cyd@stupidchicken.com>
+
+       * keyboard.c (command_loop_1): Make sure the mark is really alive
+       before using it (Bug#7044).
+
 2010-10-02  Juanma Barranquero  <lekktu@gmail.com>
 
        * makefile.w32-in (tags): Rename target to full-tags.
index 1be6c2aad9d174d7cdc56c58875950db29557cbb..890ab80aee6b5fda1b90edc4640d8780881f87a8 100644 (file)
@@ -1786,7 +1786,8 @@ command_loop_1 (void)
          this_single_command_key_start = 0;
        }
 
-      if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks))
+      if (!NILP (current_buffer->mark_active)
+         && !NILP (Vrun_hooks))
        {
          /* In Emacs 22, setting transient-mark-mode to `only' was a
             way of turning it on for just one command.  This usage is
@@ -1805,6 +1806,9 @@ command_loop_1 (void)
              /* Even if not deactivating the mark, set PRIMARY if
                 `select-active-regions' is non-nil.  */
              if (!NILP (Fwindow_system (Qnil))
+                 /* Even if mark_active is non-nil, the actual buffer
+                    marker may not have been set yet (Bug#7044).  */
+                 && XMARKER (current_buffer->mark)->buffer
                  && (EQ (Vselect_active_regions, Qonly)
                      ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
                      : (!NILP (Vselect_active_regions)