bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10181: 24.0.92; [wishlist] split `diff-refine-change' in several fac


From: Stefan Monnier
Subject: bug#10181: 24.0.92; [wishlist] split `diff-refine-change' in several faces
Date: Fri, 25 May 2012 09:21:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]