如何修复 Common Lisp REPL 中 <TAB> 触发的自动文档查找的 URL?

How do I fix the URL for the <TAB>-triggered automatic documentation lookup in the Common Lisp REPL?

概要

我正在努力变得能够使用 Lisp。虽然我很舒服 其他解释器的命令行和各种 REPL(即 pythonirb/pry, perl -d), 当它出现的时候我总是感觉自己像个新手 Lisp,出于某种原因。

在 Common Lisp REPL (clisp) 中,当我在 a 的末尾使用键时 函数名,好像是想给我提供参考信息 关于那个功能。这听起来该死的有用..如果它真的有效的话。以下 当我这样做时实际发生了什么。据我所知,这似乎是 查找 URL 上没有(或不再)exist/s 的函数。也许 HyperSpec 移动了吗?解决这个问题的正确方法是什么?我该怎么办?

附录

我怎么样 运行 Lisp

$ uname -a
Linux bob 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ clisp --version
GNU CLISP 2.49 (2010-07-07) (built on toyol.buildd [127.0.1.1])
Software: GNU C 4.8.2 
gcc -falign-functions=4 -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -Wno-sign-compare -Wno-format-nonliteral -O -falign-functions=4 -DENABLE_UNICODE -DDYNAMIC_FFI -DDYNAMIC_MODULES -I.  -lreadline -lncurses -ldl /usr/lib/libavcall.so /usr/lib/libcallback.so  -lsigsegv libgnu_cl.a 
SAFETY=0 TYPECODES WIDE_HARD GENERATIONAL_GC SPVW_BLOCKS SPVW_MIXED TRIVIALMAP_MEMORY
libsigsegv 2.10
libreadline 5.2
libffcall 1.11
Features: 
(READLINE REGEXP SYSCALLS I18N LOOP COMPILER CLOS MOP CLISP ANSI-CL COMMON-LISP LISP=CL INTERPRETER SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES SCREEN
 FFI GETTEXT UNICODE BASE-CHAR=CHARACTER WORD-SIZE=64 PC386 UNIX)
C Modules: (clisp i18n syscalls regexp readline)
Installation directory: /usr/lib/clisp-2.49/
User language: ENGLISH
Machine: X86_64 (X86_64) bob [127.0.1.1]

系统当前安装的 Lisp 相关包

$ aptitude search lisp | grep '^i'
i   clisp                           - GNU CLISP, a Common Lisp implementation   
i   clisp-doc                       - GNU CLISP, a Common Lisp implementation (d
i A common-lisp-controller          - Common Lisp source and compiler manager   
i   dh-lisp                         - Debhelper to support Common Lisp related p

当我尝试查找函数时得到的结果:

$ clisp -q
[1]> (write-line <TAB><TAB>

WRITE-LINE is the symbol WRITE-LINE, lies in #<PACKAGE COMMON-LISP>, is accessible in 11 packages CLOS, COMMON-LISP, COMMON-LISP-USER, EXPORTING,
EXT, FFI, POSIX, READLINE, REGEXP, SCREEN, SYSTEM, names a
;; connecting to "http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Data/Map_Sym.txt"...connected...HTTP/1.1 404 Not Found
;; "Date: Tue, 04 Oct 2016 02:34:52 GMT"
;; "Server: Apache/2.2.16 (Debian)"
;; "Content-Length: 333"
;; "Connection: close"
;; "Content-Type: text/html; charset=iso-8859-1"
;; ""
;; "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">"
;; "<html><head>"
;; "<title>404 Not Found</title>"
;; "</head><body>"
;; "<h1>Not Found</h1>"
;; "<p>The requested URL /projects/iiip/doc/CommonLISP/HyperSpec/Data/Map_Sym.txt was not found on this server.</p>"
;; "<hr>"
;; "<address>Apache/2.2.16 (Debian) Server at www.ai.mit.edu Port 80</address>"
;; "</body></html>"
;; connecting to "http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Data/Symbol-Table.text"...connected...HTTP/1.1 200 OK...45,322 bytes
;; SYSTEM::GET-CLHS-MAP(#<IO INPUT-BUFFERED SOCKET-STREAM CHARACTER www.ai.mit.edu:80>)...978/978 symbols
 function.
ANSI-CL Documentation is at
"http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_write-str_m_write-line.html"
;; connecting to "http://clisp.cons.org/impnotes/id-href.map"...connected...HTTP/1.1 302 Found --> "https://clisp.cons.org:80/impnotes/id-href.map"
;; connecting to "http://clisp.cons.orghttps://clisp.cons.org:80/impnotes/id-href.map"...
*** - PARSE-INTEGER: substring "" does not have integer syntax at position 0
The following restarts are available:
ABORT          :R1      Abort main loop
Break 1 [2]> 

我觉得this article应该对你有帮助。

本质上,您必须设置 CUSTOM:*BROWSERS* 列表,以便 clisp 知道如何打开文档。

在你的.clisprc.lisp

(setf CUSTOM:*BROWSERS* '(
   (:CHROMIUM "/usr/bin/chromium" "~a")))
(setf CUSTOM:*BROWSER* :CHROMIUM)
(setf CUSTOM:CLHS-ROOT "http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/FrontMatter/")

但是你必须在你的系统上安装 chromium。但是你明白了。