Mercurial > emacs
comparison lisp/emacs-lisp/lisp-mode.el @ 59755:c4bcae7d90b4
(eval-defun-1): Make sure `defvar' always sets the default value.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 28 Jan 2005 16:27:13 +0000 |
parents | 04043e03826a |
children | e760650016fc f8a7a9ba3d08 |
comparison
equal
deleted
inserted
replaced
59754:a9fbaec66c84 | 59755:c4bcae7d90b4 |
---|---|
1 ;;; lisp-mode.el --- Lisp mode, and its idiosyncratic commands | 1 ;;; lisp-mode.el --- Lisp mode, and its idiosyncratic commands |
2 | 2 |
3 ;; Copyright (C) 1985, 1986, 1999, 2000, 2001, 2003, 2004 | 3 ;; Copyright (C) 1985, 1986, 1999, 2000, 2001, 2003, 2004, 2005 |
4 ;; Free Software Foundation, Inc. | 4 ;; Free Software Foundation, Inc. |
5 | 5 |
6 ;; Maintainer: FSF | 6 ;; Maintainer: FSF |
7 ;; Keywords: lisp, languages | 7 ;; Keywords: lisp, languages |
8 | 8 |
600 ((and (eq (car form) 'defvar) | 600 ((and (eq (car form) 'defvar) |
601 (cdr-safe (cdr-safe form)) | 601 (cdr-safe (cdr-safe form)) |
602 (boundp (cadr form))) | 602 (boundp (cadr form))) |
603 ;; Force variable to be re-set. | 603 ;; Force variable to be re-set. |
604 `(progn (defvar ,(nth 1 form) nil ,@(nthcdr 3 form)) | 604 `(progn (defvar ,(nth 1 form) nil ,@(nthcdr 3 form)) |
605 (setq ,(nth 1 form) ,(nth 2 form)))) | 605 (setq-default ,(nth 1 form) ,(nth 2 form)))) |
606 ;; `defcustom' is now macroexpanded to | 606 ;; `defcustom' is now macroexpanded to |
607 ;; `custom-declare-variable' with a quoted value arg. | 607 ;; `custom-declare-variable' with a quoted value arg. |
608 ((and (eq (car form) 'custom-declare-variable) | 608 ((and (eq (car form) 'custom-declare-variable) |
609 (default-boundp (eval (nth 1 form)))) | 609 (default-boundp (eval (nth 1 form)))) |
610 ;; Force variable to be bound. | 610 ;; Force variable to be bound. |