summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-10-02 20:59:02 -0400
committerChong Yidong <cyd@stupidchicken.com>2010-10-02 20:59:02 -0400
commit6926550f39269b4fd2717f2e5eba8b51ac044fea (patch)
tree2c6aa34d0fe6a811a35d902b50c6d20b0afdcbfd /src/keyboard.c
parent870409d4fb06834c28e75cd653ad8aa2a7e8f581 (diff)
downloademacs-6926550f39269b4fd2717f2e5eba8b51ac044fea.tar.gz
emacs-6926550f39269b4fd2717f2e5eba8b51ac044fea.tar.bz2
emacs-6926550f39269b4fd2717f2e5eba8b51ac044fea.zip
* keyboard.c (command_loop_1): Make sure the mark is really alive
before using it (Bug#7044).
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 1be6c2aad9d..890ab80aee6 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -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)