GNU bug report logs -
#10181
24.0.92; [wishlist] split `diff-refine-change' in several faces
Previous Next
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
>>> Please introduce a defvar for it, so we don't re-evaluate the face
>>> comparison for each and every line.
>> This defvar needs to be re-evaluated when the user customized faces.
>
> Which rarely happens after loading diff-mode.el, so I wouldn't worry
> about it. That also lets the user set the variable explicitly if she
> wants to (after all, the faces can be different in one frame but
> equal in another, so the above test is not 100% foolproof anyway).
So I added this condition to the defvar.
> The rest of the patch looks OK,
Installed, with face adjustments in diff-mode, smerge and ediff.
I tested all face changes in different environments: high-color X11 with
light/dark background and 8-color xterm with light/dark background.
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"))) "...")
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.