unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* defvar vs setqif..
@ 2002-05-19 20:44 D. Goel
  2002-05-19 20:59 ` Colin Walters
  2002-05-20  0:03 ` Miles Bader
  0 siblings, 2 replies; 15+ messages in thread
From: D. Goel @ 2002-05-19 20:44 UTC (permalink / raw




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/>
-- 

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-05-21 13:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-19 20:44 defvar vs setqif D. Goel
2002-05-19 20:59 ` Colin Walters
2002-05-20  0:05   ` Miles Bader
2002-05-20 19:08   ` D. Goel
2002-05-20 19:41     ` Thien-Thi Nguyen
2002-05-20 19:47       ` Stefan Monnier
2002-05-21 13:13         ` D. Goel
2002-05-20 20:05     ` Kai Großjohann
2002-05-20 21:33   ` Richard Stallman
2002-05-20  0:03 ` Miles Bader
2002-05-20 19:00   ` D. Goel
2002-05-20 19:24     ` Stefan Monnier
2002-05-20 19:40       ` D. Goel
2002-05-20 23:15     ` Miles Bader
2002-05-21 13:18       ` D. Goel

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).