Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
3a2485be
Commit
3a2485be
authored
Feb 25, 1995
by
Richard M. Stallman
Browse files
Warn that interactive should get point and mark only after minibuffer input.
parent
39a185a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
lispref/commands.texi
lispref/commands.texi
+25
-0
No files found.
lispref/commands.texi
View file @
3a2485be
...
...
@@ -178,6 +178,31 @@ form that is evaluated to get a list of arguments to pass to the
command.
@cindex argument evaluation form
If this expression reads keyboard input (this includes using the
minibuffer), keep in mind that the integer value of point or the mark
before reading input may be incorrect after reading input. This is
because the current buffer may be receiving subprocess output;
if subprocess output arrives while the command is waiting for input,
it could relocate point and the mark.
Here's an example of what @emph{not} to do:
@smallexample
(interactive
(list (region-beginning) (region-end)
(read-string "Foo: " nil 'my-history)))
@end smallexample
@noindent
Here's how to avoid the problem, by examining point and the mark only
after reading the keyboard input:
@smallexample
(interactive
(let ((string (read-string "Foo: " nil 'my-history)))
(list (region-beginning) (region-end) string)))
@end smallexample
@item
@cindex argument prompt
It may be a string; then its contents should consist of a code character
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment