+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster startup; ~5-20% general boost + reduce consing, function calls & garbage collection by preferring cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and various cl-lib filter/map/reduce functions) -- where possible + prefer functions with dedicated opcodes, like assq (see byte-defop's in bytecomp.el for more) + prefer pcase & cond (faster) over cl-case + general refactor for code readability + ensure naming & style conventions are adhered to + appease byte-compiler by marking unused variables with underscore + defer minor mode activation to after-init, emacs-startup or window-setup hooks; a customization opportunity for users + ensures custom functionality won't interfere with startup. |
||
---|---|---|
.. | ||
autoload.el | ||
config.el | ||
packages.el | ||
README.org |
:lang cc
This module adds support for the C-family of languages: C, C++, and Objective-C.
- Code completion (
company-irony
) - eldoc support (
irony-eldoc
) - Syntax-checking (
flycheck-irony
) - Code navigation (
irony
) - File Templates (c-mode, c++-mode)
- Snippets (cc-mode, c-mode, c++-mode)
C contends with Haskell and Ruby for my favorite language. It's hard to beat this combination of simplicity and power. I've used C for my work since 2009, and it (along with C++) is a personal favorite for game development (with SDL, SFML or, more recently, cocos2d).
The module provides nominal support for Objective-C, which I really only use to inspect generated glue code for iOS mobile apps. Otherwise, I prefer Swift.
Install
This module requires irony-server
for most of its features, which depends on cmake
and libclang
.
MacOS
Due to linking issues, MacOS users must compile irony-server manually:
brew install cmake
brew install llvm # 1gb+ installation! May take a while!
git clone https://github.com/Sarcasm/irony-mode irony-mode
mkdir irony-mode/server/build
pushd irony-mode/server/build
DEST="$HOME/.emacs.d/.local/$(hostname)/etc/irony-server/"
cmake -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
-DCMAKE_INSTALL_PREFIX="$DEST" ../
cmake --build . --use-stderr --config Release --target install
install_name_tool -change @rpath/libclang.dylib \
/usr/local/opt/llvm/lib/libclang.dylib \
"$DEST/bin/irony-server"
# cleanup
popd
rm -rf irony-mode
Arch Linux
sudo pacman --needed --noconfirm -S clang cmake
Then run M-x irony-install-server
in Emacs.