diff options
| author | Eli Zaretskii | 2013-11-16 11:27:19 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-11-16 11:27:19 +0200 |
| commit | 3d6dec8d1ef99202a00c58a6ebdc3aaac7d83de6 (patch) | |
| tree | ed5ad2da4625ee00c65db2fe318e2c717bd4f32f /src/keymap.c | |
| parent | 43cebc237c147aecf53b6d2dc64f5df3e92b4d98 (diff) | |
| download | emacs-3d6dec8d1ef99202a00c58a6ebdc3aaac7d83de6.tar.gz emacs-3d6dec8d1ef99202a00c58a6ebdc3aaac7d83de6.zip | |
Fix bug #15907 with crashes due to after-change-functions.
src/keymap.c (describe_map): Don't crash if PT is 1 both before and
after inserting the description string.
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/keymap.c b/src/keymap.c index 7a18cd5d983..562787ee8a5 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -3383,9 +3383,12 @@ describe_map (Lisp_Object map, Lisp_Object prefix, | |||
| 3383 | 3383 | ||
| 3384 | if (vect[i].shadowed) | 3384 | if (vect[i].shadowed) |
| 3385 | { | 3385 | { |
| 3386 | SET_PT (PT - 1); | 3386 | ptrdiff_t pt = max (PT - 1, BEG); |
| 3387 | |||
| 3388 | SET_PT (pt); | ||
| 3387 | insert_string ("\n (that binding is currently shadowed by another mode)"); | 3389 | insert_string ("\n (that binding is currently shadowed by another mode)"); |
| 3388 | SET_PT (PT + 1); | 3390 | pt = min (PT + 1, Z); |
| 3391 | SET_PT (pt); | ||
| 3389 | } | 3392 | } |
| 3390 | } | 3393 | } |
| 3391 | 3394 | ||