GNU bug report logs - #10181
24.0.92; [wishlist] split `diff-refine-change' in several faces

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 1 Dec 2011 15:57:01 UTC

Severity: wishlist

Found in version 24.0.92

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 10181 <at> debbugs.gnu.org
Subject: bug#10181: 24.0.92; [wishlist] split `diff-refine-change' in several faces
Date: Fri, 25 May 2012 09:21:02 -0400
> During testing I noticed that `C-M-x' doesn't work anymore on `defface'.
> It doesn't re-evaluate the face definition because `eval-sexp-add-defvars'
> in `eval-defun-2' produces an expression that can't be macroexpanded.
> For instance:

> (setq form (eval-sexp-add-defvars (read (current-buffer))))
> =>
> (progn (defvar add-log-buffer-file-name-function)
>        (defface diff-removed (quote ((((class color)) :background "red"))) "..."))

> (macroexpand form)
> =>
> (progn (defvar add-log-buffer-file-name-function)
>        (defface diff-removed (quote ((((class color)) :background "red"))) "..."))

> The problem is that `eval-sexp-add-defvars' adds `progn' that prevents
> defface macro expansion.  `macroexpand' can't expand `defface' to
> `custom-declare-face' (this is expected in `eval-defun-1').

> Without `progn', `macroexpand' works correctly, e.g.:

> (macroexpand '(defface diff-removed (quote ((((class color)) :background "red"))) "..."))
> =>
> (custom-declare-face (quote diff-removed) (quote ((((class color)) :background "red"))) "...")

Good point.  We should change eval-defun-1 to look inside `progn'.
Or alternatively, we should use eval-sexp-add-defvars after the
macroexpand+specialcaseing.


        Stefan




This bug report was last modified 10 years and 341 days ago.

Previous Next


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