Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
901 stars 98 forks source link

Irony-mode was not enable by default in my c++mode #577

Open algogavin opened 3 years ago

algogavin commented 3 years ago

I have the following in my .emacs.d/init.el file, I would expect it will enable the Irony mode when I open my C++ file, but it's not. As a workaround for now, I have to explicitly type "M-x irony-mode" to enable it.

; == irony-mode == (use-package irony :ensure t :defer t :init (add-hook 'c++-mode-hook 'irony-mode) (add-hook 'c-mode-hook 'irony-mode) (add-hook 'objc-mode-hook 'irony-mode) :config ;; replace the completion-at-point' andcomplete-symbol' bindings in ;; irony-mode's buffers by irony-mode's function (defun my-irony-mode-hook () (define-key irony-mode-map [remap completion-at-point] 'irony-completion-at-point-async) (define-key irony-mode-map [remap complete-symbol] 'irony-completion-at-point-async)) (add-hook 'irony-mode-hook 'my-irony-mode-hook) (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) ;; (add-hook 'irony-mode-hook 'irony-eldoc) )

I also try to add these as suggested--> (add-hook 'c++-mode-hook 'irony-mode) (add-hook 'c-mode-hook 'irony-mode) (add-hook 'objc-mode-hook 'irony-mode) (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)

but it's not helping though. Any help?