summaryrefslogtreecommitdiff
path: root/devdocs/elisp/initial-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/initial-input.html
new repository
Diffstat (limited to 'devdocs/elisp/initial-input.html')
-rw-r--r--devdocs/elisp/initial-input.html7
1 files changed, 7 insertions, 0 deletions
diff --git a/devdocs/elisp/initial-input.html b/devdocs/elisp/initial-input.html
new file mode 100644
index 00000000..6d527201
--- /dev/null
+++ b/devdocs/elisp/initial-input.html
@@ -0,0 +1,7 @@
+ <h3 class="section">Initial Input</h3> <p>Several of the functions for minibuffer input have an argument called <var>initial</var>. This is a mostly-deprecated feature for specifying that the minibuffer should start out with certain text, instead of empty as usual. </p> <p>If <var>initial</var> is a string, the minibuffer starts out containing the text of the string, with point at the end, when the user starts to edit the text. If the user simply types <tt class="key">RET</tt> to exit the minibuffer, it will use the initial input string to determine the value to return. </p> <p><strong>We discourage use of a non-<code>nil</code> value for <var>initial</var></strong>, because initial input is an intrusive interface. History lists and default values provide a much more convenient method to offer useful default inputs to the user. </p> <p>There is just one situation where you should specify a string for an <var>initial</var> argument. This is when you specify a cons cell for the <var>history</var> argument. See <a href="minibuffer-history">Minibuffer History</a>. </p> <p><var>initial</var> can also be a cons cell of the form <code>(<var>string</var>
+. <var>position</var>)</code>. This means to insert <var>string</var> in the minibuffer but put point at <var>position</var> within the string’s text. </p> <p>As a historical accident, <var>position</var> was implemented inconsistently in different functions. In <code>completing-read</code>, <var>position</var>’s value is interpreted as origin-zero; that is, a value of 0 means the beginning of the string, 1 means after the first character, etc. In <code>read-minibuffer</code>, and the other non-completion minibuffer input functions that support this argument, 1 means the beginning of the string, 2 means after the first character, etc. </p> <p>Use of a cons cell as the value for <var>initial</var> arguments is deprecated. </p><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/Initial-Input.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Initial-Input.html</a>
+ </p>
+</div>