From 91f56b7242e2807e34197bc8e1a736a7d1398cf1 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Wed, 30 Aug 2017 22:57:19 +0100 Subject: [PATCH] Add a few more settings --- modules/emacs.el | 7 +++++++ modules/programming.el | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/modules/emacs.el b/modules/emacs.el index 48734d3..7763f93 100644 --- a/modules/emacs.el +++ b/modules/emacs.el @@ -130,6 +130,13 @@ ;; Always use ibuffer. (defalias 'list-buffers 'ibuffer) + ;; -------------------------------------------------------------------------- + ;; Address mode. + ;; -------------------------------------------------------------------------- + + (add-hook 'prog-mode-hook 'goto-address-mode) + (add-hook 'text-mode-hook 'goto-address-mode) + ;; -------------------------------------------------------------------------- ;; Configure garbage collection. ;; diff --git a/modules/programming.el b/modules/programming.el index 033888f..f6f0822 100644 --- a/modules/programming.el +++ b/modules/programming.el @@ -54,6 +54,47 @@ :config (setq gud-chdir-before-run nil)) + (setq-default + ;; Use gdb-many-windows by default. + gdb-many-windows t + ;; Display source file containing main. + gdb-show-main t) + + ;; -------------------------------------------------------------------------- + ;; Setup compilation-mode used by `compile' command + ;; -------------------------------------------------------------------------- + + (use-package compile + :bind + (("C-c c c" . compile) + ("C-c c r" . recompile)) + :config + (setq-default + ;; Just save before compiling. + compilation-ask-about-save nil + ;; Just kill old compile processes before starting the new one. + compilation-always-kill t + ;; Automatically scroll to first error. + compilation-scroll-output 'first-error)) + + ;; -------------------------------------------------------------------------- + ;; Makefile settings. + ;; -------------------------------------------------------------------------- + + (defun makefile-mode-tabs () + (whitespace-toggle-options '(tabs)) + (setq indent-tabs-mode t)) + + (add-hook 'makefile-mode-hook 'makefile-mode-tabs) + + ;; -------------------------------------------------------------------------- + ;; Ediff. + ;; -------------------------------------------------------------------------- + + (setq ediff-diff-options "-w" + ediff-split-window-function 'split-window-horizontally + ediff-window-setup-function 'ediff-setup-windows-plain) + ;; -------------------------------------------------------------------------- ;; Line numbers. ;;