Commit d1e446530284

Vincent Demeester <vincent@sbr.pm>
2020-05-04 14:48:21
config-compile.el: do not add goto-address-mode…
… for rg/ag/grep modes. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 615ab3a
Changed files (1)
tools
emacs
tools/emacs/config/config-compile.el
@@ -17,6 +17,11 @@
                 (derived-mode-p 'rg-mode))
       (let ((inhibit-read-only t))
         (ansi-color-apply-on-region compilation-filter-start (point)))))
+  (defun vde/goto-address-mode ()
+    (unless (or (derived-mode-p 'grep-mode)
+                (derived-mode-p 'ag-mode)
+                (derived-mode-p 'rg-mode))
+      (goto-address-mode t)))
   :config
   (setq-default compilation-scroll-output t
                 ;; I'm not scared of saving everything.
@@ -32,7 +37,7 @@
                 ;; Show three lines of context around the current message
                 compilation-context-lines 3)
   (add-hook 'compilation-filter-hook #'vde/colorize-compilation-buffer)
-  :hook ((compilation-mode . goto-address-mode)))
+  (add-hook 'compilation-mode-hook #'vde/goto-address-mode))
 ;; -UseCompile
 
 ;; UseFlycheck