Starting LKB_FOS from Emacs in MacOS

Hi John,

I just downloaded the last binaries and tried to run from emacs. I got the error below. It seems that in the image, you have hard coded the path /Volumes/LocalDataHD/johnca/

image

Any direction? I thought this was solved in the previous version… but I may have forgot something?

Hi @johnca, I found a couple of emails among us that, at some point, suggested that I should have compiled the lkb_fos myself from the source. I am trying it now running the build.sh script, but I got the error

ar@tenis lkb_fos-src % ./build.sh
WARNING: redefining SWANK-LOADER::COMPILE-CONTRIBS in DEFUN
WARNING: redefining XLIB::DISPLAY-KEYBOARD-MAPPING in DEFUN
WARNING:
   redefining CONVERT-TO-GESTURE (#<STANDARD-CLASS CLIM:KEY-PRESS-EVENT>) in DEFMETHOD
WARNING: redefining XLIB::PROCESS-BLOCK in DEFUN

debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread
#<THREAD "main thread" RUNNING {1001680003}>:
  Couldn't load "McCLIM/fontconfig.lisp": file does not exist.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(LOAD "McCLIM/fontconfig.lisp" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST :ERROR :EXTERNAL-FORMAT :DEFAULT)
0]

Ignoring the error by using the continuation 0, I didn’t see the MacOS binaries in the bin folder.

Hi @arademaker , I haven’t hardcoded any paths – it’s the swank library that has captured a path that it was loaded from. I’ve never succeeded in reloading swank if there’s a version of it already in the binary. It might be possible with some hackery but it seems to be a use case that the swank developers didn’t foresee.

If you want to use slime/swank for program development, load the LKB from build.sh but stop before saving an image. Then you can call the function clim-user:set-up-lkb-interaction to start up the LKB GUI. In second and subsequent runs leave out :force t to load fasl files instead of source code.

With this strategy, you should load swank in your usual way. You won’t need the missing McCLIM/fontconfig.lisp file since that’s only there to side-step McCLIM’s unfortunate behaviour of capturing the paths of font files on the build machine.

I hope these hints help,

John

OK, I forgot that build.sh created the lkb.darwin_x86_64 in the lkb_fos folder, not in the same folder of the src repository. Once I have the new image lkb.darwin_x86_64, I was able to load lkb as one additional lisp implementation point to this file. That is, running M-- M-x slime.

But why not adding the McCLIM/fontconfig.lisp in the repo?

I didn’t have to do what you are suggesting below. Actually, I didn’t really understand what you are suggesting.

If you want to use slime/swank for program development, load the LKB from build.sh but stop before saving an image. Then you can call the function clim-user:set-up-lkb-interaction to start up the LKB GUI. In second and subsequent runs leave out :force t to load fasl files instead of source code.

What is the function to load the grammar from the Lisp repl?

Good, I’m glad you can run slime with your new image. But I think it will only work properly on your build machine (and perhaps others that are configured identically).

I didn’t add McCLIM/fontconfig.lisp to the repo because it’s not my code, it relies on McCLIM internals, and I’ve only tested it in a particular January 2022 snapshot of McCLIM. I hope to get rid of this hack and implement the recommendation in Machine-portable fonts · Issues · McCLIM but first I have to update myself to the latest McCLIM.

My suggestion in

If you want to use slime/swank for program development, load the LKB from build.sh but stop before saving an image. Then you can call the function clim-user:set-up-lkb-interaction to start up the LKB GUI. In second and subsequent runs leave out :force t to load fasl files instead of source code.

was that instead of building an LKB image, you could instead load the fasl files into a fresh Lisp session using a slightly modified version of build.sh. This is fast – it takes less than 5 seconds.

Regarding loading a grammar, see LkbMode · delph-in/docs Wiki · GitHub for the function and its associated emacs key binding.

1 Like