Flycheck-Google-Cpplint is not Configured Correctly - emacs

I am trying to install flycheck-google-cpplint in my emacs. But I get this error:
(flycheck-mode 1)
(eval-after-load 'flycheck
'(progn
(require 'flycheck-google-cpplint)
(flycheck-add-next-checker 'c/c++-cppcheck
'c/c++-googlelint 'append)))
(custom-set-variables
'(flycheck-googlelint-verbose "3")
'(flycheck-googlelint-filter "-whitespace,+whitespace/braces"))
But this does not work. I get the following error:
Error: (user-error "Configured syntax checker c/c++-googlelint cannot be used")
I don't know why. I installed cpplint and it works fine if I used it from the command line. Any suggestion?

flycheck-google-lint uses cpplint. You have to tell emacs where to find the cpplint.py executable in order to run the syntax check.
You can find the cpplint file here.
Then, you need to add this to your init emacs file:
(custom-set-variables
'(flycheck-c/c++-googlelint-executable "/path/to/cpplint.py"))

Related

arduino-mode Emacs file specification error

When I try to edit an Arduino Sketch (*.ino file), I get this error:
Eval error in the ‘c-lang-defconst’ for ‘c-constant-kwds’ in arduino-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-basic-matchers-before’ in arduino-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-matchers-2’ in arduino-mode:
File mode specification error: (invalid-function (append (quote (HIGH LOW INPUT OUTPUT INPUT_PULLUP LED_BUILTIN true false)) (c-get-lang-constant (quote c-constant-kwds) (quote (cc-langs)))))
This happens even on the stock examples->basic->Blink.ino file.
My .emacs.d/init.el file contains these lines:
(setq auto-mode-alist (cons '("\\.\\(pde\\|ino\\)$" . arduino-mode) auto-mode-alist))
(autoload 'arduino-mode "arduino-mode" "Arduino editing mode." t)
I can't find a 'c-matchers-2' file.
This is Emacs 26.1.
Can anyone point me in a direction to fix this error?
Thanks in advance for your help and advice.
-Kevin
#nega, you were right, it was a version issue. When I used M-x list-packages, I saw I had installed version 20151017.2335, and the most current was 20180509.36 by stardivirer. arduino-mode packages are in the melpa repository.
Thanks so much for your help in pointing me in the right direction.
-Kevin

How Do I Alias Alembic Provided Dependencies?

If I evaluate the following in Emacs Cider:
(use 'alembic.still)
(alembic.still/distill '[enlive "1.1.5"])
(require '[net.cgrand.enlive-html :as html])
(html)
... evaluation of the (html) to see if it's a recognized symbol produces an 'Unable to resolve symbol' error. I'm evaluating it via cider connected to a REPL.
How can I use Alembic provided dependencies as an alias?
Your code is not working because html is an alias for a namespace here, not a symbol. The functions from enlive should work, however:
(use 'alembic.still)
(alembic.still/distill '[enlive "1.1.5"])
(require '[net.cgrand.enlive-html :as html])
(html/html-snippet "<div>Hello world</div>")

Org-journal won't recognize org-journal-dir?

Using the following use-package syntax, Org-journal doesn't recognize the org-journal-dir setting--instead, attempts to create a different directory with query Journal directory ~/Documents/journal not found. Create one?:
(use-package org-journal
:ensure t
:custom
(setq org-journal-dir "~/Dropbox/logs/journal/")
(setq org-journal-file-format "%m.%d.%Y.org"))
I see no error messages--it just seems to ignore the directory setting. Is this a simple syntax error? I'm new to the package and to Org mode.
[Update]: Sometimes, I get the following error message on Emacs start:
Error (use-package): org-journal/:catch: Symbol’s value as variable is void: org-journal-dir
The syntax for :custom is wrong. See https://github.com/jwiegley/use-package#customizing-variables. It should be something like:
:custom
(org-journal-dir "~/Dropbox/logs/journal/")
(org-journal-file-format "%m.%d.%Y.org")
Either that, or use :config (or maybe :init, but probably not) with setq:
:config
(setq org-journal-dir "~/Dropbox/logs/journal/")
(setq org-journal-file-format "%m.%d.%Y.org")

Emacs autocomplete error : running timer

I tryed to install autocomplete mode for emacs, downloaded it from the elpa repository, with
M-x list-packages
And when I try it, the mode gives me an error
Error running timer ‘ac-update-greedy’: (error "Keyword argument :max-width not one of (:min-height :around :face :mouse-face :selection-face :scroll-bar :margin-left :margin-right :symbol :parent :parent-offset :keymap)")
Error running timer ‘ac-show-menu’: (error "Keyword argument :max-width not one of (:min-height :around :face :mouse-face :selection-face :scroll-bar :margin-left :margin-right :symbol :parent :parent-offset :keymap)")
And it fails even if I don't load each other mod. Even If I manually run
M-x auto-complete-mode
Where can this error come from ?
Ok, I found the answer. So I'll just post it there in case somebody is in the same situation,
The problem came from popup.el, a required package for auto-complete.
I downloaded the sources, recompiled them, and added the new popup.el in my mod folder
And it worked !

Emacs preview-latex minted package and -shell-escape

I'm trying to use emacs with preview-latex (C-c C-p C-b) to view my document. First a minimal example of my document:
\documentclass {article}
\usepackage{minted}
\begin{document}
\begin{listing}[H]
\begin{minted}{sql}
Select * from FOOBAR;
\end{minted}
\caption{Test Query}
\label{code:query}
\end{listing}
\end{document}
I already tried using Using minted (source code LaTeX package) with emacs/auctex the following answer but it does not seem to work with preview-latex.
I get the following error message:
! Package minted Error: You must invoke LaTeX with the -shell-escape flag.
So I changed my latex-mode-hook to the following:
(defun kungi/latex-mode-hook ()
(turn-on-flyspell)
(auto-complete-mode 1)
(turn-on-reftex)
(turn-on-auto-fill-mode)
(push
'("Latexmk" "latexmk -pdf %s" TeX-run-TeX nil t
:help "Run Latexmk on file")
TeX-command-list)
(eval-after-load "tex"
'(setcdr (assoc "LaTeX" TeX-command-list)
'("xelatex -shell-escape %t"
TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX")))
(add-hook 'LaTeX-mode-hook
'kungi/latex-mode-hook)
Can you please tell me what I am doing wrong? Is it possible to use minted with preview latex?
I am using VIM with the LaTeX_Box plugin and I ran into a similar issue getting the very same error message. I could solve it by simply putting a file with the following contents to ~/.latexmkrc
$latex = 'latex --shell-escape';
$pdflatex = 'pdflatex --shell-escape';