unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: bojohan@dd.chalmers.se, emacs-devel@gnu.org
Subject: Re: C-M-x should reset defface forms
Date: Mon, 07 Jun 2004 09:33:33 +0300	[thread overview]
Message-ID: <87d64c1baw.fsf@mail.jurta.org> (raw)
In-Reply-To: <E1BWk05-00085j-F0@fencepost.gnu.org> (Richard Stallman's message of "Sat, 05 Jun 2004 18:50:53 -0400")

Richard Stallman <rms@gnu.org> writes:
> Your change is not limited to C-M-x.  It makes ALL evaluation of
> a defface reinitialize the face.  That's a change I don't think
> we want to make.

To limit it only to C-M-x, changes can be made only in `eval-defun'
instead of `custom-declare-face'.

Index: lisp/emacs-lisp/lisp-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/lisp-mode.el,v
retrieving revision 1.159
diff -u -r1.159 lisp-mode.el
--- lisp/emacs-lisp/lisp-mode.el	29 May 2004 15:33:30 -0000	1.159
+++ lisp/emacs-lisp/lisp-mode.el	6 Jun 2004 23:54:45 -0000
@@ -589,6 +589,13 @@
 	 ;; Force variable to be bound.
 	 (set-default (eval (nth 1 form)) (eval (nth 1 (nth 2 form))))
 	 form)
+	;; `defface' is macroexpanded to `custom-declare-face'.
+	((eq (car form) 'custom-declare-face)
+	 ;; Clear defface spec.
+	 (put (eval (nth 1 form)) 'face-defface-spec nil)
+	 (setq face-new-frame-defaults
+	       (assq-delete-all (eval (nth 1 form)) face-new-frame-defaults))
+	 form)
 	((eq (car form) 'progn)
 	 (cons 'progn (mapcar 'eval-defun-1 (cdr form))))
 	(t form)))

Index: lisp/emacs-lisp/edebug.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/edebug.el,v
retrieving revision 3.68
diff -u -r3.68 edebug.el
--- lisp/emacs-lisp/edebug.el	28 May 2004 21:03:53 -0000	3.68
+++ lisp/emacs-lisp/edebug.el	6 Jun 2004 23:54:45 -0000
@@ -507,7 +507,13 @@
 	  ((and (eq (car form) 'defcustom)
 		(default-boundp (nth 1 form)))
 	   ;; Force variable to be bound.
-	   (set-default (nth 1 form) (eval (nth 2 form)))))
+	   (set-default (nth 1 form) (eval (nth 2 form))))
+          ((eq (car form) 'defface)
+           ;; Clear defface spec.
+           (put (nth 1 form) 'face-defface-spec nil)
+           (setq face-new-frame-defaults
+                 (assq-delete-all (nth 1 form) face-new-frame-defaults))
+           form))
     (setq edebug-result (eval form))
     (if (not edebugging)
 	(princ edebug-result)

-- 
Juri Linkov
http://www.jurta.org/emacs/

      reply	other threads:[~2004-06-07  6:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <yoijaczkpji2.fsf@eorl.dd.chalmers.se>
2004-06-05  1:03 ` C-M-x should reset defface forms Juri Linkov
2004-06-05 22:50   ` Richard Stallman
2004-06-07  6:33     ` Juri Linkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d64c1baw.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=bojohan@dd.chalmers.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).