libera/#commonlisp - IRC Chatlog
Search
17:36:22
cl-arthur
I'd like to run some code when starting up slime. I've found https://slime.common-lisp.dev/doc/html/Multiple-Lisps.html, and thought to use that to set up an "env", but the function supplied to init-function is an elisp/emacs one. Does someone know how to call common lisp code (over slime) from the elisp/emacs code? My google-fu's failing me.
17:47:59
cl-arthur
alfr: that looks like it'd solve 'run some code when starting up slime' but not 'conditionally run some code when starting up slime'
17:58:06
Guest74
dlowe: i personally think crawling through a filesystem reading dates on files is pretty inhumane way to read your logs. Just write an interface that displays the information in any user customizable way.
19:08:02
Guest74
thanks Bike: that looks like it might do the right thing, I don't have any buffers need saving though.
19:14:26
Guest74
I've made the, perhaps unwise, decision to allow my lisp to control emacs and I quite abuse the desktop thing.
20:03:58
Bike
conspack cannot handle circularity within objects, even though the actual data format does. that's unfortunate, but maybe not too bad to fix
20:19:37
Shinmera
::notify Guest74 No, you're thinking of C-x C-s. C-x s ! does save all buffers with changes.
20:59:26
mfiano
What is the most idiomatic way to handle an external package's error condition being signalled, and signal a custom error condition in its place?
21:09:49
Bike
mfiano: you should use handler-bind so as to preserve the backtrace. here is the perhaps-overkill way i do it in cleavir https://github.com/s-expressionists/Cleavir/blob/main/CST-to-AST/conditions.lisp#L328-L372
21:10:26
Bike
(here i'm just encapsulating all kinds of errors, but you can obviously do this more specifically
21:12:27
mfiano
In my case, I'm writing a program that is expected to be run as an executable image with the debugger disabled, and I just handler-case my USER-ERROR condition that is a subtype of SIMPLE-ERROR: https://gist.github.com/mfiano/ae565e7710d3fcc41115d78164989de6
21:13:00
mfiano
But I want to treat external dependent library errors as user-error's to give a more meaningful message.
21:16:45
Bike
i mean, if all you're going to do with the error is dump it, encapsulating it in a new condition doesn't seem necessary
21:34:55
mfiano
Bike: The error comes from UIOP:RUN-PROGRAM, with no meaningful report, but for each process I call, I know what the user wants to see as a report. In this particular one I want to handle, the only possible error according to the exit status code, would be that ZFS filesystem permissions weren't delegated to the user running the program.
21:36:55
mfiano
I don't see how, considering uiop:run-program is used for all sorts of process calls, and I only know the context to produce the correct report at that call site.
21:42:38
Bike
yeah, no, if you control the call site just the handler-case you described makes sense to me
21:43:23
Bike
the cleavir code i linked is for a different situation, where we call some function that we don't control and which can do literally anything
21:44:27
mfiano
Yeah, I'm breaking my Lisp tradition here, of writing a program designed to be run from cron. Any error should exit the program, optionally u-w-p'ing a cleanup form, and writing the message to the job's log file.
21:46:12
mfiano
ACTION is rewriting a few thousand line shell script he wrote 6 months ago that outgrew its host language by...a few thousand lines.
22:07:00
dbotton
Do those of you deploying CL webservers do you tend to have each site in a different lisp image or all in one?
22:50:01
mfiano
I also try to avoid as much GPL-licensed software as I can. But this is all largely off-topic here.
0:30:41
Colleen
Guest74: Shinmera said 4 hours, 11 minutes ago: No, you're thinking of C-x C-s. C-x s ! does save all buffers with changes.