aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2004-06-10 04:16:05 +0000
committerJuri Linkov2004-06-10 04:16:05 +0000
commit217297f8ec4a85588fa65eea23c29e8ae9187ac4 (patch)
tree58dd47ea51e6f06d8894577c933c03fe0aab5477
parent2736c905014ad42b0d8836b6692e96d63d14c90a (diff)
downloademacs-217297f8ec4a85588fa65eea23c29e8ae9187ac4.tar.gz
emacs-217297f8ec4a85588fa65eea23c29e8ae9187ac4.zip
(eval-defun-1): Add `defface'. Fix docstring.
-rw-r--r--lisp/emacs-lisp/lisp-mode.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index d6ac05642ba..d471ad79538 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -570,8 +570,9 @@ Interactively, with prefix argument, print output into current buffer."
570 value))) 570 value)))
571 571
572(defun eval-defun-1 (form) 572(defun eval-defun-1 (form)
573 "Change defvar into defconst within FORM. 573 "Treat some expressions specially.
574Likewise for other constructs as necessary." 574Reset the `defvar' and `defcustom' variables to the initial value.
575Reinitialize the face according to the `defface' specification."
575 ;; The code in edebug-defun should be consistent with this, but not 576 ;; The code in edebug-defun should be consistent with this, but not
576 ;; the same, since this gets a macroexpended form. 577 ;; the same, since this gets a macroexpended form.
577 (cond ((not (listp form)) 578 (cond ((not (listp form))
@@ -589,6 +590,13 @@ Likewise for other constructs as necessary."
589 ;; Force variable to be bound. 590 ;; Force variable to be bound.
590 (set-default (eval (nth 1 form)) (eval (nth 1 (nth 2 form)))) 591 (set-default (eval (nth 1 form)) (eval (nth 1 (nth 2 form))))
591 form) 592 form)
593 ;; `defface' is macroexpanded to `custom-declare-face'.
594 ((eq (car form) 'custom-declare-face)
595 ;; Reset the face.
596 (put (eval (nth 1 form)) 'face-defface-spec nil)
597 (setq face-new-frame-defaults
598 (assq-delete-all (eval (nth 1 form)) face-new-frame-defaults))
599 form)
592 ((eq (car form) 'progn) 600 ((eq (car form) 'progn)
593 (cons 'progn (mapcar 'eval-defun-1 (cdr form)))) 601 (cons 'progn (mapcar 'eval-defun-1 (cdr form))))
594 (t form))) 602 (t form)))
@@ -624,7 +632,7 @@ Return the result of evaluation."
624 (setq beg (point)) 632 (setq beg (point))
625 (setq form (read (current-buffer))) 633 (setq form (read (current-buffer)))
626 (setq end (point))) 634 (setq end (point)))
627 ;; Alter the form if necessary, changing defvar into defconst, etc. 635 ;; Alter the form if necessary.
628 (setq form (eval-defun-1 (macroexpand form))) 636 (setq form (eval-defun-1 (macroexpand form)))
629 (list beg end standard-output 637 (list beg end standard-output
630 `(lambda (ignore) 638 `(lambda (ignore)