unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: smerge fix
       [not found] <rzqy9b0cd0u.fsf@albion.dl.ac.uk>
@ 2002-08-24  2:32 ` Richard Stallman
  2002-08-29 22:52   ` Dave Love
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2002-08-24  2:32 UTC (permalink / raw)
  Cc: emacs-devel

Using defvar inside eval-when-compile is rather a nuisance.
Whatever we recommend for preventing warnings about unknown
variables, it should be more convenient than that.

What we actually recommend for the purpose is a plain defvar.

Whatever we recommend for preventing warnings about unknown variables,
it should not cause anything to happen when the file is unloaded.

So either we should change unloading of packages to ignore
defvars that didn't specify a value,
or we should recommend something other than defvar
as the way to say it's ok to reference a certain variable
without defining it.

The easiest thing to do is to say that simple (defvar foo)
does not count as a definition.  Deleting the following code
in Fdefvar seems to be enough:

  else
    /* A (defvar <var>) should not take precedence in the load-history over
       an earlier (defvar <var> <val>), so only add to history if the default
       value is still unbound.  */
    if (NILP (tem))
      LOADHIST_ATTACH (sym);

There was another bug report saying that unloading a file
would do makunbound on the function names defined in the file.
That is not right either.  I decided to fix them both.

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

* Re: smerge fix
  2002-08-24  2:32 ` smerge fix Richard Stallman
@ 2002-08-29 22:52   ` Dave Love
  2002-08-30  6:11     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Love @ 2002-08-29 22:52 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Using defvar inside eval-when-compile is rather a nuisance.
> Whatever we recommend for preventing warnings about unknown
> variables, it should be more convenient than that.

[I don't see why it's more inconvenient than using it around `require',
and code that has to be portable to older versions and XEmacs will
need to carry on doing that.]

> What we actually recommend for the purpose is a plain defvar.

The example in (elisp)Tips uses eval-when-compile, and the text was
meant to caution explicitly to use it.

> The easiest thing to do is to say that simple (defvar foo)
> does not count as a definition.

When this came up before, you said that should not be done.  I think
you said that construct was intentionally used to declare variables
per se.

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

* Re: smerge fix
  2002-08-29 22:52   ` Dave Love
@ 2002-08-30  6:11     ` Richard Stallman
  2002-08-31 17:40       ` Dave Love
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2002-08-30  6:11 UTC (permalink / raw)
  Cc: emacs-devel

    > The easiest thing to do is to say that simple (defvar foo)
    > does not count as a definition.

    When this came up before, you said that should not be done.  I think
    you said that construct was intentionally used to declare variables
    per se.

Yes, occasionally it is, but no great harm will result from this
change.  It only means that those definitions won't be recognized by
certain Emacs features.  You can correct it by changing the definition
to provide a value.

There is no harm in providing an initial value, and a real definition
really ought to provide a doc string.

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

* Re: smerge fix
  2002-08-30  6:11     ` Richard Stallman
@ 2002-08-31 17:40       ` Dave Love
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Love @ 2002-08-31 17:40 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> There is no harm in providing an initial value, and a real definition
> really ought to provide a doc string.

That's what I'd have thought.  I was just recalling the previous
discussion, which went differently and led to me writing some doc.

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

end of thread, other threads:[~2002-08-31 17:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <rzqy9b0cd0u.fsf@albion.dl.ac.uk>
2002-08-24  2:32 ` smerge fix Richard Stallman
2002-08-29 22:52   ` Dave Love
2002-08-30  6:11     ` Richard Stallman
2002-08-31 17:40       ` Dave Love

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