2

I unpack flycheck to ~/. and put the following lines in ~/.emacs:

;; (package-initialize)
(setq load-path (cons "~/flycheck-20170415.1006" load-path))
(require 'flycheck)
(add-hook 'after-init-hook #'global-flycheck-mode)

Starting Emacs 24.5.1 I get:

File error: Cannot open load file, no such file or directory, let-alist

With Emacs 25.1.1 I get:

File error: Cannot open load file, No such file or directory, dash

(These errors do not change if I uncomment (package-initialize). Emacs 25 now inserts (package-initialize), nudging those of us with a long setup to adapt.)

My (subsequent) aim is to conform Python code on-the-fly to PEP8. Once the problem above is resolved, I'll add

(setq exec-path (append exec-path '("/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin")))

to this brief ~/.emacs (/opt/..2.7/bin is where MacPorts put flake8), but there is apparently an issue before I even specify the programming language.

Update

This is far more painful than I expected. Flycheck is heavy-handed about being installed through packages, and incorporating the steps described here to my usual ~/.emacs leads to the notorious

load-with-code-conversion: Symbol’s value as variable is void: <!DOCTYPE

error. (I'm pretty sure I have no HTML files hiding under a .el extension.)

Update2

Uh.. I stand corrected! Some dash.el made its way to my usual elisp directory, and flycheck depends on it, but it was indeed an HTML file.

Calaf
  • 10,113
  • 15
  • 57
  • 120
  • What do you see when you do `M-x flycheck-verify-setup` in a Python buffer? – elethan Apr 21 '17 at 02:20
  • @elethan Thanks. Once again I am reminded that it's pointless to attempt to debug an Emacs problem without working with an isolated and minimal `.emacs`. Running `eval-region` on a few lines is misleading. I've revised the question. – Calaf Apr 21 '17 at 08:00

1 Answers1

1

Flycheck depends on dash, let-alist, and seq.

Download the files

  84766  dash.el
 381142  flycheck.el
   6136  let-alist.el
  17589  seq-24.el
  17684  seq-25.el
   1540  seq.el

and put them in ~/.concise-elisp. You need three files for seq because it has alternative implementations for Emacs 24 & 25.

Put the following lines in your ~/.emacs:

;; Even if you are not using packages, you need the following
;; commented-out line, or else Emacs 25 will insert one for you.
;; (package-initialize)

(setq load-path (cons "~/.concise-elisp" load-path))
(require 'flycheck)
(add-hook 'after-init-hook #'global-flycheck-mode)
(setq exec-path (append exec-path '("/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin")))

The last line points to where MacPorts would have put flake8. Flake8 is one of the programs to which flycheck delegates PEP8 checking.

Next exercise: Hook flycheck just for Python (and perhaps C/C++/Java/JS/..). In particular, don't worry about making elisp files kosher. Selectively activate flycheck for languages as needed.

Calaf
  • 10,113
  • 15
  • 57
  • 120