diff options
| author | Richard M. Stallman | 2002-11-24 19:04:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-11-24 19:04:25 +0000 |
| commit | 09c886dc0946d076c27bba804f3cae01eb5b2971 (patch) | |
| tree | 3c786b1fb2de7a387977a3866c356c9e9b86dd85 /src | |
| parent | 287ef00fa1bbc71cb8429d9a5cfe24203431261a (diff) | |
| download | emacs-09c886dc0946d076c27bba804f3cae01eb5b2971.tar.gz emacs-09c886dc0946d076c27bba804f3cae01eb5b2971.zip | |
(Fcall_interactively): If a command fails because
`*' detects a read-only buffer, but RECORD_FLAG is set,
record it anyway if the args don't actually do tty input.
Diffstat (limited to 'src')
| -rw-r--r-- | src/callint.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/callint.c b/src/callint.c index b1eba9fca18..b4b1e198544 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -221,6 +221,7 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 221 | int arg_from_tty = 0; | 221 | int arg_from_tty = 0; |
| 222 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 222 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 223 | int key_count; | 223 | int key_count; |
| 224 | int record_then_fail = 0; | ||
| 224 | 225 | ||
| 225 | if (NILP (keys)) | 226 | if (NILP (keys)) |
| 226 | keys = this_command_keys, key_count = this_command_key_count; | 227 | keys = this_command_keys, key_count = this_command_key_count; |
| @@ -289,7 +290,7 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 289 | else | 290 | else |
| 290 | goto lose; | 291 | goto lose; |
| 291 | 292 | ||
| 292 | /* If either specs or string is set to a string, use it. */ | 293 | /* If either SPECS or STRING is set to a string, use it. */ |
| 293 | if (STRINGP (specs)) | 294 | if (STRINGP (specs)) |
| 294 | { | 295 | { |
| 295 | /* Make a copy of string so that if a GC relocates specs, | 296 | /* Make a copy of string so that if a GC relocates specs, |
| @@ -373,7 +374,7 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 373 | for (next_event = 0; next_event < key_count; next_event++) | 374 | for (next_event = 0; next_event < key_count; next_event++) |
| 374 | if (EVENT_HAS_PARAMETERS (XVECTOR (keys)->contents[next_event])) | 375 | if (EVENT_HAS_PARAMETERS (XVECTOR (keys)->contents[next_event])) |
| 375 | break; | 376 | break; |
| 376 | 377 | ||
| 377 | /* Handle special starting chars `*' and `@'. Also `-'. */ | 378 | /* Handle special starting chars `*' and `@'. Also `-'. */ |
| 378 | /* Note that `+' is reserved for user extensions. */ | 379 | /* Note that `+' is reserved for user extensions. */ |
| 379 | while (1) | 380 | while (1) |
| @@ -384,7 +385,22 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 384 | { | 385 | { |
| 385 | string++; | 386 | string++; |
| 386 | if (!NILP (current_buffer->read_only)) | 387 | if (!NILP (current_buffer->read_only)) |
| 387 | Fbarf_if_buffer_read_only (); | 388 | { |
| 389 | if (!NILP (record_flag)) | ||
| 390 | { | ||
| 391 | unsigned char *p = string; | ||
| 392 | while (*p) | ||
| 393 | { | ||
| 394 | if (! (*p == 'r' || *p == 'p' || *p == 'P' | ||
| 395 | || *p == '\n')) | ||
| 396 | Fbarf_if_buffer_read_only (); | ||
| 397 | p++; | ||
| 398 | } | ||
| 399 | record_then_fail = 1; | ||
| 400 | } | ||
| 401 | else | ||
| 402 | Fbarf_if_buffer_read_only (); | ||
| 403 | } | ||
| 388 | } | 404 | } |
| 389 | /* Ignore this for semi-compatibility with Lucid. */ | 405 | /* Ignore this for semi-compatibility with Lucid. */ |
| 390 | else if (*string == '-') | 406 | else if (*string == '-') |
| @@ -789,6 +805,9 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 789 | if (varies[i] >= 1 && varies[i] <= 4) | 805 | if (varies[i] >= 1 && varies[i] <= 4) |
| 790 | XSETINT (args[i], marker_position (args[i])); | 806 | XSETINT (args[i], marker_position (args[i])); |
| 791 | 807 | ||
| 808 | if (record_then_fail) | ||
| 809 | Fbarf_if_buffer_read_only (); | ||
| 810 | |||
| 792 | single_kboard_state (); | 811 | single_kboard_state (); |
| 793 | 812 | ||
| 794 | { | 813 | { |