purcell / emacs.d

An Emacs configuration bundle with batteries included
BSD 2-Clause "Simplified" License
6.82k stars 2.04k forks source link

Flycheck error in my init file #817

Closed francesco-cadei closed 1 year ago

francesco-cadei commented 1 year ago

I copied your require and provide structure. (it's faster?) This is my init.el file:

;;; init.el --- init -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(setq package-enable-at-startup nil)
;;(setq debug-on-error t)

(add-to-list 'load-path (expand-file-name "settings" user-emacs-directory))

(require 'init-packages)
(require 'init-defaults)
(require 'init-dired)

(require 'init-minibuffer)
(require 'init-buffers-management)
(require 'init-git)
(require 'init-terminal)

(require 'init-completion)
(require 'init-indent)
(require 'init-formatting)
(require 'init-syntax-check)
(require 'init-org)

(add-to-list 'load-path (expand-file-name "languages" user-emacs-directory))

(require 'init-markdown)
(require 'init-c-c++)
(require 'init-java)
(require 'init-javascript)
(require 'init-haskell)

(require 'init-latex)

(provide 'init)
;;; init.el ends here

Everything work and seems to go perfectly but flycheck says: Cannot open load file: No such file or directory, init-packages

Thanks in advance.

purcell commented 1 year ago

This looks out of scope in terms of an issue for this repo, but my guess is that the directory which contains your init-packages.el is not included in the variable load-path. In my case, those things go in the lisp subdir, and that directory is explicitly added to load-path (though I forget where). Hope that helps.

francesco-cadei commented 1 year ago

I do the same and packages are loaded but flycheck is still in error.

purcell commented 1 year ago

You might need to set flycheck-emacs-lisp-load-path to 'inherit?

francesco-cadei commented 1 year ago

Thanks!!