[Top][All Lists]

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

defvar vs setqif..

From: D. Goel
Subject: defvar vs setqif..
Date: 19 May 2002 16:44:36 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

One often finds multiple defvar's for a single variable in libraries
and specially in .emacs ..  This is because people use (defvar 'foo)
at the top-level, when they mean to: (if (unboundp 'foo) (defvar
foo))..    There's no difference but the former affects tags,
find-function etc. etc. when it shouldn't...

An example: my .emacs needs to, say, (add-hook 'foo-mode-hook... ),
but the hook may not be defined, so i (defvar foo-mode-hook) before
this statement. The problem is that this would lead to etags and
find-function marking those places.

If there was a special-form that did exactly what defvar does, hopefully
people would stop using defvar when they didn't mean to...

I would not like if this new special-form started with a 'def'.. because
often it is convenient to ask etags to tag anything starting with
'def..' ... specially useful if you define your own defunn's and
defun-my etc. 

So i was wondering is a special-form like 'setqif' could be provided
whose only difference from 'defvar' is in a name...

D                                  <http://www.glue.umd.edu/~deego/>

reply via email to

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