Skip to content

ag functionality breaks with xterm-color compilation filter #37

@efroemling

Description

@efroemling

I'm really loving xterm-color; thanks for writing it!

I just wanted to note one issue I ran into (and my somewhat hacky workaround).

I've added xterm-color functionality to compilation output via the method described in the docs:

(defun my/advice-compilation-filter (f proc string)
  (funcall f proc (xterm-color-filter string)))

I'm using projectile and the ag search functionality it comes with, and I found that this breaks the ability to jump to search results in ag output buffers. It would seem that some of the filtering xterm-color is doing interferes with the filtering ag is doing to parse its output.

My hacky workaround is to only apply the filter if the buffer name starts with "*compilation"

(defun my/advice-compilation-filter (f proc string)
  (funcall f proc (if (string-prefix-p "*compilation" (buffer-name (process-buffer proc)))
                      (xterm-color-filter string) string)))

I'm not really sure if this would be considered xterm-color's problem or Ag's problem; I just wanted to mention it. Would there perhaps be an elegant way to differentiate compilation buffers kicked off by the user vs ones used by things like ag?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions