GNU bug report logs - #16620
24.3.50; Font-lock rule for `ert' does not handle words with dashes (fix included)

Previous Next

Package: emacs;

Reported by: Anders Lindgren <andlind <at> gmail.com>

Date: Sat, 1 Feb 2014 23:38:02 UTC

Severity: minor

Tags: confirmed

Merged with 16480

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#16480: closed (24.3.50; fontification in the definition of
 ert tests names does not highlight full symbol)
Date: Tue, 04 Feb 2014 17:39:04 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 04 Feb 2014 12:37:37 -0500
with message-id <jwva9e6vr8h.fsf-monnier+emacsbugs <at> gnu.org>
and subject line Re: bug#16620: 24.3.50; Font-lock rule for `ert' does not handle words with dashes (fix included)
has caused the debbugs.gnu.org bug report #16620,
regarding 24.3.50; fontification in the definition of ert tests names does not highlight full symbol
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
16620: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16620
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 fontification in the definition of ert tests names does not highlight
 full symbol
Date: Fri, 17 Jan 2014 10:43:09 +0100
Hello,

Running: 
emacs -Q -l ert testfile.el

with the following content of testfile.el:
(ert-deftest latex-movement ...)
(defun latex-movement ...)

will highlight only 'latex' in the first line, instead of the whole
symbol 'latex-movement'. Second line is just there to check that it
works for defun.

Here's a fix:

diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 4b11860..ee058a8 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1469,7 +1469,7 @@ the tests)."
   "Activate font-lock keywords for some of ERT's symbols."
   (font-lock-add-keywords
    nil
-   '(("(\\(\\<ert-deftest\\)\\>\\s *\\(\\sw+\\)?"
+   '(("(\\(\\<ert-deftest\\)\\>\\s *\\(\\(?:\\sw\\|\\s_\\)+\\)?"
       (1 font-lock-keyword-face nil t)
       (2 font-lock-function-name-face nil t)))))

-- 
Nico.


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Anders Lindgren <andlind <at> gmail.com>
Cc: 16620-done <at> debbugs.gnu.org
Subject: Re: bug#16620: 24.3.50;
 Font-lock rule for `ert' does not handle words with dashes (fix
 included)
Date: Tue, 04 Feb 2014 12:37:37 -0500
> The package `ert', adds Font Lock keywords to highlight the `ert-deftest'
> construct. Unfortunately, the regexp used does not handle the case when the
> name of the test contains a dash.

Thanks, installed,


        Stefan


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

Previous Next


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