company-mode doesn't complete preprocessor syntax - emacs

I've followed the Tuhdo's tutorial, but I've got a problem with company-mode: it seems it doesn't auto complete preprocessor reserved words, as displayed in these two images no candidates are found:
But, on the contrary, this image shows that company mode is active and working:
What's wrong?
Thanks in advance.

hi problem same for me
Basically company-keywords does not include preprocessor directives.
So I've just wrote this backend that is triggered when you type #+ a letter.
https://github.com/fredericfrances/company-c-preprocessor
Installation and setup is pretty easy, I did'nt create melpa package yet.
(require 'company-c-preprocessor)
(add-to-list 'company-backends 'company-c-preprocessor)

Related

Flycheck Autocorrect errors

Hello Community I am using Spacemacs and I love it. It is working great for me all his features and the way all the layers are organized is amazing. Right now I am working with typescript but this question is common for any language.
I correctly setup flycheck and it is working perfectly. It is signaling all the errors.
How I can make Flycheck correct all the syntax errors in a bulk for me? Right now I am going one by one adding a semicolon or a space or who knows; it should be a function or something that allow me run an script that correct all this errors.

Can't preview LaTeX fragment in a non-file buffer

I tried to setup my org-mode according to Bernt Hansen’s wonderful documentation. But later I found I got problem with Org Capture as in Section 6. when I typed C-c c, an error message "Capture abort: (user-error Can't preview LaTeX fragment in a non-file buffer)” occured. After lots of search on the web I still can not solve it. I am wondering is here anyone can help me out? Thanks in advance!
Things I have tried:
Test Latex preview in org file according to this. Both “dvipng” and “imagemagick” setup methods work fine, I can preview Latex formula in .org file.
Use the method described here: http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=168c5584f5a41c4c0890f4caa89fc11cff021c4e
I replace my “org-mode” package with the one in the link which is supposed to solve the problem, however, I still got the same error message.
Versions of some packages I am using:
Emacs: GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2014-10-21 on builder10-9.porkrind.org
AucTeX: 11.88.8
org-mode: Org-mode version 8.3.1 (8.3.1-146-gfd8a18-elpa # /Users/xiaok/.emacs.d/elpa/org-20150928/)

Emacs - Clojure function highlighting (i.e. map, reduce, println, get, etc.)

I am currently using emacs24 with clojure-mode as my clojure IDE. I use the zenburn theme.
As far as I can tell, clojure-mode only provides syntax-highlighting for macros. Is there a way to add syntax highlighting for all clojure native functions?
I've googled a bit and it seems like I'm either the only one who wants this, or the only one that doesn't have it for some strange reason. I don't think my .emacs file is a necessary addition to this question but I'll add it if someone wants to take a look.
Thank you.
You need to explicitly enable font locking for these functions with clojure-mode-extra-font-locking. Install this package from MELPA, and add the following to your init.el:
(eval-after-load 'clojure-mode '(require 'clojure-mode-extra-font-locking))

Emacs config script for Lisp

What are some of the choices for pre-made Emacs config scripts? e.g. Lisp-centric keybindings, auto-complete / "intellisense", bracket matching, code formattting, etc.
So far I've only found:
emacs-starter-kit
redshank
There is also Prelude, which I can recommend. It has clean structure and code, and is regularly updated to include new interesting and useful packages or settings.
Do not use configurations from EmacsWiki. Most of what is posted there is very old, has never been updated since, and is hence rather out-dated now. Many of them will not work in modern GNU Emacs versions.
Instead, also look at the Github accounts of people who write Emacs packages, and you'll find many Emacs configurations. Some of these are created to be re-used by other people, for instance https://github.com/purcell/emacs.d.
See http://emacswiki.org/emacs/CategoryDotEmacs, especially under "Some complete InitFiles" and below.
This is my configuration script:
https://github.com/huseyinyilmaz/emacs-config

Ocaml - Emacs tuareg mode

I just started to use the tuareg mode in emacs for ocaml programming. So can someone tell me what are the main advantages of using it? Can someone suggest me any tutorial for that?
Tuareg-mode is good because it can parse code and calculate indentation & font-lock basing on this information. Plus it provides pretty good possibilities to interactive work with code.
Regarding tutorial - I don't think that such exists (although I planned to write it long time ago). All information for installation is in README file, and you can learn about available commands by visiting file with OCaml source code, and pressing C-h m to get description of mode, or by getting description of tuareg-mode function (if tuareg.el is loaded already).
Useful addition to these descriptions is Tuareg mode refcard that lists all (or almost) available commands.
Tuareg is really nice for:
Highlighting your code
Indenting your code correctly
Easily sending portions of code to a REPL
Easily compiling your code
Syntax highlight, indentation, as (almost) all language modes.
Compile or evaluate in a top level from a single buffer (you no longer need to open a ocaml toplevel in a command line to test some crap functions)
Caml-types minor mode : after a successful or partial compilation, you can easily point a variable and get the type the compiler inferred for it.