(message "General emacs setup")
-(tool-bar-mode -1)
+(if window-system
+ (tool-bar-mode -1))
(setq inhibit-startup-message t)
;; Indentation
(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward)
-(require 'auto-complete)
+(if (locate-library "auto-complete")
+ (require 'auto-complete))
-(require 'magit)
+(if (locate-library "auto-complete")
+ (require 'magit))
;; Ido mode
(require 'ido)
(global-set-key (kbd "<XF86Paste>") 'paste-x-selection)
(global-set-key (kbd "C-S-<insert>") 'paste-x-selection)
-(require 'dired-narrow)
-(define-key dired-mode-map "/" 'dired-narrow)
+
+(if (locate-library "dired-narrow")
+ (progn
+ (require 'dired-narrow)
+ (define-key dired-mode-map "/" 'dired-narrow)))
-(require 'irony)
-(add-hook 'c++-mode-hook 'irony-mode)
-(add-hook 'c-mode-hook 'irony-mode)
-(add-hook 'objc-mode-hook 'irony-mode)
+(if (locate-library "irony")
+ (progn
+ (require 'irony)
+ (add-hook 'c++-mode-hook 'irony-mode)
+ (add-hook 'c-mode-hook 'irony-mode)
+ (add-hook 'objc-mode-hook 'irony-mode)
-;; replace the `completion-at-point' and `complete-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)
+ ;; replace the `completion-at-point' and `complete-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)))