From 1572dbf66706b28da1de351be9b01140a50208f8 Mon Sep 17 00:00:00 2001 From: Swarnendu Biswas Date: Tue, 10 Jan 2017 17:34:19 -0600 Subject: [PATCH] fix irony and cmake and others --- .gitignore | 1 + modules/cc-init.el | 29 +++++++++++++---------------- modules/defaults-init.el | 4 +++- modules/kill-ring-init.el | 1 + modules/misc-init.el | 9 +++++---- modules/prog-init.el | 15 ++++++++++++++- modules/python-init.el | 2 +- shortcuts.md | 15 +++++++++++++++ 8 files changed, 53 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 1b8b8b85..4ee4a008 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ irony tramp ac-html-csswatcher eshell +semanticdb *.elc .session diff --git a/modules/cc-init.el b/modules/cc-init.el index 0e3d51e0..28d511ee 100644 --- a/modules/cc-init.el +++ b/modules/cc-init.el @@ -20,11 +20,11 @@ (defvar dotemacs-completion-in-buffer) -(setq c-default-style '((java-mode . "java") - (c++-mode . "stroustrup") - (other . "gnu/linux") - (c-mode . "k&r") - (awk-mode . "awk"))) +(setq-default c-default-style '((java-mode . "java") + (c++-mode . "stroustrup") + (other . "gnu/linux") + (c-mode . "k&r") + (awk-mode . "awk"))) (use-package cc-mode :mode ("\\.h\\'" . c++-mode) @@ -90,21 +90,21 @@ ;; http://tuhdo.github.io/c-ide.html (with-eval-after-load "company" - (setq company-backends (delete 'company-semantic company-backends))) + (setq company-backends (delete 'company-semantic company-backends)) + (add-to-list 'company-clang-arguments "-I/home/sbiswas/intel-pintool/source/include/pin") + (add-to-list 'company-clang-arguments "-I/home/sbiswas/intel-pintool/lib/boost_1_58_0/boost")) (use-package company-c-headers :ensure t :if (eq dotemacs-completion-in-buffer 'company) :config - (add-to-list 'company-backends #'company-c-headers) - (add-to-list 'company-clang-arguments "-I/home/sbiswas/intel-pintool/source/include/pin") - (add-to-list 'company-clang-arguments "-I/home/sbiswas/intel-pintool/lib/boost_1_58_0/boost") + (add-to-list 'company-backends 'company-c-headers) (add-to-list 'company-c-headers-path-system "/usr/include/") (cond ((string-equal (system-name) "consensus.ices.utexas.edu") (add-to-list 'company-c-headers-path-system "/usr/include/c++/4.8.5/") - (add-to-list 'company-c-headers-path-system "/home/sbiswas/intel-pintool/lib/boost_1_58_0/boost") - (add-to-list 'company-c-headers-path-system "/home/sbiswas/intel-pintool/source/include/pin")) + (add-to-list 'company-c-headers-path-system "/h2/sbiswas/intel-pintool/lib/boost_1_58_0/boost") + (add-to-list 'company-c-headers-path-system "/h2/sbiswas/intel-pintool/source/include/pin")) ((string-equal (system-name) "sbiswas-Dell-System-XPS-L502X") (add-to-list 'company-c-headers-path-system "/usr/include/c++/6/")))) @@ -134,8 +134,7 @@ (add-hook 'c-mode-common-hook #'google-set-c-style) (add-hook 'c-mode-common-hook #'google-make-newline-indent)) - ;; Google C++ Style checker for Flycheck, also need to setup cpplint.py. - (use-package flycheck-google-cpplint + (use-package flycheck-google-cpplint ; Google C++ Style checker for Flycheck, also need to setup cpplint. :ensure t :after flycheck :if (eq system-type 'gnu/linux) @@ -176,11 +175,9 @@ (use-package company-irony :ensure t :if (eq dotemacs-completion-in-buffer 'company) - :commands company-irony-setup-begin-commands :init (use-package company-irony-c-headers :ensure t) - (add-hook 'irony-mode-hook 'company-irony-setup-begin-commands) :config (add-to-list 'company-backends '(company-irony-c-headers company-irony))) @@ -188,7 +185,7 @@ (use-package irony-eldoc :ensure t :commands irony-eldoc - :config (add-hook 'irony-mode-hook #'irony-eldoc))) + :init (add-hook 'irony-mode-hook #'irony-eldoc))) (provide 'cc-init) diff --git a/modules/defaults-init.el b/modules/defaults-init.el index 6671b87c..b51b577c 100644 --- a/modules/defaults-init.el +++ b/modules/defaults-init.el @@ -44,7 +44,9 @@ bidi-display-reordering nil) (when (>= emacs-major-version 24) - (setq inhibit-message t)) + ;; This is effective to turn off "Writing .." messages, but then it would disable other useful information from eldoc + ;; and Flycheck. + (setq inhibit-message nil)) (unless (bound-and-true-p dotemacs-use-ignoramus-p) ;; Avoid completing temporary files - http://endlessparentheses.com/improving-emacs-file-name-completion.html diff --git a/modules/kill-ring-init.el b/modules/kill-ring-init.el index 527b4ea9..eb6ba7c1 100644 --- a/modules/kill-ring-init.el +++ b/modules/kill-ring-init.el @@ -22,6 +22,7 @@ :if (or (eq dotemacs-selection 'none) (eq dotemacs-selection 'ido)) :commands browse-kill-ring :config + (require 'popwin-browse-kill-ring) (setq browse-kill-ring-highlight-current-entry t browse-kill-ring-highlight-inserted-item t browse-kill-ring-show-preview t diff --git a/modules/misc-init.el b/modules/misc-init.el index c5faca5b..b644d8bd 100644 --- a/modules/misc-init.el +++ b/modules/misc-init.el @@ -105,13 +105,14 @@ (push '("*Help*" :noselect t) popwin:special-display-config) (push '("*Paradox Report*" :regexp t :noselect t) popwin:special-display-config) (push '("*undo-tree*" :width 0.3 :position right) popwin:special-display-config) - (push '("*Kill Ring*") popwin:special-display-config) + (push '("*Kill Ring*" :noselect nil) popwin:special-display-config) (push '("*Selection Ring:") popwin:special-display-config) - (push '("*ag search*") popwin:special-display-config) - (push '("*ggtags-global*" :stick t :noselect t :height 30) popwin:special-display-config) + (push '("*ag search*" :noselect nil) popwin:special-display-config) + (push '("*ggtags-global*" :stick t :noselect nil :height 30) popwin:special-display-config) + (push '("*Flycheck errors*" :noselect nil) popwin:special-display-config) (add-to-list 'popwin:special-display-config '("*Completions*" :stick t :noselect t)) - (add-to-list 'popwin:special-display-config '("*Occur*" :noselect t)) + (add-to-list 'popwin:special-display-config '("*Occur*" :noselect nil)) (add-to-list 'popwin:special-display-config '("*Backtrace*")) (add-to-list 'popwin:special-display-config '("*Apropos*")) (add-to-list 'popwin:special-display-config '("*Warnings*"))) diff --git a/modules/prog-init.el b/modules/prog-init.el index 787ffe5b..905ea75f 100644 --- a/modules/prog-init.el +++ b/modules/prog-init.el @@ -250,6 +250,19 @@ (use-package ess-smart-underscore :ensure t)) -(provide 'prog-init) +(use-package cmake-mode + :ensure t + :config + (use-package cmake-font-lock + :ensure t) + (use-package cpputils-cmake + :ensure t + :config + (add-hook 'c-mode-common-hook + (lambda () + (if (derived-mode-p 'c-mode 'c++-mode) + (cppcm-reload-all)))))) + + (provide 'prog-init) ;;; prog-init.el ends here diff --git a/modules/python-init.el b/modules/python-init.el index ef919fa8..8b38ffca 100644 --- a/modules/python-init.el +++ b/modules/python-init.el @@ -6,7 +6,7 @@ ;;; Code: ;; Install the following packages -;; sudo -H pip3 install --upgrade pip numpy scipy psutil django setuptools jedi paramiko cffi rope importmagic yapf pyflakes flake8 importmagic autopep8 pep8 pylint overrides ggplot matplotlib ordered_set +;; sudo -H pip3 install --upgrade pip numpy scipy psutil django setuptools jedi paramiko cffi rope importmagic yapf pyflakes flake8 importmagic autopep8 pep8 pylint overrides ggplot matplotlib ordered_set cpplint (setenv "PYTHONPATH" "python3") diff --git a/shortcuts.md b/shortcuts.md index fc4adb03..74e12225 100644 --- a/shortcuts.md +++ b/shortcuts.md @@ -219,6 +219,21 @@ See the requirements: [https://github.com/leoliu/ggtags][] * `C-c C-o` - Overview of the definitions in the current file. * `M-.` - Jump to the definition of a function or class (`elpy-goto-definition`). +### Flycheck + +Within the error list the following key bindings are available: + +* `RET` - Go to the current error in the source buffer (``). +* `n` - Jump to the next error (``). +* `p` - Jump to the previous error (``). +* `e` - Explain the error (``). +* `f` - Filter the error list by level (``). +* `F` - Remove the filter (``). +* `S` - Sort the error list by the column at point (``). +* `g` - Check the source buffer and update the error list (``). +* `q` - Quit the error list and hide its window (``). + + ## Use Cases ### [Find and replace text in several files in a directory](http://stackoverflow.com/questions/270930/using-emacs-to-recursively-find-and-replace-in-text-files-not-already-open)