joaotavora / sly

Sylvester the Cat's Common Lisp IDE
1.27k stars 145 forks source link

sly-mrepl fails to load #640

Closed Devon7 closed 6 months ago

Devon7 commented 6 months ago

(require 'sly) sly (require 'sly-mrepl) ;; (file-missing "Cannot open load file" "No such file or directory" "sly-mrepl")

(dired "~/.emacs.d/elpa/sly-1.0.43/test") ; then try loading a file Load error for /Users/devon/.emacs.d/elpa/sly-1.0.43/test/sly-mrepl-tests.el: (file-missing Cannot open load file No such file or directory sly-mrepl)

joaotavora commented 6 months ago

Explain what you're trying to do and I'll reopen

Devon7 commented 6 months ago

I'm trying to get some instructions for beginners!

Following meta-dot sly down the rabbit hole, five minutes ago I stumbled across (sly-setup) which is not documented anywhere in plain sight, which fixes the trouble so perhaps it should be.

joaotavora commented 6 months ago

I'd try the README:

https://github.com/joaotavora/sly#installation

Or even

https://github.com/joaotavora/sly#install-from-git

Devon7 commented 6 months ago

Before filing an issue I spent a good deal of time grovelling the sources, starting with the README.md file, which contains no mention of (sly-setup) without which the mrepl map is undefined and therefore cannot be customised.

    Peace
        --Devon

P.S. I switched to sly because the slime repl is too dissimilar to shell mode. Sly is also missing commands but for all I know they may be present in some add-on which I have yet to discover.

C-d         comint-delchar-or-maybe-eof                 *  delete-char
RET         comint-send-input                           .  sly-mrepl-return
C-<down>    comint-next-input                           *? forward-paragraph
C-<up>      comint-previous-input                       *? backward-paragraph
<mouse-2>   comint-insert-input                         */ mouse-yank-primary
M-?         comint-dynamic-list-filename-completions    */ sly-edit-uses
C-c C-a     comint-bol-or-process-mark                   ?
C-c C-c     comint-interrupt-subjob                     .  sly-interrupt
C-c C-d     comint-send-eof                             */ (documentation prefix)
C-c C-e     comint-show-maximum-output                  */ sly-interactive-eval
C-c C-l     comint-dynamic-list-input-ring              */ sly-load-file
C-c RET     comint-copy-old-input                       */ sly-expand-1
C-c C-n     comint-next-prompt                           ?
C-c C-o     comint-delete-output                        .  sly-mrepl-clear-recent-output
C-c C-p     comint-previous-prompt                      *? sly-pprint-eval-last-expression
C-c C-r     comint-show-output                          *? sly-eval-region
C-c C-s     comint-write-output                         *? (stickers prefix)
C-c C-u     comint-kill-input                           *? sly-undefine-function
C-c C-x     comint-get-next-from-history                *? (connection prefix)
C-c C-z     comint-stop-subjob                          *? sly-mrepl
C-c C-\     comint-quit-subjob                           ?
C-c SPC     comint-accumulate                            ?
C-c .       comint-insert-previous-argument              ?
C-M-l       comint-show-output                          *  reposition-window
M-n         comint-next-input                           .  sly-mrepl-next-input-or-button
M-p         comint-previous-input                       .  sly-mrepl-previous-input-or-button
M-r         comint-history-isearch-backward-regexp      *? move-to-window-line-top-bottom
C-c M-o     comint-clear-buffer                         .  sly-mrepl-clear-repl
C-c M-r     comint-previous-matching-input-from-input    /
C-c M-s     comint-next-matching-input-from-input        /

. directly present in sly-mrepl-mode-map
* indirectly present in the sly mrepl
/ incompatible with the comint shell
? gratuitously incompatible with the comint shell
mdbergmann commented 6 months ago

Sly worked here just out of the box (ok I use a Git clone). I never had to touch sly-mrepl or sly-setup.

Devon7 commented 6 months ago

Nobody else uses both sly and shell?

mdbergmann commented 6 months ago

eshell sometimes but not often.

joaotavora commented 6 months ago

which contains no mention of (sly-setup) without which the mrepl map is undefined and therefore cannot be customised.

No, it can. Use eval-after-load. It's in the manual, which I supposed you have also found in all your sophisticated grovelling.

Devon7 commented 6 months ago

Sophisticated, hee hee, nope, never heard of it, thanks! Would

(add-to-list 'load-path "~/.emacs.d/elpa/sly-1.0.43")
(add-to-list 'load-path "~/.emacs.d/elpa/sly-1.0.43/contrib")
(eval-after-load "sly-mrepl" '(message "post-MREPL"))
(require 'sly-mrepl)

be the, er, canonical way to go about this?

    Peace
        --Devon

P.S. Can you suggest a way that still works when the version is incremented?

joaotavora commented 6 months ago

be the, er, canonical way to go about this?

No need for the require, and if you're using ELPA, no need for the add-to-list statements either. Just use the eval-after-load and M-x sly, only these two things after package-install.