GNU bug report logs - #9919
24.0.91; font-lock broken in dired

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Mon, 31 Oct 2011 15:15:02 UTC

Severity: normal

Tags: notabug

Merged with 6662

Found in versions 24.0.50, 24.0.91

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

Bug is archived. No further changes may be made.

Forwarded to http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg01057.html

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#9919: closed (24.0.91; font-lock broken in dired)
Date: Tue, 10 Jan 2012 03:15:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 09 Jan 2012 22:14:37 -0500
with message-id <jwvipkkb67n.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#9919: 24.0.91; font-lock broken in dired
has caused the debbugs.gnu.org bug report #9919,
regarding 24.0.91; font-lock broken in dired
to be marked as done.

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


-- 
9919: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9919
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.91; font-lock broken in dired
Date: Mon, 31 Oct 2011 08:11:53 -0700
This regression started with the second delivery of pretest #1,
2011-10-31.  There is no such problem with the first delivery,
2011-10-24.
 
In my setup I use dired+.el, which is here:
http://www.emacswiki.org/emacs/download/dired%2b.el.
 
The relevant code is this:
 
(add-hook 'dired-mode-hook
          '(lambda ()
            (set (make-local-variable 'font-lock-defaults)
             (cons '(dired-font-lock-keywords diredp-font-lock-keywords-1) ; Two
levels.
              (cdr font-lock-defaults)))))
 
And this:

