summaryrefslogtreecommitdiff
path: root/src/callint.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-11-24 19:04:25 +0000
committerRichard M. Stallman <rms@gnu.org>2002-11-24 19:04:25 +0000
commit09c886dc0946d076c27bba804f3cae01eb5b2971 (patch)
tree3c786b1fb2de7a387977a3866c356c9e9b86dd85 /src/callint.c
parent287ef00fa1bbc71cb8429d9a5cfe24203431261a (diff)
downloademacs-09c886dc0946d076c27bba804f3cae01eb5b2971.tar.gz
(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/callint.c')
-rw-r--r--src/callint.c25
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. */)
int arg_from_tty = 0;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
int key_count;
+ int record_then_fail = 0;
if (NILP (keys))
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. */)
else
goto lose;
- /* If either specs or string is set to a string, use it. */
+ /* If either SPECS or STRING is set to a string, use it. */
if (STRINGP (specs))
{
/* 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. */)
for (next_event = 0; next_event < key_count; next_event++)
if (EVENT_HAS_PARAMETERS (XVECTOR (keys)->contents[next_event]))
break;
-
+
/* Handle special starting chars `*' and `@'. Also `-'. */
/* Note that `+' is reserved for user extensions. */
while (1)
@@ -384,7 +385,22 @@ supply if the command inquires which events were used to invoke it. */)
{
string++;
if (!NILP (current_buffer->read_only))
- Fbarf_if_buffer_read_only ();
+ {
+ if (!NILP (record_flag))
+ {
+ unsigned char *p = string;
+ while (*p)
+ {
+ if (! (*p == 'r' || *p == 'p' || *p == 'P'
+ || *p == '\n'))
+ Fbarf_if_buffer_read_only ();
+ p++;
+ }
+ record_then_fail = 1;
+ }
+ else
+ Fbarf_if_buffer_read_only ();
+ }
}
/* Ignore this for semi-compatibility with Lucid. */
else if (*string == '-')
@@ -789,6 +805,9 @@ supply if the command inquires which events were used to invoke it. */)
if (varies[i] >= 1 && varies[i] <= 4)
XSETINT (args[i], marker_position (args[i]));
+ if (record_then_fail)
+ Fbarf_if_buffer_read_only ();
+
single_kboard_state ();
{