Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M-x slime [No match] #808

Open
7stud opened this issue Feb 5, 2024 · 18 comments
Open

M-x slime [No match] #808

7stud opened this issue Feb 5, 2024 · 18 comments

Comments

@7stud
Copy link

7stud commented Feb 5, 2024

I installed Emacs 29.2 and sbcl 2.4.0 on macOS 12.51 with an Apple M1 Pro chip.

Then I installed slime using the command M-x package-install<Ret>slime<Ret>. I can see that slime is installed:

Screen Shot 2024-02-03 at 12 12 52 PM

Now, I'm trying to get slime to work following these instructions:

It is simple as:

  1. Open emacs
  2. Open your lisp file with fibonacci function
  3. Issue M-x slime
  4. Place you cursor over fibonacci function and press C-c C-c to evaluate/compile it in Slime.
  5. switch to slime window and call (fibonacci 10)

Screenshot example with hello-world function:

In emacs, I opened a hello world .lisp file with C-x C-f. However, when I type M-x slime<Ret>, I get [No match]. Same for M-x slime-mode<Ret>.

Here is my ~/.emacs file:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages '(slime paredit)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

;;;;;;;;;;;;;;;;;;;;;;;

;; I added the following according to slime install directions:

(setq inferior-lisp-program "sbcl")

sbcl is in my path:

% which sbcl
/opt/local/bin/sbcl

% echo $PATH
...:/Users/7stud/bin/:/opt/local/bin:....

I tried altering the .emacs file to use the full path to sbcl:

(setq inferior-lisp-program "/opt/local/bin/sbcl")

but I still get M-x slime [No match]. I've been quitting emacs and relaunching it after I make changes to the .emacs file.

Here is my ~/.emacs.d/elpa directory (which I haven't touched):

% ls
archives               macrostep-0.9.2.signed slime-2.29.1
gnupg                  paredit-26             slime-2.29.1.signed
macrostep-0.9.2        paredit-26.signed

There were a bunch of warnings when I installed slime:

    ⛔ Warning (comp): slime-autodoc.el:51:17: Warning: ‘eldoc-message’ is an obsolete function (as of eldoc-1.1.0); use ‘eldoc-documentation-functions’ instead.
    ⛔ Warning (comp): slime-autodoc.el:52:15: Warning: ‘eldoc-message’ is an obsolete function (as of eldoc-1.1.0); use ‘eldoc-documentation-functions’ instead.
    ⛔ Warning (comp): slime-autodoc.el:64:8: Warning: ‘eldoc-message’ is an obsolete function (as of eldoc-1.1.0); use ‘eldoc-documentation-functions’ instead.
    ⛔ Warning (comp): slime-autodoc.el:106:8: Warning: ‘font-lock-fontify-buffer’ is for interactive use only; use ‘font-lock-ensure’ or ‘font-lock-flush’ instead.
    ⛔ Warning (comp): slime-autodoc.el:165:14: Warning: ‘eldoc-display-message-p’ is an obsolete function (as of eldoc-1.6.0); Use ‘eldoc-documentation-functions’ instead.
    ⛔ Warning (comp): slime-autodoc.el:166:10: Warning: ‘eldoc-message’ is an obsolete function (as of eldoc-1.1.0); use ‘eldoc-documentation-functions’ instead.
    ⛔ Warning (comp): bridge.el:115:2: Warning: defvar `bridge-leftovers' docstring wider than 80 characters
    ⛔ Warning (comp): slime-cl-indent.el:115:2: Warning: custom-declare-variable `lisp-align-keywords-in-calls' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
    ⛔ Warning (comp): slime-cl-indent.el:1448:2: Warning: defvar `common-lisp-indent-clause-joining-loop-macro-keyword' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
    ⛔ Warning (comp): hyperspec.el:1320:4: Warning: Alias for ‘common-lisp-hyperspec-glossary-function’ should be declared before its referent
    ⛔ Warning (comp): slime.el:112:2: Warning: Alias for ‘slime-contribs’ should be declared before its referent
    ⛔ Warning (comp): slime.el:277:12: Warning: defcustom for ‘slime-completion-at-point-functions’ fails to specify type
    ⛔ Warning (comp): slime.el:689:4: Warning: Doc string after `declare'
    ⛔ Warning (comp): slime.el:1160:6: Warning: ‘byte-compile-file’ called with 2 arguments, but accepts only 1
    ⛔ Warning (comp): slime.el:2408:10: Warning: ‘hide-entry’ is an obsolete function (as of 25.1); use ‘outline-hide-entry’ instead.
    ⛔ Warning (comp): slime.el:3081:12: Warning: ‘beginning-of-sexp’ is an obsolete function (as of 25.1); use ‘thing-at-point--beginning-of-sexp’ instead.
    ⛔ Warning (comp): slime.el:3392:16: Warning: ‘beginning-of-sexp’ is an obsolete function (as of 25.1); use ‘thing-at-point--beginning-of-sexp’ instead.
    ⛔ Warning (comp): slime.el:3681:20: Warning: ‘find-tag-marker-ring’ is an obsolete variable (as of 25.1); use ‘xref-push-marker-stack’ or ‘xref-go-back’ instead.
    ⛔ Warning (comp): slime.el:4113:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
    ⛔ Warning (comp): slime.el:4960:6: Warning: ‘font-lock-fontify-buffer’ is for interactive use only; use ‘font-lock-ensure’ or ‘font-lock-flush’ instead.
    ⛔ Warning (comp): slime.el:5536:10: Warning: ‘inhibit-point-motion-hooks’ is an obsolete variable (as of 25.1); use ‘cursor-intangible-mode’ or ‘cursor-sensor-mode’ instead
    ⛔ Warning (comp): slime.el:5692:10: Warning: ‘inhibit-point-motion-hooks’ is an obsolete variable (as of 25.1); use ‘cursor-intangible-mode’ or ‘cursor-sensor-mode’ instead
    ⛔ Warning (comp): slime.el:5795:10: Warning: ‘inhibit-point-motion-hooks’ is an obsolete variable (as of 25.1); use ‘cursor-intangible-mode’ or ‘cursor-sensor-mode’ instead
    ⛔ Warning (comp): slime.el:6329:8: Warning: Obsolete calling convention for 'sit-for'
    ⛔ Warning (comp): slime.el:6611:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
    ⛔ Warning (comp): slime.el:7187:4: Warning: ‘easy-menu-add’ is an obsolete function (as of 28.1); this was always a no-op in Emacs and can be safely removed.
    ⛔ Warning (comp): slime.el:7194:4: Warning: ‘easy-menu-add’ is an obsolete function (as of 28.1); this was always a no-op in Emacs and can be safely removed.
    ⛔ Warning (comp): slime.el:7312:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
    ⛔ Warning (comp): slime-parse.el:319:20: Warning: Stray ‘declare’ form: (declare (ignore args))
    ⛔ Warning (comp): slime-repl.el:130:2: Warning: defvar `slime-repl-history-use-mark' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
    ⛔ Warning (comp): slime-repl.el:138:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
    ⛔ Warning (comp): slime-repl.el:978:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
    ⛔ Warning (comp): slime-repl.el:1580:22: Warning: Stray ‘declare’ form: (declare (ignore args))
    ⛔ Warning (comp): slime-repl.el:1689:4: Warning: ‘easy-menu-add’ is an obsolete function (as of 28.1); this was always a no-op in Emacs and can be safely removed.
    ⛔ Warning (comp): slime-presentations.el:601:2: Warning: docstring wider than 80 characters
    ⛔ Warning (comp): slime-presentations.el:759:4: Warning: ‘easy-menu-add’ is an obsolete function (as of 28.1); this was always a no-op in Emacs and can be safely removed.
    ⛔ Warning (comp): slime-presentations.el:760:4: Warning: ‘easy-menu-add’ is an obsolete function (as of 28.1); this was always a no-op in Emacs and can be safely removed.
    ⛔ Warning (comp): slime-presentations.el:761:4: Warning: ‘easy-menu-add’ is an obsolete function (as of 28.1); this was always a no-op in Emacs and can be safely removed.
    ⛔ Warning (comp): slime-presentations.el:762:4: Warning: ‘easy-menu-add’ is an obsolete function (as of 28.1); this was always a no-op in Emacs and can be safely removed.
    ⛔ Warning (comp): slime-references.el:102:67: Warning: reference to free variable ‘name’
    ⛔ Warning (comp): slime-references.el:107:15: Warning: ‘:info’ called as a function
    ⛔ Warning (comp): slime-references.el:109:15: Warning: ‘t’ called as a function
    ⛔ Warning (comp): slime-references.el:109:15: Warning: the function ‘t’ is not known to be defined.
    ⛔ Warning (comp): slime-references.el:107:15: Warning: the function ‘:info’ is not known to be defined.
    ⛔ Warning (comp): slime-references.el:106:13: Warning: the function ‘case’ is not known to be defined.
    ⛔ Warning (comp): slime-package-fu.el:226:21: Warning: ‘looking-back’ called with 1 argument, but requires 2 or 3
    ⛔ Warning (comp): slime-package-fu.el:263:14: Warning: ‘looking-back’ called with 1 argument, but requires 2 or 3
    ⛔ Warning (comp): slime-trace-dialog.el:162:12: Warning: ‘inhibit-point-motion-hooks’ is an obsolete variable (as of 25.1); use ‘cursor-intangible-mode’ or ‘cursor-sensor-mode’ instead
    ⛔ Warning (comp): slime-trace-dialog.el:248:16: Warning: ‘inhibit-point-motion-hooks’ is an obsolete variable (as of 25.1); use ‘cursor-intangible-mode’ or ‘cursor-sensor-mode’ instead
    ⛔ Warning (comp): slime-trace-dialog.el:261:28: Warning: ‘inhibit-point-motion-hooks’ is an obsolete variable (as of 25.1); use ‘cursor-intangible-mode’ or ‘cursor-sensor-mode’ instead
    ⛔ Warning (comp): slime-trace-dialog.el:352:13: Warning: ‘inhibit-point-motion-hooks’ is an obsolete variable (as of 25.1); use ‘cursor-intangible-mode’ or ‘cursor-sensor-mode’ instead
    ⛔ Warning (comp): slime-trace-dialog.el:478:12: Warning: ‘inhibit-point-motion-hooks’ is an obsolete variable (as of 25.1); use ‘cursor-intangible-mode’ or ‘cursor-sensor-mode’ instead

I switched to another distribution with emacs 29.1, and I had the same problem. Then I tried using the .emacs file for emacs4cl with my emacs 29.1:

;;; Emacs4CL 0.5.0 <https://github.com/susam/emacs4cl>

;; Customize user interface.
(when (display-graphic-p)
  (tool-bar-mode 0)
  (scroll-bar-mode 0))
(setq inhibit-startup-screen t)

;; Dark theme.
(load-theme 'wombat)
(set-face-background 'default "#111")

;; Use spaces, not tabs, for indentation.
(setq-default indent-tabs-mode nil)

;; Highlight matching pairs of parentheses.
(setq show-paren-delay 0)
(show-paren-mode)

;; Workaround for https://debbugs.gnu.org/34341 in GNU Emacs <= 26.3.
(when (and (version< emacs-version "26.3") (>= libgnutls-version 30603))
  (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))

;; Write customizations to a separate file instead of this file.
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file t)

;; Enable installation of packages from MELPA.
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

;; Install packages.
(dolist (package '(slime paredit rainbow-delimiters))
  (unless (package-installed-p package)
    (package-install package)))

;; Configure SBCL as the Lisp program for SLIME.
(add-to-list 'exec-path "/usr/local/bin")
(setq inferior-lisp-program "sbcl")

;; Enable Paredit.
(add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode)
(add-hook 'eval-expression-minibuffer-setup-hook 'enable-paredit-mode)
(add-hook 'ielm-mode-hook 'enable-paredit-mode)
(add-hook 'lisp-interaction-mode-hook 'enable-paredit-mode)
(add-hook 'lisp-mode-hook 'enable-paredit-mode)
(add-hook 'slime-repl-mode-hook 'enable-paredit-mode)
(require 'paredit)
(defun override-slime-del-key ()
  (define-key slime-repl-mode-map
    (read-kbd-macro paredit-backward-delete-key) nil))
(add-hook 'slime-repl-mode-hook 'override-slime-del-key)

;; Enable Rainbow Delimiters.
(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode)
(add-hook 'ielm-mode-hook 'rainbow-delimiters-mode)
(add-hook 'lisp-interaction-mode-hook 'rainbow-delimiters-mode)
(add-hook 'lisp-mode-hook 'rainbow-delimiters-mode)
(add-hook 'slime-repl-mode-hook 'rainbow-delimiters-mode)

;; Customize Rainbow Delimiters.
(require 'rainbow-delimiters)
(set-face-foreground 'rainbow-delimiters-depth-1-face "#c66")  ; red
(set-face-foreground 'rainbow-delimiters-depth-2-face "#6c6")  ; green
(set-face-foreground 'rainbow-delimiters-depth-3-face "#69f")  ; blue
(set-face-foreground 'rainbow-delimiters-depth-4-face "#cc6")  ; yellow
(set-face-foreground 'rainbow-delimiters-depth-5-face "#6cc")  ; cyan
(set-face-foreground 'rainbow-delimiters-depth-6-face "#c6c")  ; magenta
(set-face-foreground 'rainbow-delimiters-depth-7-face "#ccc")  ; light gray
(set-face-foreground 'rainbow-delimiters-depth-8-face "#999")  ; medium gray
(set-face-foreground 'rainbow-delimiters-depth-9-face "#666")  ; dark gray

With that .emacs file, M-x slime successfully opened a window with the slime repl.

@pedro-w
Copy link

pedro-w commented Feb 5, 2024

You probably have figured this out yourself, but anyway, I think that version 2.29.1 of SLIME is obsolete - better to get the one from MELPA (20240125 is the latest, I think.) In your second .emacs file, you are enabling the MELPA repository, which you weren't in your first one.
With the 2.29.1 version I get the same problem as you; SLIME isn't actually activated even though the files seem to be installed.

@stassats
Copy link
Member

stassats commented Feb 5, 2024

2.29.1 is the latest version of Slime. I have never used melpa, but I've seen a lot of confusion from those who use it.

@pedro-w
Copy link

pedro-w commented Feb 5, 2024

@stassats thanks for the information. When I install SLIME (with MELPA enabled) I have a choice of

 20240125.1336 (melpa), 2.29.1 (nongnu).

The nongnu version has a date of 2024-Jan-24 (reference)
and the MELPA version also claims to be 2.29.1
so they ought to be very similar, however it's still true that the MELPA one works for me but the nongnu one gives the [no match] error as reported by @7stud.
I can't see anything in messages to indicate why the nongnu one is not loaded.

@stassats
Copy link
Member

stassats commented Feb 5, 2024

The elpa/melpa/whatever packages are maintained by someone (something) else. So I have no idea what they do.

@pedro-w
Copy link

pedro-w commented Feb 5, 2024

I have never used melpa, but I've seen a lot of confusion from those who use it.

Understood, but literally item 1 in your quick setup instructions is "Set up the MELPA repository"

As far as I can see, the nongnu ELPA version seems to have inexplicably omitted your slime-autoloads.el from their tarball and it gets replaced with an autogenerated version that doesn't work.

I see there was some sort of beef with ELPA recorded here

 ;; FIXME: Upstream has accidentally diverged, see
 ;; https://github.com/slime/slime/pull/648
 (slime			:url "https://github.com/slime/slime"
  ;; According to `git log -- NEWS`, seems to be the closest to "maintainer".
  :maintainer "Stas Boukarev <stassats@gmail.com>"
  ;; FIXME: Apparently upstream is not cooperative enough :-(
  ;; https://github.com/slime/slime/pull/648
  :merge t
  :doc "doc/slime.texi")

and in the linked PR #648

Do you want me to try and contact that someone or something at ELPA because it would be good to have this working "out of the box"? I'm happy to give it a go!

@stassats
Copy link
Member

stassats commented Feb 5, 2024

Part of the reason I don't understand or trust ELPA, why did they include code from some third party branch? And then can't remove it. I don't really want to be fixing their mistakes.

@7stud
Copy link
Author

7stud commented Feb 5, 2024

You probably have figured this out yourself,

No. I just got lucky when I decided to try the .emacs file from emacs4cl. I could see some differences in ~.emacs.d/, but I didn't know the significance of them.

Here was the directory for the 29.2 ~/.emacs.d when I couldn't get slime to work:

~/.emacs.d% ls
auto-save-list eln-cache      elpa
~/.emacs.d% cd elpa
~/.emacs.d/elpa% ls
archives               macrostep-0.9.2.signed slime-2.29.1
gnupg                  paredit-26             slime-2.29.1.signed
macrostep-0.9.2        paredit-26.signed

Here is the directory for the 29.1 ~/.emacs.d when I got slime to work:

~/.emacs.d% ls
auto-save-list custom.el      eln-cache      elpa
~/.emacs.d% cd elpa
~/.emacs.d/elpa  ls
archives                         paredit-20221127.1452
gnupg                            rainbow-delimiters-20210515.1254
macrostep-20230813.2123          slime-20240125.1336

Here's custom.el:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages '(rainbow-delimiters paredit slime)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

That's identical (except for the package names) to what was in my first .emacs file, and I assume custom.el gets read somehow just like .emacs. Okay, that's setup here:

;; Write customizations to a separate file instead of this file.
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file t)

I'm not sure what the point is of having both a .emacs file and a custom.el file.

So, the main differences I see between the two emacs installs are package names like:

slime-2.29.1
slime-2.29.1.signed

v.

slime-20240125.1336

@7stud
Copy link
Author

7stud commented Feb 5, 2024

Part of the reason I don't understand or trust ELPA, why did they include code from some third party branch? And then can't remove it. I don't really want to be fixing their mistakes.

@stassats

For a new emacs user, what is your recommended method for installing packages, and specifically slime?

@pedro-w
Copy link

pedro-w commented Feb 5, 2024

I'm coming to the conclusion that this isn't the right place to complain; both MELPA and nongnu ELPA take the outputs of this project and package them in their own ways. MELPA updates theirs every time there's a new commit and ELPA take the github releases. At the moment, MELPA works and ELPA doesn't because they're modifying the github release tarball. (If I'm wrong about that, please someone correct me)

So, if you want to get going today, use MELPA. In the meantime I will try and contact whoever is behind the ELPA and see if I can figure out why the difference and if it can be brought into sync, because I'd like slime to be working without this hassle!

For reference, my .emacs looks like

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(inferior-lisp-program "ecl" t)
 '(inhibit-startup-screen t)
 '(package-selected-packages '(slime paredit tj3-mode)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(setq inferior-lisp-program "ecl")
(package-initialize)

@stassats
Copy link
Member

stassats commented Feb 5, 2024

Is the "Source code(tar.gz)" from the release page really unusable? I, naturally, haven't tried using it.

@pedro-w
Copy link

pedro-w commented Feb 5, 2024

I haven't tried either (beyond looking at its contents) but I believe it would be usable - the one that isn't is nongnu ELPA (linked here) because they have removed slime-autoloads.el. During installation it is replaced with an autogenerated one which doesn't work, because slime doesn't use the magic comments (;;;###autoload) which would allow emacs to detect which functions should be made into autoloaders.

In other words, normally the function slime would be registered by code in slime-autoloads.el and typing M-x slime would cause the rest of the package to be loaded. However the 'broken' slime-autoloads.el doesn't register anything, so emacs doesn't know anything about function slime, hence M-x slime gives the "[no match]" error.

If you install the ELPA package and cat ~/.emacs.d/elpa/slime-2.29.1/slime-autoloads.el you'll see it's different from the one in this repo.

I think that's correct - let me check it before we get any further though!

@stassats
Copy link
Member

stassats commented Feb 5, 2024

A pull request with magic would be welcome.

@pedro-w
Copy link

pedro-w commented Feb 5, 2024

I've asked a question on the emacs mailing list (hopefully the right place) as I need a bit of guidance on fixing this

@phikal
Copy link
Contributor

phikal commented Feb 6, 2024

At the moment, MELPA works and ELPA doesn't because they're modifying the github release tarball. (If I'm wrong about that, please someone correct me)

Note that NonGNU ELPA doesn't modify any tarball, we use the last commit that bumps the version tag and use that as the basis to prepare a .tar package that is hosted by the archive. As part of that process, the ELPA build server generates an -autoloads.el and -pkg.el file, which in this case get overwritten.

@luismbo
Copy link
Member

luismbo commented Feb 6, 2024

@phikal slime-autoloads.el was removed from emacs/nongnu.git in this commit: https://git.savannah.gnu.org/gitweb/?p=emacs/nongnu.git;a=commit;h=6e0d67b9b7ae0fc31902609ab7525826b292c384

@phikal
Copy link
Contributor

phikal commented Feb 6, 2024

I know, that is because they don't have to be tracked in the repository.

@7stud
Copy link
Author

7stud commented Feb 7, 2024

@pedro-w

So, if you want to get going today, use MELPA.

On stackoverflow, Ehvince asked me to try adding (require 'slime) to my .emacs file, and that got rid of the M-x slime [No match] problem. In a buffer containing a lisp program, I did M-x slime, then another window opened with the slime REPL. Both C-c C-c with the cursor inside a function, and C-x C-e with the cursor just after the closing paren of a function succeeded in compiling the function in the slime REPL, then I could switch to the slime REPL and execute the functions:

Screen Shot 2024-02-07 at 1 30 08 PM

Can you confirm if that works for you?

~/.emacs:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages '(slime)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(setq inferior-lisp-program "sbcl")
(require 'slime) 

~/.emacs.d:

~/.emacs.d% ls
auto-save-list eln-cache      elpa

~/.emacs.d% cd elpa 

~/.emacs.d/elpa% ls
archives               macrostep-0.9.2        slime-2.29.1
gnupg                  macrostep-0.9.2.signed slime-2.29.1.signed

@pedro-w
Copy link

pedro-w commented Feb 7, 2024

(require 'slime) in your ~/.emacs will work, I have no doubt.

The downside is that it will load slime as soon as emacs starts, whether you need it or not. What should happen is that emacs package manager loads slime-autoloads.el, which contains (effectively) a lightweight 'stub' of the slime function. All this does when called is to load the actual slime package, overwriting itself. Emacs will load quicker and with less memory usage because defers loading the actual package (which contains many functions) until the first time it's used, thereafter it will be just as if you'd require'd slime. This may not be a big deal to you; it can become significant if you've installed lots of packages - loading them all at startup would be slow.

The problem here was that the slime-autoloads.el was wrong - it didn't even load the slime stub hence when you typed M-x slime it didn't know anything about the slime function.

It should be fixed in ELPA after the next release, see #809
Does that make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants