0

I am using Ubuntu linux.

Here is a minimal version of my .emacs file:

;;----------------------------------------
;; use-package
;;{{{ Set up package and use-package

;;------------------------------------------------------------------------------------------------------
(add-to-list 'load-path "~/.emacs.d/lisp/")
(add-to-list 'load-path "~/.emacs.d/elpa/")

(require 'package)
;;(add-to-list 'package-archives
;;             '("melpa" . "https://melpa.org/packages/") t)
;;++++++++++++++++++++++++
(add-to-list 'package-archives '("MELPA" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)
;;++++++++++++++++++++++++
(package-initialize)

;; use-package to simplify the config file
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure 't)

;;----------------------------------------------------
; automatically get the correct mode 
(autoload 'python-mode "python-mode" "Python Mode." t)
(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons '("python" . python-mode)
                   interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)

(use-package which-key
    :config
    (which-key-mode)
    (setq which-key-idle-delay 0.5
          which-key-idle-secondary-delay 0.5)
    (which-key-setup-side-window-bottom))

(use-package company
    :ensure t
     :config
    (setq company-idle-delay 0
          company-minimum-prefix-length 4
          company-selection-wrap-around t))
(global-company-mode)
(setq company-tng-mode t)                
(setq company-idle-delay
      (lambda () (if (company-in-string-or-comment) nil 0.05)))  

(use-package lsp-mode
  :hook
  ((python-mode . lsp)))

(use-package lsp-ui
    :commands lsp-ui-mode)

(setq flycheck-enabled-checkers '(python-pylint))
(setq flycheck-python-pylint-executable "python3")

I get the following error message:

File mode specification error: (wrong-type-argument listp #s(lsp--client nil nil (:connect #[1285 \303\304!\203
\0\305\306\300!"\207\306\300!\307!\310!\311\312"\313 \314\315\316\317\320\311\321   "\322\323\324\325\326\327\330\331&\332\333"\210\332\334!\333"\210r\335!q\210\336 \210)\211)B\266\202)\207 [#[0 \207 [lsp-pylsp-server-command] 1] process-environment default-directory functionp json-rpc-connection lsp-json-rpc-connection lsp-resolve-final-function generate-new-buffer-name lsp--compute-process-environment format *%s::stderr* lsp--default-directory-for-connection make-process :name :connection-type pipe :buffer *%s* :coding no-conversion :command :filter :sentinel :stderr :noquery t set-process-query-on-exit-flag nil get-buffer-process get-buffer special-mode] 27 

(fn FILTER SENTINEL NAME ENVIRONMENT-FN WORKSPACE)] :test? #[0 \301\302\300!!\207 [#[0 \207 [lsp-pylsp-server-command] 1] lsp-server-present? lsp-resolve-final-function] 3]) nil nil #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ()) #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ()) #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data ()) nil #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ()) #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ()) nil #[514 \301\300\302 "\207 [(python) -contains? lsp-buffer-language] 5 

(fn FILE-NAME MODE)] -1 pylsp nil nil nil nil #[257 \207 [lsp-clients-pylsp-library-directories] 2 

(fn WORKSPACE)] nil #[257 \211\301\302\303!!)\207 [lsp--cur-workspace lsp--set-configuration lsp-configuration-section pylsp] 4 

(fn WORKSPACE)] nil nil nil nil nil nil #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ()) nil nil nil nil))

Any help is greatly appreciated. Thanks Chris

nega
  • 3,091
  • 15
  • 21
Chris
  • 1
  • 1
  • What's the question? Please don't just post your init file. Narrow the code you show to whatever your *specific* question is. Use 3 backquotes on a line before and after code. – Drew Apr 28 '23 at 13:39
  • do you have a python lsp server installed? – nega Apr 29 '23 at 18:50
  • I don't get that terrible backtrace when there are no python lsp servers installed. Try with only what you posted as your init file. – nega Apr 29 '23 at 19:04

0 Answers0