emacsinstallationslime

Wrong type argument: stringp, nil - slime installation


I'm trying to install and setup SLIME in GNU Emacs by following the quick install from the Slime GitHub page. https://github.com/slime/slime

I have already followed the instructions from the Set up the MELPA repository link, which requires you to add code to your .emacs file. Below is the code from my .emacs file:

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
  (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
  ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
  (when (< emacs-major-version 24)
    ;; For important compatibility libraries like cl-lib
    (add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)

;; Set your lisp system and, optionally, some contribs
(setq inferior-lisp-program "/opt/sbcl/bin/sbcl")
(setq slime-contribs '(slime-fancy))

(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.
 '(ansi-color-faces-vector
   [default default default italic underline success warning error])
 '(ansi-color-names-vector
   ["#073642" "#dc322f" "#859900" "#b58900" "#268bd2" "#d33682" "#2aa198" "#657b83"])
 '(compilation-message-face (quote default))
 '(cua-global-mark-cursor-color "#2aa198")
 '(cua-normal-cursor-color "#839496")
 '(cua-overwrite-cursor-color "#b58900")
 '(cua-read-only-cursor-color "#859900")
 '(custom-enabled-themes (quote (deeper-blue)))
 '(custom-safe-themes
   (quote
    ("8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" default)))
 '(fci-rule-color "#073642")
 '(highlight-changes-colors (quote ("#d33682" "#6c71c4")))
 '(highlight-symbol-colors
   (--map
    (solarized-color-blend it "#002b36" 0.25)
    (quote
     ("#b58900" "#2aa198" "#dc322f" "#6c71c4" "#859900" "#cb4b16" "#268bd2"))))
 '(highlight-symbol-foreground-color "#93a1a1")
 '(highlight-tail-colors
   (quote
    (("#073642" . 0)
     ("#546E00" . 20)
     ("#00736F" . 30)
     ("#00629D" . 50)
     ("#7B6000" . 60)
     ("#8B2C02" . 70)
     ("#93115C" . 85)
     ("#073642" . 100))))
 '(hl-bg-colors
   (quote
    ("#7B6000" "#8B2C02" "#990A1B" "#93115C" "#3F4D91" "#00629D" "#00736F" "#546E00")))
 '(hl-fg-colors
   (quote
    ("#002b36" "#002b36" "#002b36" "#002b36" "#002b36" "#002b36" "#002b36" "#002b36")))
 '(magit-diff-use-overlays nil)
 '(package-archives (quote (("gnu" . "http://elpa.gnu.org/packages/"))))
 '(package-selected-packages (quote (slime solarized-theme)))
 '(pos-tip-background-color "#073642")
 '(pos-tip-foreground-color "#93a1a1")
 '(smartrep-mode-line-active-bg (solarized-color-blend "#859900" "#073642" 0.2))
 '(term-default-bg-color "#002b36")
 '(term-default-fg-color "#839496")
 '(vc-annotate-background nil)
 '(vc-annotate-color-map
   (quote
    ((20 . "#dc322f")
     (40 . "#c85d17")
     (60 . "#be730b")
     (80 . "#b58900")
     (100 . "#a58e00")
     (120 . "#9d9100")
     (140 . "#959300")
     (160 . "#8d9600")
     (180 . "#859900")
     (200 . "#669b32")
     (220 . "#579d4c")
     (240 . "#489e65")
     (260 . "#399f7e")
     (280 . "#2aa198")
     (300 . "#2898af")
     (320 . "#2793ba")
     (340 . "#268fc6")
     (360 . "#268bd2"))))
 '(vc-annotate-very-old-color nil)
 '(weechat-color-list
   (quote
    (unspecified "#002b36" "#073642" "#990A1B" "#dc322f" "#546E00" "#859900" "#7B6000" "#b58900" "#00629D" "#268bd2" "#93115C" "#d33682" "#00736F" "#2aa198" "#839496" "#657b83"))))
(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.
 )

Next, I run the following command per the GitHub page and attempt to download SLIME:

M-x package-install RET slime RET

When I do the above command, I get the following error:

Wrong type argument: stringp, nil

Does anyone know why I'm getting that error or how to fix the issue? I'm running GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21) and OS is Ubuntu 18.04.1 LTS. Any help would be greatly appreciated.

Edit: Adding the traceback -

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\`https?:" nil nil)
  package-install-from-archive([cl-struct-package-desc slime (2 22) "Superior Lisp Interaction Mode for Emacs" ((cl-lib (0 5)) (macrostep (0 9))) tar "melpa" nil ((:commit . "8d9fdf34fe542ec280ee042ee7bdea16e512d3c0") (:keywords "languages" "lisp" "slime") (:url . "https://github.com/slime/slime")) nil])
  mapc(package-install-from-archive ([cl-struct-package-desc slime (2 22) "Superior Lisp Interaction Mode for Emacs" ((cl-lib (0 5)) (macrostep (0 9))) tar "melpa" nil ((:commit . "8d9fdf34fe542ec280ee042ee7bdea16e512d3c0") (:keywords "languages" "lisp" "slime") (:url . "https://github.com/slime/slime")) nil]))
  package-download-transaction(([cl-struct-package-desc slime (2 22) "Superior Lisp Interaction Mode for Emacs" ((cl-lib (0 5)) (macrostep (0 9))) tar "melpa" nil ((:commit . "8d9fdf34fe542ec280ee042ee7bdea16e512d3c0") (:keywords "languages" "lisp" "slime") (:url . "https://github.com/slime/slime")) nil]))
  package-install(slime nil)
  funcall-interactively(package-install slime nil)
  call-interactively(package-install record nil)
  command-execute(package-install record)
  execute-extended-command(nil "package-install" "package-install")
  funcall-interactively(execute-extended-command nil "package-install" "package-install")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Solution

  • Similar thing happened to me when installing a different package. M-x package-refresh-contents fixed it. You might have to run this every time after a restart and you try to install a package.