-;;; For emacs < 24
-(when (< emacs-major-version 24)
- (defun ack--line (file col)
- (if (string-match-p "\\`[1-9][0-9]*\\'" (car file))
- (let ((has-ansi-color (overlays-at (match-beginning 1))))
- ;; See `compilation-mode-font-lock-keywords' where there is
- ;; overriding font-locking of FILE. Thus use the display
- ;; property here to avoid being overridden.
- (put-text-property
- (match-beginning 1) (match-end 1)
- 'display
- (propertize (match-string-no-properties 1)
- 'face (list (and (not has-ansi-color)
- compilation-line-face)
- :weight 'normal :inherit 'underline)))
- (list nil (ack--file)
- (string-to-number (match-string 1))
- (1- (string-to-number (match-string 3)))))
- (put-text-property (match-beginning 3)
- (match-end 3)
- 'font-lock-face compilation-line-face)
- (list nil file
- (string-to-number (match-string 3))
- (when (match-string 4)
- (put-text-property (match-beginning 4)
- (match-end 4)
- 'font-lock-face compilation-column-face)
- (1- (string-to-number (match-string 4))))))))
-
-;;; In emacs-24 and above, `compilation-mode-font-lock-keywords' ->