Error starting sbcl under slime on Vista - emacs

I'm having trouble getting SBCL to start under slime. I've messed things up and I don't know how to recover. This was working fine until I...
Had a problem loading a package via asdf. At which point I started debugging the asdf.lisp provided with SBCL to see what was going wrong. The sole change I made was to put a (break) in which I removed once I'd figured out what was wrong. All was fine until the next time I tried to start SBCL.
Then I got a swank compilation error saying that the asdf.fasl was older than the asdf.lisp file. That made sense to me so I recompiled the asdf.fasl. The output I'm now getting is:
(progn (load "c:\\emacs-23.1\\site-lisp\\slime\\swank-loader.lisp" :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") "c:\\Users\\GILESR~1\\AppData\\Local\\Temp\\slime.3068" :coding-system "iso-latin-1-unix"))
This is SBCL 1.0.37, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
This is experimental prerelease support for the Windows platform: use
at your own risk. "Your Kitten of Death awaits!"
*
; loading #P"c:\\emacs-23.1\\site-lisp\\slime\\swank-loader.lisp"
; loading #P"c:\\hacking\\emacs\\.slime\\fasl\\2010-07-30\\sbcl-1.0.37-win32-x86\\swank-backend.fasl"
; loading #P"c:\\hacking\\emacs\\.slime\\fasl\\2010-07-30\\sbcl-1.0.37-win32-x86\\swank-source-path-parser.fasl"
; loading #P"c:\\hacking\\emacs\\.slime\\fasl\\2010-07-30\\sbcl-1.0.37-win32-x86\\swank-source-file-cache.fasl"
; compiling file "c:\\emacs-23.1\\site-lisp\\slime\\swank-sbcl.lisp" (written 22 JUL 2010 08:15:02 AM):
; file: c:\emacs-23.1\site-lisp\slime\swank-sbcl.lisp
; in: EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
; (REQUIRE 'SWANK-BACKEND::SB-BSD-SOCKETS)
;
; caught ERROR:
; (during compile-time-too processing)
; The function ASDF::MODULE-PROVIDE-ASDF is undefined.
; (REQUIRE 'SWANK-BACKEND::SB-INTROSPECT)
;
; caught ERROR:
; (during compile-time-too processing)
; The function ASDF::MODULE-PROVIDE-ASDF is undefined.
; (REQUIRE 'SWANK-BACKEND::SB-POSIX)
;
; caught ERROR:
; (during compile-time-too processing)
; The function ASDF::MODULE-PROVIDE-ASDF is undefined.
; (REQUIRE 'SWANK-BACKEND::SB-CLTL2)
;
; caught ERROR:
; (during compile-time-too processing)
; The function ASDF::MODULE-PROVIDE-ASDF is undefined.
;
; compilation unit aborted
; caught 1 fatal ERROR condition
; caught 4 ERROR conditions
;
; compilation aborted because of fatal error:
; SB-INT:SIMPLE-READER-PACKAGE-ERROR at 1839 (line 62, column 18) on #<SB-SYS:FD-STREAM
; for "file c:\\emacs-23.1\\site-lisp\\slime\\swank-sbcl.lisp"
; {24564B89}>:
; package "SB-POSIX" not found
; ; compilation aborted after 0:00:00.045
;;
;; Error while compiling c:\emacs-23.1\site-lisp\slime\swank-sbcl.lisp:
;; COMPILE-FILE returned NIL.
;; Aborting.
So it's not finding some stuff it needs in my recompiled asdf. In order to resolve this I've done a complete uninstall and reinstall of SBCL. No joy. I've got nothing in my .sbclrc either.
Update: On viewing the asdf.lisp source code the missing functions are definitely in the file. The thing that's preventing them from compiling is I think the line:
#+(and sbcl sbcl-hooks-require)
My knowledge of lisp is currently not sufficient to compile the asdf file in the environment to trigger the above conditional compilation statement.

I've sorted the problem using the following steps:
Fire up sbcl from Windows start menu.
Run the following code to add the sbcl-hooks-require symbol to the feature list:
(push :sbcl-hooks-require features)
Recompile asdf.lisp. In order to do this I needed to recompile asdf outside of the installed C:\Program files\Steel... directory as the UAC on Windows Vista will stop the fasl being written. For example:
(compile-file "C:\foobar\asdf.lisp")
Copy the generated fasl back to C:\Program files\Steel... to overwrite the original fasl.
Update: The formatting on stackoverflow has knocked out some of the code bits. The code should be as follows:
(push :sbcl-hooks-require *features*)
(compile-file "C:\\foobar\\asdf.lisp")

Related

M1 mac error: Emacs error "Failed to initialize color list unarchiver" when I call it in the terminal, why does it happen and how to fix?

I saw this question Emacs error "Failed to initialize color list unarchiver" when I call it in the terminal but it didn't help. I get the similar error but for m1 chip instead of intel x86 I think:
2022-04-14 17:08:00.370 Emacs-arm64-12[24779:1101019] Failed to initialize color list unarchiver: Error Domain=NSCocoaErrorDomain Code=4864 "*** -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: non-keyed archive cannot be decoded by NSKeyedUnarchiver" UserInfo={NSDebugDescription=*** -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: non-keyed archive cannot be decoded by NSKeyedUnarchiver}
I added the command I was told to my .emacs but it didn't help:
(meta_learning) brandomiranda~/coq4brando/cs598 ❯ cat ~/.emacs
;; Open .v files with Proof General's Coq mode
(load "~/.emacs.d/lisp/PG/generic/proof-site")
(add-to-list 'load-path "~/evil")
(require 'evil)
(evil-mode 1)
(load-file (let ((coding-system-for-read 'utf-8))
(shell-command-to-string "agda-mode locate")))
(delete-file "~/Library/Colors/Emacs.clr")
why is this error happening and how do I remove it?

Emacs failed to load initialization file

I am using Emacs 25.3 under windows 10 platform.
It works fine until one time I started it and got the following message:
Warning (initialization): An error occurred while loading ‘
c:/Users/shore/AppData/Roaming/.emacs’:
Wrong type argument: listp, <html>
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.
As instructed I used --debug-init option to start and got the following message:
Debugger entered--Lisp error: (wrong-type-argument listp <html>)
package--read-archive-file("archives/gnu/archive-contents")
package-read-archive-contents("gnu")
package-read-all-archive-contents()
package-initialize()
eval-buffer(#<buffer *load*> nil "c:/Users/shore/AppData/Roaming/.emacs" nil t) ; Reading at buffer position 275
load-with-code-conversion("c:/Users/shore/AppData/Roaming/.emacs" "c:/Users/shore/AppData/Roaming/.emacs" t t)
load("~/.emacs" t t)
[init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" initialization format-message "`_emacs' init file is deprecated, please use `.emacs'" "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7]()
command-line()
normal-top-level()
Can anyone tell me where my problem is and how to fix it?
It's telling you that when it tried to read file archives/gnu/archive-contents it expected to read Lisp (more specifically a Lisp list). Instead, it encountered <html> (presumably text in the file).
A guess is that you somehow downloaded or picked up an HTML file (perhaps one that describes the archive file or that has links to download it) instead of downloading or picking up a file of Lisp code. Try once again to obtain that archive file.

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

SYNOPSIS
I'm trying to become competent at using Lisp. Though I'm very comfortable with
the command line and various REPLs for other interpreters (i.e. python,
irb/pry, perl -d), I keep feeling like an absolute newbie when it comes
to Lisp, for some reason.
In the Common Lisp REPL (clisp), when I use the key at the end of a
function name, it seems to be trying to provide me with reference information
about that function. This sounds damn useful.. if it actually worked. Below
is what actually happens when I do this. As far as I can tell, it seems to be
looking up the functions on a URL that doesn't (or no longer) exist/s. Perhaps
the HyperSpec has moved? What's the right way to fix this? What should I do?
ADDENDA
How I'm running 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-related packages currently installed on the system
$ 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
What I get when I try to look up a function:
$ 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]>
I think this article should help you.
In essence you have to set up your CUSTOM:*BROWSERS* list, so clisp knows how to open the documentation.
In your .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/")
But you have to have chromium installed on your system. But you get the idea.

repl hangs for ~15 seconds on each error (emacs + cider + boot)

I'm facing a strange behavior whenever I invoke an error in boot-cljs-repl. The repl (actually the entire emacs) hangs for about 15 seconds and after that I see the following error message below the mode-line:
error in process filter: Lisp nesting exceedsmax-lisp-eval-depth'`
An error would e.g be calling (some-nonexisting-function) from the REPL.
Additionally I get an error message inside the REPL itself. Sorry, for posting the whole thing here - I wouldn't know right now which parts are important:
box.webgl> (some-nonexisting-function)
WARNING: Use of undeclared Var box.webgl/some-nonexisting-function at line 1 <cljs repl>
#object[TypeError TypeError: Cannot read property 'call' of undefined]
TypeError: Cannot read property 'call' of undefined
at eval (eval at <anonymous> (http://localhost:3000/main.out/weasel/repl.js:30:470), <anonymous>:1\
:124)
at eval (eval at <anonymous> (http://localhost:3000/main.out/weasel/repl.js:30:470), <anonymous>:9\
:3)
at eval (eval at <anonymous> (http://localhost:3000/main.out/weasel/repl.js:30:470), <anonymous>:1\
4:4)
at http://localhost:3000/main.out/weasel/repl.js:30:465
at http://localhost:3000/main.out/weasel/repl.js:39:4
at cljs.core.MultiFn.call.G__10839__2 (http://localhost:3000/main.out/cljs/core.js:33327:106)
at cljs.core.MultiFn.call.G__10839 [as call] (http://localhost:3000/main.out/cljs/core.js:33594:20\
)
at .<anonymous> (http://localhost:3000/main.out/weasel/repl.js:184:71)
at goog.events.EventTarget.fireListeners (http://localhost:3000/main.out/goog/events/eventtarget.j\
s:284:23)
at Function.goog.events.EventTarget.dispatchEventInternal_ (http://localhost:3000/main.out/goog/ev\
ents/eventtarget.js:381:26)
recently CIDER was changed to automatically supply it's own cider-nrepl and clj-refactor middleware when starting lein, so you can (should) remove these from your ~/.lein/profifiles.clj file if you have them. This will clear up this warning. (remember to update to the latest cider emacs package.
WARNING: CIDER's version (0.12.0-snapshot) does not match
cider-nrepl's version (not installed). Things will break!
This is a problem and hopefully fixing it clears up your other problems. If not, at least solving this is a prerequisite to debugging it properly.

slime doesn't work in emacs24

I use emacs24 in archlinux.If i use the slime packages from marmalade.org,then when i use M-x slime the error is:
debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread
#<THREAD "initial thread" RUNNING {AB007A9}>:
Couldn't load
"/home/sinners/.emacs.d/elpa/slime-20100404.1/swank-loader.lisp": file does
not exist.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
but if i use the slime-cvs packages from the offical site,the error is:
Debugger entered: (("Error in timer" slime-attempt-connection (#<process inferior-lisp> nil 2) (void-variable --cl-accu--)))
#[257 "\302\303\304\300\301F\"\207" [slime-attempt-connection (#<process inferior-lisp> nil 2) debug nil "Error in timer"] 7 "\n\n(fn DATA)"]((void-variable --cl-accu--))
funcall(#[257 "\302\303\304\300\301F\"\207" [slime-attempt-connection (#<process inferior-lisp> nil 2) debug nil "Error in timer"] 7 "\n\n(fn DATA)"] (void-variable --cl-accu--))
slime-timer-call(slime-attempt-connection #<process inferior-lisp> nil 2)
apply(slime-timer-call (slime-attempt-connection #<process inferior-lisp> nil 2))
byte-code("r\301\302H\303H\"\210)\301\207" [timer apply 5 6] 4)
timer-event-handler([t 20271 59188 161536 0.3 slime-timer-call (slime-attempt-connection #<process inferior-lisp> nil 2) nil])
anyone can help me?
Problem with --cl-accu-- variable signs about breakage of emacs cl package in presence of lexical scoping. Try to go to slime.el in your slime distribution, find string
;; lexical-binding: t in the ;; Local Variables: section at the end of the file and change it to ;; lexical-binding: nil. And remove old slime.elc file if you have one.
I had the exact same problem, which was solved by deleting the slime.elc file, that I had compiled earlier using byte-recompile-directory. I didn't try compiling it again.
I'm not sure, but this problem can be due to different versions of SLIME and SWANK. However you should just use pacman to install a lisp implementation ­(I think that SBCL is the most popular implementation on Linux) and then use quicklisp to install everything else.
See this blog post to see how to install SWANK and SLIME with quicklisp.