emacs.d/clones/lisp/www.cliki.net/Linedit.html
2022-10-07 15:47:14 +02:00

79 lines
No EOL
9.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CLiki: Linedit</title>
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
href="https://www.cliki.net/site/feed/article.atom?title=Linedit">
<link rel="stylesheet" href="static/css/style.css">
<link rel="stylesheet" href="static/css/colorize.css">
</head>
<body>
<span class="hidden">CLiki - Linedit</span>
<div id="content"><div id="content-area"><div id="article-title">Linedit</div><div id="article">Linedit is a portable line-editing <a href="console.html" class="category">console</a> library for Common Lisp.<p>Successor to <a href="cl-readline.html" class="internal">cl-readline</a>.<p>More information on <a href="http://common-lisp.net/project/linedit/">
Linedit homepage</a>.<p><b>New in release 0.16:</b>
<ul>
<li>Should work on Lispworks and OpenMCL/CCL.</li>
</ul><p>Bug-reports appreciated. Patches appreciated even more.<p>
<i>Well, submitting bugs and patches is not allowed at all without having a pre-existing gitlab account, there's no apparant way to get a gitlab account, and the mailing list link leads to a 404 page not found, so perhaps bug-reports and patches aren't all that appreciated after all. But maybe you meant submitting bug reports on the page here? I can do that!<p>This is for SBCL 1.2.10 on Arch Linux, readline library version 6.3<ul>
<li>pressing "Up-arrow" introduces garbage binary data to the input, if you are at the beginning of input history. Checking whether you are at the beginning of a list is pretty basic stuff... so this package should probably do that.</li>
<li>I don't know why I was having trouble with end-of-file conditions. It started working for some reason, ctrl-d and it prompts and lets me exit.</li>
</ul>
Might offer some patches later, but of course I can't send them to common-lisp.net without a gitlab account.
</i> <p>-- <a href="cy.html" class="internal">cy</a><p>Installing <a href="Linedit.html" class="internal">Linedit</a> as REPL for <a href="SBCL.html" class="internal">SBCL</a> without disturbing <a href="ILISP.html" class="internal">ILISP</a> or <a href="SLIME.html" class="internal">SLIME</a> requires some tweaking:<p>In your <tt>.sbclrc</tt>:
<div class="code"><span class="nonparen"><span class="comment">;;; Check for --no-linedit command-line option.
</span><span class="paren1">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/speope_if.html" class="symbol"><i><span class="symbol">if</span></i></a> <span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/any_member.html" class="symbol">member</a> <span class="string">"--no-linedit"</span> <span class="special">sb-ext:*posix-argv*</span> <span class="keyword">:test</span> '<a href="https://www.cliki.net/site/HyperSpec/Body/fun_equal.html" class="symbol">equal</a></span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/any_setf.html" class="symbol">setf</a> <span class="special">sb-ext:*posix-argv*</span>
<span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_removecm__elete-if-not.html" class="symbol">remove</a> <span class="string">"--no-linedit"</span> <span class="special">sb-ext:*posix-argv*</span> <span class="keyword">:test</span> '<a href="https://www.cliki.net/site/HyperSpec/Body/fun_equal.html" class="symbol">equal</a></span>)</span></span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/mac_whencm_unless.html" class="symbol">when</a> <span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_interactive-stream-p.html" class="symbol">interactive-stream-p</a> <a href="https://www.cliki.net/site/HyperSpec/Body/var_stterminal-iost.html" class="symbol"><span class="special">*terminal-io*</span></a></span>)</span>
<span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_providecm_require.html" class="symbol">require</a> <span class="keyword">:sb-aclrepl</span></span>)</span>
<span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_providecm_require.html" class="symbol">require</a> <span class="keyword">:linedit</span></span>)</span>
<span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_funcall.html" class="symbol">funcall</a> <span class="paren4">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_intern.html" class="symbol">intern</a> <span class="string">"INSTALL-REPL"</span> <span class="keyword">:linedit</span></span>)</span> <span class="keyword">:wrap-current</span> <a href="https://www.cliki.net/site/HyperSpec/Body/any_t.html" class="symbol">t</a></span>)</span></span>)</span></span>)</span>
</span></div><p>And then in your <tt>.emacs</tt>:
<pre>
(setq inferior-lisp-program &quot;sbcl --noinform --no-linedit&quot;)
</pre><p>You might also want to add <tt>:eof-quits t</tt> to the <tt>install-repl</tt> form.<p><hr><p>Another way is instead to say in your <tt>.sbclrc</tt>
<div class="code"><span class="nonparen"><span class="paren1">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/mac_whencm_unless.html" class="symbol">when</a> <span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/any_and.html" class="symbol">and</a> <span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_interactive-stream-p.html" class="symbol">interactive-stream-p</a> <a href="https://www.cliki.net/site/HyperSpec/Body/var_stterminal-iost.html" class="symbol"><span class="special">*terminal-io*</span></a></span>)</span>
<span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/any_null.html" class="symbol">null</a> <span class="paren4">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_find-package.html" class="symbol">find-package</a> 'swank</span>)</span></span>)</span></span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_providecm_require.html" class="symbol">require</a> <span class="keyword">:linedit</span></span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_funcall.html" class="symbol">funcall</a> <span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_intern.html" class="symbol">intern</a> <span class="string">"INSTALL-REPL"</span> <span class="keyword">:linedit</span></span>)</span> <span class="keyword">:wrap-current</span> <a href="https://www.cliki.net/site/HyperSpec/Body/any_t.html" class="symbol">t</a></span>)</span></span>)</span>
</span></div><p>which doesn't require having a separate file for your ordinary initialization code. -- <a href="James&#32;A.&#32;Crippen.html" class="internal">James A. Crippen</a><p><i>How do you make this second method work? I can't and don't see how since
SBCL by necessity processes its initfiles before it gets around loading swank. -- <a href="Nikodemus&#32;Siivola.html" class="internal">Nikodemus Siivola</a></i></div></div>
<div id="footer" class="buttonbar"><ul><li><a href="Linedit.html">Current version</a></li>
<li><a href="https://www.cliki.net/site/history?article=Linedit">History</a></li>
<li><a href="https://www.cliki.net/site/backlinks?article=Linedit">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=Linedit&amp;from-revision=3686417450">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
</div>
<div id="header-buttons" class="buttonbar">
<ul>
<li><a href="https://www.cliki.net/">Home</a></li>
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
<li><a href="CLiki.html">About</a></li>
<li><a href="Text&#32;Formatting.html">Text Formatting</a></li>
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
</ul>
<div id="search">
<form action="https://www.cliki.net/site/search">
<label for="search_query" class="hidden">Search CLiki</label>
<input type="text" name="query" id="search_query" value="" />
<input type="submit" value="search" />
</form>
</div>
</div>
<div id="pageheader">
<div id="header">
<span id="logo">CLiki</span>
<span id="slogan">the common lisp wiki</span>
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
<label for="login_name" class="hidden">Account name</label>
<input type="text" name="name" id="login_name" class="login_input" />
<label for= "login_password" class="hidden">Password</label>
<input type="password" name="password" id="login_password" class="login_input" />
<input type="submit" name="login" value="login" id="login_submit" /><br />
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
</form>
</div>
</div>
</div>
</body></html>