;;; -*- lexical-binding: t -*- ;;; ;;; this file: ;;; http://user.it.uu.se/~embe8573/emacs-init/ide/compile-my.el ;;; https://dataswamp.org/~incal/emacs-init/ide/compile-my.el (require 'close) (require 'compile) (require 'mode-line) (require 'super) ;; Makefile ;; (setq makefile-mode-hook nil) (defun makefile-mode-hook-f () (enable-line-mode) (disable-super-global-keys) ) (add-hook 'makefile-mode-hook #'makefile-mode-hook-f) (defun compile-with-prompt () "Use this if there are sudos in the Makefile." (interactive) (compile compile-command t) ) ;; compile (setq compilation-scroll-output t) ;; (setq compilation-mode-hook nil) (defun compilation-mode-hook-f () (visual-line-mode) ) (add-hook 'compilation-mode-hook #'visual-line-mode) (setq compile-command "make -j 4 -s -k ") (setq compilation-read-command nil) ;; goto errors? (defun goto-next-number () (interactive) (forward-char 1) (re-search-forward "[[:digit:]]" nil t) (backward-char 1) ) (defun goto-prev-number () (interactive) (re-search-backward "[[:digit:]]" nil t) ) (let ((the-map compilation-mode-map)) (set-close-key the-map) (disable-super-global-keys the-map) (define-key the-map "l" #'goto-next-number) (define-key the-map "j" #'goto-prev-number) ) (provide 'compile-my)