unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* eglot: "File mode specification error: (void-variable ‹)"
@ 2024-08-11 10:14 c.buhtz
  2024-08-13 18:02 ` tpeplt
  0 siblings, 1 reply; 2+ messages in thread
From: c.buhtz @ 2024-08-11 10:14 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

my question was blocked on r/Emacs maybe it is to stupid? Beside
solving this problem I am also interested in how I can solve things
like this in the future myself. Lisp is very hard for me.

I do get this error (Emacs 29 from Debian 12 backports) after updating
all my packages after a long while:

    File mode specification error: (void-variable ‹)

I am not sure but I think I identified the error causing lines (see
`:hook`) in the init.el.

```
(use-package python
  :ensure nil  ; in-build!
  :hook
  (python-mode . (lambda ()
   		   (if (not (string-equal (system-name) "quark"))
   		       (eglot-ensure)))
  )
  (python-mode . ws-butler-mode)
  (python-mode . hs-minor-mode)
  :custom
  (python-shell-interpreter "python3")
  )
```

The intention of that hook is to start "eglot" only if the current
systems name is not "quark". I do share this init.el between several
machines and "quark" is a RaspberryPi4 not able to run eglot and its
backend in a performant way. This worked well a long time until I
upgrade my emacs packages.

When I remove that hook and just add "(python-mode ensure-eglot)" it
works fine. But I still want the exception for the "quark" machine.

This is the full debug output:

```
Debugger entered--Lisp error: (error "Feature provided by other file:
project") error("Feature provided by other file: %S" project)
  require-with-check(project)
  mapc(require-with-check (project flymake xref jsonrpc
external-completion))
byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\300\310!\210\300\311!\210\300\312\313\314#\210\300\315!\210\300\316!\210..."
[require imenu cl-lib url-parse url-util pcase compile warnings
filenotify ert text-property-search nil t diff-mode diff fboundp
require-with-check #f(compiled-function (feature &rest _) #<bytecode
0xe148c4c7613dd5f>) eldoc reload seq mapc (project flymake xref jsonrpc
0xe148c4c7613dd5f>external-completion) make-obsolete-variable
0xe148c4c7613dd5f>eglot--managed-mode-hook eglot-managed-mode-hook
0xe148c4c7613dd5f>"1.6" defvaralias
0xe148c4c7613dd5f>eglot-confirm-server-initiated-edits
0xe148c4c7613dd5f>eglot-confirm-server-edits (saved-value
0xe148c4c7613dd5f>saved-variable-comment) put "1.16"
0xe148c4c7613dd5f>eglot-events-buffer-size eglot-events-buffer-config
0xe148c4c7613dd5f>defalias eglot--uri-to-path eglot-uri-to-path
0xe148c4c7613dd5f>make-obsolete eglot--path-to-uri eglot-path-to-uri
0xe148c4c7613dd5f>eglot--range-region eglot-range-region
0xe148c4c7613dd5f>eglot--server-capable eglot-server-capable
0xe148c4c7613dd5f>eglot--server-capable-or-lose
0xe148c4c7613dd5f>eglot-server-capable-or-lose eglot-lsp-abiding-column
0xe148c4c7613dd5f>eglot-utf-16-linepos "1.12" ...] 8) (eglot-ensure)
0xe148c4c7613dd5f>(if (not (string-equal (system-name) "quark"))
0xe148c4c7613dd5f>(eglot-ensure)) (closure (t) nil (if (not
0xe148c4c7613dd5f>(string-equal (system-name) "quark"))
0xe148c4c7613dd5f>(eglot-ensure)))()
0xe148c4c7613dd5f>run-hooks(change-major-mode-after-body-hook
0xe148c4c7613dd5f>prog-mode-hook python-mode-hook) apply(run-hooks
0xe148c4c7613dd5f>(change-major-mode-after-body-hook prog-mode-hook
0xe148c4c7613dd5f>python-mode-hook))
  run-mode-hooks(python-mode-hook)
  python-mode()
  set-auto-mode-0(python-mode nil)
  set-auto-mode--apply-alist((("\\.at\\'" . autotest-mode)
("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" .
markdown-mode) ("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file)
("\\.elc\\'" . elisp-byte-code-mode) ("\\.zst\\'" nil jka-compr)
("\\.dz\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil
jka-compr) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr)
("\\.bz2\\'" nil jka-compr) ("\\.Z\\'" nil jka-compr) ("\\.vr[hi]?\\'"
. vera-mode)
("\\(?:\\.\\(?:rbw?\\|ru\\|rake\\|thor\\|jbuilder\\|rabl\\|ge..." .
ruby-mode) ("\\.re?st\\'" . rst-mode) ("\\.py[iw]?\\'" . python-mode)
("\\.m\\'" . octave-maybe-mode) ("\\.less\\'" . less-css-mode)
("\\.scss\\'" . scss-mode) ("\\.awk\\'" . awk-mode)
("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode)
("\\.idl\\'" . idl-mode) ("\\.java\\'" . java-mode) ("\\.m\\'" .
objc-mode) ("\\.ii\\'" . c++-mode) ("\\.i\\'" . c-mode) ("\\.lex\\'" .
c-mode) ("\\.y\\(acc\\)?\\'" . c-mode) ("\\.h\\'" . c-or-c++-mode)
("\\.c\\'" . c-mode) ("\\.\\(CC?\\|HH?\\)\\'" . c++-mode)
("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode) ("\\.\\(cc\\|hh\\)\\'"
. c++-mode) ("\\.\\(bat\\|cmd\\)\\'" . bat-mode)
("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . mhtml-mode) ("\\.svgz?\\'" .
image-mode) ("\\.svgz?\\'" . xml-mode) ("\\.x[bp]m\\'" . image-mode)
("\\.x[bp]m\\'" . c-mode) ("\\.p[bpgn]m\\'" . image-mode)
("\\.tiff?\\'" . image-mode) ("\\.gif\\'" . image-mode) ("\\.png\\'" .
image-mode) ("\\.jpe?g\\'" . image-mode) ("\\.te?xt\\'" . text-mode)
("\\.[tT]e[xX]\\'" . tex-mode) ("\\.ins\\'" . tex-mode) ("\\.ltx\\'" .
latex-mode) ("\\.dtx\\'" . doctex-mode) ("\\.org\\'" . org-mode) ...)
nil nil) set-auto-mode() normal-mode(t) after-find-file(nil t)
...SKIPPED... ```

Thanks in advance
Christian



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: eglot: "File mode specification error: (void-variable ‹)"
  2024-08-11 10:14 eglot: "File mode specification error: (void-variable ‹)" c.buhtz
@ 2024-08-13 18:02 ` tpeplt
  0 siblings, 0 replies; 2+ messages in thread
From: tpeplt @ 2024-08-13 18:02 UTC (permalink / raw)
  To: c.buhtz; +Cc: help-gnu-emacs

<c.buhtz@posteo.jp> writes:

> Hello,
>
> my question was blocked on r/Emacs maybe it is to stupid? Beside
> solving this problem I am also interested in how I can solve things
> like this in the future myself. Lisp is very hard for me.
>

Emacs comes with an introduction to Emacs Lisp that can be read in
Emacs.  To read it, look for the menu item "More Manuals" in the Help
menu.  That menu item will include a sub-menu that has an entry titled
"Introduction to Emacs Lisp".  Or, evaluate the following expression in
Emacs:  (info "(eintr) Top")

> I do get this error (Emacs 29 from Debian 12 backports) after updating
> all my packages after a long while:
>
>     File mode specification error: (void-variable ‹)
>

This is likely too little information for anyone to help you know what
caused this error.  If you can produce a recipe of steps, including the
expressions that are being evaluated before the problem is reported,
then others will be more likely to be able to provide a reason for the
problem or how to resolve it.

> I am not sure but I think I identified the error causing lines (see
> `:hook`) in the init.el.
>
> ```
> (use-package python
>   :ensure nil  ; in-build!
>   :hook
>   (python-mode . (lambda ()
>    		   (if (not (string-equal (system-name) "quark"))
>    		       (eglot-ensure)))
>   )
>   (python-mode . ws-butler-mode)
>   (python-mode . hs-minor-mode)
>   :custom
>   (python-shell-interpreter "python3")
>   )
> ```
>
> The intention of that hook is to start "eglot" only if the current
> systems name is not "quark". I do share this init.el between several
> machines and "quark" is a RaspberryPi4 not able to run eglot and its
> backend in a performant way. This worked well a long time until I
> upgrade my emacs packages.
>
> When I remove that hook and just add "(python-mode ensure-eglot)" it
> works fine. But I still want the exception for the "quark" machine.
>

It looks as though it is possible that something has changed so that the
function ‘system-name’ is not returning the expected string "quark" when
the expression (system-name) is evaluated.  You might try evaluating
that function on that computer before you see the problem that you’re
having.

   M-: (system-name)

-- 
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-13 18:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-11 10:14 eglot: "File mode specification error: (void-variable ‹)" c.buhtz
2024-08-13 18:02 ` tpeplt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).