Compare commits

...

3 Commits

1 changed files with 46 additions and 4 deletions

View File

@ -4179,7 +4179,7 @@ the following configuration
***** Hunspell
#+begin_src shell :tangle (if (file-exists-p "/usr/share/myspell/en-custom.dic") "no" "setup.sh")
#+begin_src shell :tangle (if (file-exists-p "~/.config/enchant/hunspell") "no" "setup.sh")
cd /tmp
curl -o "hunspell-en-custom.zip" 'http://app.aspell.net/create?max_size=80&spelling=GBs&spelling=AU&max_variant=0&diacritic=keep&special=hacker&special=roman-numerals&encoding=utf-8&format=inline&download=hunspell'
unzip "hunspell-en-custom.zip"
@ -4204,7 +4204,7 @@ We will also add an accompanying =doctor= warning.
***** Aspell
#+begin_src shell :tangle (if (file-expand-wildcards "/usr/lib64/aspell*/en-custom.multi") "no" "setup.sh")
#+begin_src shell :tangle (if (file-expand-wildcards "~/.config/enchant/aspell/en-custom.multi") "no" "setup.sh")
cd /tmp
curl -o "aspell6-en-custom.tar.bz2" 'http://app.aspell.net/create?max_size=80&spelling=GBs&spelling=AU&max_variant=0&diacritic=keep&special=hacker&special=roman-numerals&encoding=utf-8&format=inline&download=aspell'
tar -xjf "aspell6-en-custom.tar.bz2"
@ -9287,12 +9287,24 @@ regurgitate the code, cross our fingers, and hope it works.
org-link-parameters)
"Variables inherited by the org-lint subprocess.")
(defconst flycheck-org-lint-babel-langs
'<<org-babel-list-langs()>>
"Languages that org-babel should know of.")
(defun flycheck-org-lint-variables-form ()
(require 'org-attach) ; Needed to make variables available
`(progn
,@(seq-map (lambda (opt) `(setq-default ,opt ',(symbol-value opt)))
(seq-filter #'boundp flycheck-org-lint-variables))))
(defun flycheck-org-lint-babel-langs-form ()
`(progn
,@(mapcar
(lambda (lang)
`(defun ,(intern (format "org-babel-execute:%s" lang)) (_body _params)
"Stub for org-lint."))
flycheck-org-lint-babel-langs)))
(eval ; To preveant eager macro expansion form loading flycheck early.
'(flycheck-define-checker org-lint
"Org buffer checker using `org-lint'."
@ -9304,6 +9316,8 @@ regurgitate the code, cross our fingers, and hope it works.
(flycheck-org-lint-variables-form)))
"--eval" (eval (flycheck-sexp-to-string
(flycheck-org-lint-customisations-form)))
"--eval" (eval (flycheck-sexp-to-string
(flycheck-org-lint-babel-langs-form)))
"--eval" (eval flycheck-org-lint-form)
"--" source)
:error-patterns
@ -9332,8 +9346,7 @@ added to Org as errors. So we need to tell ~org-lint~ about them without having
load my whole config. Code duplication isn't great, but at least this isn't
much.
#+name: org-syntax-modifications
#+begin_src emacs-lisp :tangle no
#+begin_src emacs-lisp
(defun flycheck-org-lint-customisations-form ()
`(progn
(require 'ox)
@ -9343,6 +9356,35 @@ much.
(org-export-backend-options (org-export-get-backend 'latex)))))
#+end_src
A larger annoyance is that org-lint doesn't actually know what languages
org-babel should recognise, with Doom's lazy loading system. Since the list of
languages should really only change when packages are added/removed, we might as
well statically determine a list of all org-babel languages at configuration
generation time.
#+name: org-babel-list-langs
#+begin_src emacs-lisp :noweb-ref none
(let (langs)
(dolist (dir load-path)
(dolist (file (directory-files dir t "\\.elc?$"))
(let ((basename (file-name-base file)))
(when (string-prefix-p "ob-" basename)
(ignore-errors
(require (intern basename) file t))))))
(mapatoms
(lambda (symb)
(when (and (functionp symb)
(string-prefix-p
"org-babel-execute:"
(symbol-name symb)))
(push (intern (replace-regexp-in-string
"org-babel-execute:" ""
(symbol-name symb)))
langs)))
obarray)
langs)
#+end_src
*** Visuals
#+call: confpkg("Org Visuals", after="org")