diff options
| -rw-r--r-- | src/abbrev.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/abbrev.c b/src/abbrev.c index 244d530c464..e4a33941247 100644 --- a/src/abbrev.c +++ b/src/abbrev.c | |||
| @@ -229,7 +229,9 @@ Returns t if expansion took place.") | |||
| 229 | expansion". */ | 229 | expansion". */ |
| 230 | value = (MODIFF != oldmodiff ? Qt : Qnil); | 230 | value = (MODIFF != oldmodiff ? Qt : Qnil); |
| 231 | 231 | ||
| 232 | if (XBUFFER (Vabbrev_start_location_buffer) != current_buffer) | 232 | wordstart = 0; |
| 233 | if (!(BUFFERP (Vabbrev_start_location_buffer) && | ||
| 234 | XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) | ||
| 233 | Vabbrev_start_location = Qnil; | 235 | Vabbrev_start_location = Qnil; |
| 234 | if (!NILP (Vabbrev_start_location)) | 236 | if (!NILP (Vabbrev_start_location)) |
| 235 | { | 237 | { |
| @@ -237,10 +239,12 @@ Returns t if expansion took place.") | |||
| 237 | CHECK_NUMBER_COERCE_MARKER (tem, 0); | 239 | CHECK_NUMBER_COERCE_MARKER (tem, 0); |
| 238 | wordstart = XINT (tem); | 240 | wordstart = XINT (tem); |
| 239 | Vabbrev_start_location = Qnil; | 241 | Vabbrev_start_location = Qnil; |
| 240 | if (FETCH_CHAR (wordstart) == '-') | 242 | if (wordstart < BEGV || wordstart > ZV) |
| 243 | wordstart = 0; | ||
| 244 | if (wordstart && wordstart != ZV && FETCH_CHAR (wordstart) == '-') | ||
| 241 | del_range (wordstart, wordstart + 1); | 245 | del_range (wordstart, wordstart + 1); |
| 242 | } | 246 | } |
| 243 | else | 247 | if (!wordstart) |
| 244 | wordstart = scan_words (point, -1); | 248 | wordstart = scan_words (point, -1); |
| 245 | 249 | ||
| 246 | if (!wordstart) | 250 | if (!wordstart) |