(defvar diredp-font-lock-keywords-1
  (list
   '("^  \\(.+:\\)$" 1 diredp-dir-heading) ; Directory headers
   '("^  wildcard.*$" 0 'default)       ; Override others, e.g. `l' for
`diredp-other-priv'.
   '("^  (No match).*$" 0 'default)     ; Override others, e.g. `t' for
`diredp-other-priv'.
   '("[^ .]\\.\\([^. /]+\\)$" 1 diredp-file-suffix) ; Suffix
   '("\\([^ ]+\\) -> [^ ]+$" 1 diredp-symlink) ; Symbolic links
   ;; 1) Date/time and 2) filename w/o suffix:
   (list dired-move-to-filename-regexp
         (if (or (not (fboundp 'version<)) (version< emacs-version "23.2"))
             (list 1 'diredp-date-time t t)
           (list 2 'diredp-date-time t t)) ; Date/time
         (list "\\(.+\\)$" nil nil (list 0 diredp-file-name 'keep t))) ;
Filename
 
   ;; Files to ignore
   (list (concat "^  \\(.*\\(" (concat (mapconcat 'regexp-quote
                                                  (or (and (boundp
'dired-omit-extensions)
 
dired-omit-extensions)
 
completion-ignored-extensions)
                                                  "[*]?\\|")
                                       "[*]?")        ; Allow for executable
flag (*).
                 "\\|\\.\\(g?z\\|Z\\)[*]?\\)\\)$") ; Compressed.
         1 diredp-ignored-file-name t)
   '("[^ .]\\.\\([bg]?[zZ]2?\\)[*]?$" 1 diredp-compressed-file-suffix t) ;
Compressed (*.z)
   '("\\([*]\\)$" 1 diredp-executable-tag t) ; Executable (*)
   ;; Inode, hard-links, & file size (. and , are for the decimal point,
depending on locale)
   ;; See comment for `directory-listing-before-filename-regexp' in `files.el'
or `files+.el'.
   '("\\(\\([0-9]+\\([.,][0-9]+\\)?\\)[BkKMGTPEZY]? \\)" 1 diredp-number)
 
   ;; Directory names
   (list "^..\\([0-9]* \\)*d"
         (list dired-move-to-filename-regexp nil nil)
         (list "\\(.+\\)" nil nil '(0 diredp-dir-priv t t)))
   '("^..\\([0-9]* \\)*.........\\(x\\)" 2 diredp-exec-priv) ;o x
   '("^..\\([0-9]* \\)*.........\\([lsStT]\\)" 2 diredp-other-priv) ; o misc
   '("^..\\([0-9]* \\)*........\\(w\\)" 2 diredp-write-priv) ; o w
   '("^..\\([0-9]* \\)*.......\\(r\\)" 2 diredp-read-priv) ; o r
   '("^..\\([0-9]* \\)*......\\(x\\)" 2 diredp-exec-priv) ; g x
   '("^..\\([0-9]* \\)*....[^0-9].\\([lsStT]\\)" 2 diredp-other-priv) ; g misc
   '("^..\\([0-9]* \\)*.....\\(w\\)" 2 diredp-write-priv) ; g w
   '("^..\\([0-9]* \\)*....\\(r\\)" 2 diredp-read-priv) ; g r
   '("^..\\([0-9]* \\)*...\\(x\\)" 2 diredp-exec-priv) ; u x
   '("^..\\([0-9]* \\)*...\\([lsStT]\\)" 2 diredp-other-priv) ; u misc
   '("^..\\([0-9]* \\)*..\\(w\\)" 2 diredp-write-priv) ; u w
   '("^..\\([0-9]* \\)*.\\(r\\)" 2 diredp-read-priv) ; u r
   '("^..\\([0-9]* \\)*.\\([-rwxlsStT]+\\)" 2 diredp-no-priv keep) ;-
   '("^..\\([0-9]* \\)*\\([bcsmpS]\\)[-rwxlsStT]" 2 diredp-rare-priv) ; (rare)
   '("^..\\([0-9]* \\)*\\(l\\)[-rwxlsStT]" 2 diredp-link-priv) ; l
   (list (concat "^\\([^\n " (char-to-string dired-del-marker) "].*$\\)")
         1 diredp-flag-mark-line t)     ; Flag/mark lines
   (list (concat "^\\([" (char-to-string dired-del-marker) "]\\)") ; Deletion
flags (D)
         '(1 diredp-deletion t)
         '(".+" (dired-move-to-filename) nil (0 diredp-deletion-file-name t)))
   (list (concat "^\\([^\n " (char-to-string dired-del-marker) "]\\)") ; Flags,
marks (except D)
         1 diredp-flag-mark t)
   ) "2nd level of Dired highlighting.  See `font-lock-maximum-decoration'.")
 
The local value of `font-lock-defaults' is correctly set to this value, as
it is in the earlier pretest #1 and in all prior Emacs releases:
 
((dired-font-lock-keywords diredp-font-lock-keywords-1)
 t nil nil beginning-of-line)
 
But none of the specified font-locking is manifested.  I see only the
default emacs -Q font-locking.  I don't know why, and am not sure how
to check this further.  
 
I've diff'd dired.el, dired-x.el, dired-aux.el, and font-lock.el between
the first pretest #1 delivery (2011-10-24) and the second one (2011-10-31),
but I don't recognize any change that would affect this.  Dunno what other
code changes were made between these two pretest deliveries, but something
broke font-locking badly in this context.
 

In GNU Emacs 24.0.91.1 (i386-mingw-nt5.1.2600) of 2011-10-30 on MARVIN
 Windowing system distributor `Microsoft Corp.', version 5.1.2600
 configured using `configure --with-gcc (4.6) --no-opt --cflags
 -I"D:/devel/emacs/libs/libXpm-3.5.8/include"
 -I"D:/devel/emacs/libs/libXpm-3.5.8/src"
 -I"D:/devel/emacs/libs/libpng-dev_1.4.3-1/include"
 -I"D:/devel/emacs/libs/zlib-dev_1.2.5-2/include"
 -I"D:/devel/emacs/libs/giflib-4.1.4-1/include"
 -I"D:/devel/emacs/libs/jpeg-6b-4/include"
 -I"D:/devel/emacs/libs/tiff-3.8.2-1/include"
 -I"D:/devel/emacs/libs/gnutls-2.10.1/include" --ldflags
 -L"D:/devel/emacs/libs/gnutls-2.10.1/lib"'
 



[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 9919-done <at> debbugs.gnu.org
Subject: Re: bug#9919: 24.0.91; font-lock broken in dired
Date: Mon, 09 Jan 2012 22:14:37 -0500
tags 9919 notabug
thanks

>> > That does not happen in Emacs 20-22 AFAICT.
>> > What's the gotcha for Emacs 20-22?  What does a user need to
>> > do in Emacs 20-22 to show that this code won't DTRT?
>> AFAIK the example will break your code in any version of Emacs
>> that supports font-lock.
> Nope, not the recipe you gave, at least.  Try it.
> That's why I asked (still asking).

Don't know, then, there must be something else at play.


        Stefan


This bug report was last modified 13 years and 133 days ago.

Previous Next


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