From b8c4002394090ef6d7779d54f0edf53b889ef4da Mon Sep 17 00:00:00 2001 From: Jarvis Schultz Date: Thu, 3 May 2018 09:31:05 -0500 Subject: [PATCH] Added org-mode package repo fixed coloring with Ag + Updated org package source to get up-to-date releases (read here)[http://irreal.org/blog/?p=6899] + Had an issue very similar to what was described (here)[https://github.com/Wilfred/ag.el/issues/124], tracked this down to the fact that Ag major mode inherits from compilation mode. My hook for colorizing the ANSI colors was breaking Ag coloring. Hook now only runs if major mode is compilation-mode. Seems to work for all packages in my normal workflow right now. Note that many people recommend using `compilation-filter-start' variable instead of `(point-min)' and `(point-max)' (see (for example here)[https://stackoverflow.com/questions/13397737/ansi-coloring-in-compilation-mode], but that wasn't working for me. Didn't bother to track down --- dotemacs.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dotemacs.el b/dotemacs.el index c993143..88a3142 100644 --- a/dotemacs.el +++ b/dotemacs.el @@ -13,6 +13,8 @@ (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") 'APPEND) +;; add org-mode packages: +(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) (package-initialize) ;; tools for benchmarking startup: @@ -570,11 +572,12 @@ (global-set-key "\C-x\C-r" ros-keymap) ;; since ROS Groovy, catkin inserts ansi-color sequences into the output of the ;; compilation buffer... let's fix that -(defun colorize-compilation-buffer () - (toggle-read-only) - (ansi-color-apply-on-region (point-min) (point-max)) - (toggle-read-only)) -(add-hook 'compilation-filter-hook 'colorize-compilation-buffer) +(ignore-errors + (require 'ansi-color) + (defun colorize-compilation-buffer () + (when (eq major-mode 'compilation-mode) + (ansi-color-apply-on-region (point-min) (point-max)))) + (add-hook 'compilation-filter-hook 'colorize-compilation-buffer)) ;; the way I am doing the following doesn't seem very safe! (defvar compile-history nil) (setq compile-history '("cd /home/jarvis/indigows/ && catkin_make "))