summaryrefslogtreecommitdiff
path: root/devdocs/elisp/quoted-character-input.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/quoted-character-input.html
new repository
Diffstat (limited to 'devdocs/elisp/quoted-character-input.html')
-rw-r--r--devdocs/elisp/quoted-character-input.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/devdocs/elisp/quoted-character-input.html b/devdocs/elisp/quoted-character-input.html
new file mode 100644
index 00000000..bf327981
--- /dev/null
+++ b/devdocs/elisp/quoted-character-input.html
@@ -0,0 +1,18 @@
+ <h4 class="subsection">Quoted Character Input</h4> <p>You can use the function <code>read-quoted-char</code> to ask the user to specify a character, and allow the user to specify a control or meta character conveniently, either literally or as an octal character code. The command <code>quoted-insert</code> uses this function. </p> <dl> <dt id="read-quoted-char">Function: <strong>read-quoted-char</strong> <em>&amp;optional prompt</em>
+</dt> <dd>
+ <p>This function is like <code>read-char</code>, except that if the first character read is an octal digit (0–7), it reads any number of octal digits (but stopping if a non-octal digit is found), and returns the character represented by that numeric character code. If the character that terminates the sequence of octal digits is <tt class="key">RET</tt>, it is discarded. Any other terminating character is used as input after this function returns. </p> <p>Quitting is suppressed when the first character is read, so that the user can enter a <kbd>C-g</kbd>. See <a href="quitting">Quitting</a>. </p> <p>If <var>prompt</var> is supplied, it specifies a string for prompting the user. The prompt string is always displayed in the echo area, followed by a single ‘<samp>-</samp>’. </p> <p>In the following example, the user types in the octal number 177 (which is 127 in decimal). </p> <div class="example"> <pre class="example">(read-quoted-char "What character")
+
+</pre>
+<pre class="example">---------- Echo Area ----------
+What character <kbd>1 7 7</kbd>-
+---------- Echo Area ----------
+
+ ⇒ 127
+</pre>
+</div> </dd>
+</dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Quoted-Character-Input.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Quoted-Character-Input.html</a>
+ </p>
+</div>