GNU bug report logs - #12136
24.1; Allow faces specified by property lists in `compilation-error-regexp-alist'.

Previous Next

Package: emacs;

Reported by: Oleksandr Manzyuk <manzyuk <at> gmail.com>

Date: Sat, 4 Aug 2012 14:16:01 UTC

Severity: normal

Tags: patch

Found in version 24.1

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12136 in the body.
You can then email your comments to 12136 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12136; Package emacs. (Sat, 04 Aug 2012 14:16:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleksandr Manzyuk <manzyuk <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 04 Aug 2012 14:16:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Oleksandr Manzyuk <manzyuk <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.1; Allow faces specified by property lists in
	`compilation-error-regexp-alist'.
Date: Sat, 04 Aug 2012 17:07:39 +0300
Unlike Emacs 23 in which fontification of compilation errors is handled
by `font-lock.el', in Emacs 24, it is performed by `compile.el' itself,
in a rather ad hoc fashion.  In particular, it doesn't handle the faces
specified by property list of the form (face FACE PROP1 VAL1 PROP2 VAL2
...).  The documentation of `compilation-error-regexp-alist' says that
it is an alist that specifies how errors in compiler output are matched,
where each element has the form

(REGEXP FILE [LINE COLUMN TYPE HYPERLINK HIGHLIGHT...]).

Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where FACE is an
expression returning the face to use for the submatch.  If fact, only
symbols are supported by the current version of `compile.el' and lists
error out with the error message "Don't know how to handle face ...".

As a consequence, compilation error messages are not properly fontified
in `inferior-haskell-mode', which also breaks navigation between errors
with C-x ` (see https://github.com/haskell/haskell-mode/issues/67 for
more details).  Unfortunately, I don't know of any other examples where
this problem manifests itself.

It seems to be straightforward to add support for faces specified by
property list.  I use the following patch:

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index c008e1c..be73850 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1338,6 +1338,11 @@ to `compilation-error-regexp-alist' if RULES is nil."
                       (put-text-property
                        (match-beginning mn) (match-end mn)
                        'font-lock-face face))
+                     ((and (listp face)
+                           (eq (car face) 'face))
+                      (add-text-properties
+                       (match-beginning mn) (match-end mn)
+                       (cddr face)))
                      (t
                       (error "Don't know how to handle face %S"
                              face)))))))



In GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2012-06-10 on paddy
Windowing system distributor `The X.Org Foundation', version 11.0.10706000
Configured using:
 `configure '--prefix=/home/manzyuk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  eldoc-mode: t
  diff-auto-refine-mode: t
  paredit-mode: t
  ido-everywhere: t
  shell-dirtrack-mode: t
  savehist-mode: t
  icomplete-mode: t
  global-auto-revert-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x C-g C-h v c o m p i l a t i o n SPC e r r r <backspace> 
o r SPC r e <tab> <return> C-x o C-v C-v C-x o M-x 
r e o <backspace> p o r t SPC e m <tab> <return>

Recent messages:
Loading /home/manzyuk/src/emacs-preamble/init.el (source)...
Loading /home/manzyuk/.emacs.d/elpa/haskell-mode-2.8.0/haskell-site-file.el (source)...done
Loading /home/manzyuk/quicklisp/slime-helper.el (source)...done
Loading /home/manzyuk/src/emacs-preamble/init.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
Type C-x 1 to delete the help window, C-M-v to scroll help.
scroll-down-command: Beginning of buffer

Load-path shadows:
None found.

Features:
(shadow sort flyspell ispell mail-extr emacsbug message rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader pp help-mode view eldoc preamble-scheme
preamble-ruby inf-ruby ruby-mode compile preamble-org org-install cl
preamble-magit preamble-diff magit-bisect magit-key-mode magit diff-mode
log-edit easy-mmode pcvs-util add-log preamble-lisp info-look
slime-autoloads preamble-haskell ghci-completion
preamble-google-translate google-translate json url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-util
url-parse url-vars mailcap preamble-emacs-lisp preamble-paredit paredit
preamble-auctex reftex reftex-vars preamble-package finder-inf
auctex-autoloads tex-site info easymenu ghci-completion-autoloads
google-translate-autoloads haskell-mode-autoloads inf-ruby-autoloads
magit-autoloads paredit-autoloads package tabulated-list preamble-text
preamble-shell preamble-prog preamble-makefile preamble-mail smtpmail
sendmail rfc2047 rfc2045 ietf-drums mail-utils preamble-ido ido
preamble-ibuffer preamble-hippie-expand preamble-ediff preamble-dired
preamble-comint preamble-ansi-color preamble-windows preamble-tramp
tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile
cconv macroexp assoc gnus-util mm-util mail-prsvr password-cache shell
pcomplete comint ansi-color ring format-spec tramp-loaddefs regexp-opt
preamble-server server preamble-mouse preamble-mode-line
preamble-minibuffer savehist icomplete preamble-keyboard
preamble-initialization preamble-frames preamble-files uniquify
autorevert preamble-env preamble-editing paren delsel edmacro kmacro
preamble-data saveplace preamble-browse-url preamble-bookmarks
preamble-utils advice help-fns advice-preload time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer loaddefs button faces cus-face files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12136; Package emacs. (Sun, 16 Sep 2012 04:33:01 GMT) Full text and rfc822 format available.

Message #8 received at 12136 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Oleksandr Manzyuk <manzyuk <at> gmail.com>
Cc: 12136 <at> debbugs.gnu.org
Subject: Re: bug#12136: 24.1; Allow faces specified by property lists in
	`compilation-error-regexp-alist'.
Date: Sun, 16 Sep 2012 12:31:20 +0800
Oleksandr Manzyuk <manzyuk <at> gmail.com> writes:

> Unlike Emacs 23 in which fontification of compilation errors is handled
> by `font-lock.el', in Emacs 24, it is performed by `compile.el' itself,
> in a rather ad hoc fashion.  In particular, it doesn't handle the faces
> specified by property list of the form (face FACE PROP1 VAL1 PROP2 VAL2
> ...).
>
> (REGEXP FILE [LINE COLUMN TYPE HYPERLINK HIGHLIGHT...]).
>
> Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where FACE is an
> expression returning the face to use for the submatch.  If fact, only
> symbols are supported by the current version of `compile.el' and lists
> error out with the error message "Don't know how to handle face ...".

Thanks.  I committed a slightly amended version of the suggested fix.




bug closed, send any further explanations to 12136 <at> debbugs.gnu.org and Oleksandr Manzyuk <manzyuk <at> gmail.com> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 16 Sep 2012 04:33:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 14 Oct 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 208 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.