clingon icon indicating copy to clipboard operation
clingon copied to clipboard

Desactivating quit/exit at the REPL if desired

Open jf7t2gd1n opened this issue 2 years ago • 8 comments

Thanks for your interesting system.

When working at the REPL I would like sometimes to call clingon:run but desactivating exit (so I continue to be at the REPL) if desired. I did not find the way to do it experimenting with the features of clingon.

If that option is not present and you think it makes sense, could it be added?

Thanks. Best regards.

jf7t2gd1n avatar Aug 07 '23 12:08 jf7t2gd1n

Hey @jf7t2gd1n ,

That feature has been implemented like a couple of months ago.

See https://github.com/dnaeon/clingon/issues/12 for more details.

What version of clingon are you running?

dnaeon avatar Aug 07 '23 13:08 dnaeon

Thanks for your response.

I am using version 0.5.0 .

In /src/utils.lisp, it seems it checks for Sly or Slime.

I am using the REPL and the command line (not through Sly or Slime).

jf7t2gd1n avatar Aug 07 '23 13:08 jf7t2gd1n

Yep, currently it only works for Slime or Sly, as that's usually the way people interact with the REPL :)

Out of curiosity why do you use REPL from the command line instead of Sly/Slime?

dnaeon avatar Aug 07 '23 14:08 dnaeon

I use quite a lot the terminal, and sometimes I do not get to launch emacs.

jf7t2gd1n avatar Aug 07 '23 15:08 jf7t2gd1n

Currently the QUIT function works only for Sly/Slime by looking up the existing *FEATURES*. I'd be happy to review a PR, if you have something in mind.

Thanks!

dnaeon avatar Aug 07 '23 16:08 dnaeon

Thanks for asking. I am not an expert to propose the best way to do it.

For me, I think it would suffice something like a global variable that could be set to desactivate quit/exit when launching clingon:run . Or perhaps an optional or a key argument could be added to clingon:run to address that ??

jf7t2gd1n avatar Aug 07 '23 17:08 jf7t2gd1n

Hi, you could probably cheat and add the :swank symbol to the features list (even if swank is not loaded):

(defun main ()
  (let ((*features* (push :swank *features*)))
    (clingon:run my-app)))

or simply

(setf *features* (push :swank *features*))

vindarel avatar Aug 30 '23 11:08 vindarel

Yes, thanks.

jf7t2gd1n avatar Aug 31 '23 13:08 jf7t2gd1n