emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* var `date' lacks a prefix warnings
@ 2012-04-27 13:04 Martyn Jago
  2012-04-27 14:45 ` Bastien
  2012-04-27 18:53 ` Achim Gratz
  0 siblings, 2 replies; 5+ messages in thread
From: Martyn Jago @ 2012-04-27 13:04 UTC (permalink / raw)
  To: emacs-orgmode


Regarding the remaining Org-mode `lacks a prefix' warnings and
particularly in light of the recent message on emacs.devel [1] would it
not be sufficient to simply alias date and entry locally:

--8<---------------cut here---------------start------------->8---
(defvaralias 'org--date 'date)
(defvaralias 'org--entry 'entry)
--8<---------------cut here---------------end--------------->8---

Presumably this would be backwardly-compatible, and given a subsequent
name change in diary-lib.el a very simple integration test could catch
that very quickly.

If I get a positive response I can perhaps look at a patch and tests,
but if my understanding is amiss I will appreciate the heads-up.

Best, Martyn

p.s. I should point out that my personal view is that a serious well
maintained Emacs library such as Org-mode should have a zero warning
policy for official releases.

Footnotes: 
[1]  From: Chong Yidong <cyd@gnu.org>
     Subject: Evil defvars in org.el
     Newsgroups: gmane.emacs.devel
     To: Bastien Guerry <bzg@gnu.org>
     Cc: emacs-devel@gnu.org
     Date: Fri, 27 Apr 2012 11:17:37 +0800 (9 hours, 36 minutes, 57 seconds ago)

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

* Re: var `date' lacks a prefix warnings
  2012-04-27 13:04 var `date' lacks a prefix warnings Martyn Jago
@ 2012-04-27 14:45 ` Bastien
  2012-04-27 20:35   ` Martyn Jago
  2012-04-27 18:53 ` Achim Gratz
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien @ 2012-04-27 14:45 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Hi Martyn,

Martyn Jago <martyn.jago@btinternet.com> writes:

> Regarding the remaining Org-mode `lacks a prefix' warnings and
> particularly in light of the recent message on emacs.devel [1] would it
> not be sufficient to simply alias date and entry locally:
>
> (defvaralias 'org--date 'date)
> (defvaralias 'org--entry 'entry)
>
> Presumably this would be backwardly-compatible, and given a subsequent
> name change in diary-lib.el a very simple integration test could catch
> that very quickly.

We first need to fix Calendar so that it doesn't use ̀date' and `entry'
as the name for dynamically variables that are passed around.

Then preparing a patch for Org would be great.

I'll ping Glenn on the emacs-devel mailing list about this.

> p.s. I should point out that my personal view is that a serious well
> maintained Emacs library such as Org-mode should have a zero warning
> policy for official releases.

We are close to zero.  If you have time to work on some warning,
could you have a look into the one for `buffer-substring-filters'?
Also the one for "name" should be fixed.  With these two, and when
the problems from calendar are fixed, we will be closer to zero.

Thanks!

-- 
 Bastien

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

* Re: var `date' lacks a prefix warnings
  2012-04-27 13:04 var `date' lacks a prefix warnings Martyn Jago
  2012-04-27 14:45 ` Bastien
@ 2012-04-27 18:53 ` Achim Gratz
  2012-04-27 20:17   ` Martyn Jago
  1 sibling, 1 reply; 5+ messages in thread
From: Achim Gratz @ 2012-04-27 18:53 UTC (permalink / raw)
  To: emacs-orgmode

Martyn Jago writes:
> Regarding the remaining Org-mode `lacks a prefix' warnings and
> particularly in light of the recent message on emacs.devel [1] would it
> not be sufficient to simply alias date and entry locally:
>
> (defvaralias 'org--date 'date)
> (defvaralias 'org--entry 'entry)

That doesn't work, AFAIK: defvaralias binds the symbol (it looks up
what is behind the symbol and creates another symbol for it), but
dynamic scoping does not (you look up what's behind the symbol each time
you use it).  The problem is that when a symbol gets dynamically scoped
it cannot be used as a lexical symbol after that, so any code that uses
"date" and "entry" after the defvar doesn't get a lexcial binding.  You
would need a language construct that would let you capture a symbol
dynamically, internalize it (in essence it would be renaming that symbol
in some scope) and then erase all traces of that symbol having been
symbolically scoped so that it can be used lexically again.  I don't
think anything like that currently exists.

> p.s. I should point out that my personal view is that a serious well
> maintained Emacs library such as Org-mode should have a zero warning
> policy for official releases.

Here's a problem that originates outside of our control.  At the very
least, we can't fix it just in org.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

* Re: var `date' lacks a prefix warnings
  2012-04-27 18:53 ` Achim Gratz
@ 2012-04-27 20:17   ` Martyn Jago
  0 siblings, 0 replies; 5+ messages in thread
From: Martyn Jago @ 2012-04-27 20:17 UTC (permalink / raw)
  To: emacs-orgmode

Hi Achim

Achim Gratz <Stromeko@nexgo.de> writes:

> Martyn Jago writes:
>> Regarding the remaining Org-mode `lacks a prefix' warnings and
>> particularly in light of the recent message on emacs.devel [1] would it
>> not be sufficient to simply alias date and entry locally:
>>
>> (defvaralias 'org--date 'date)
>> (defvaralias 'org--entry 'entry)
>
> That doesn't work, AFAIK: defvaralias binds the symbol (it looks up
> what is behind the symbol and creates another symbol for it), but
> dynamic scoping does not (you look up what's behind the symbol each time
> you use it).  The problem is that when a symbol gets dynamically scoped
> it cannot be used as a lexical symbol after that, so any code that uses
> "date" and "entry" after the defvar doesn't get a lexcial binding.  You
> would need a language construct that would let you capture a symbol
> dynamically, internalize it (in essence it would be renaming that symbol
> in some scope) and then erase all traces of that symbol having been
> symbolically scoped so that it can be used lexically again.  I don't
> think anything like that currently exists.

I appreciate `defvaralias' doesn't work nicely with lexical variables,
but I am assuming somewhat that we are talking about dynamic variables
here?

If the global date / entry are dynamic then the dynamic `defvaralias'
alias will also be dynamic, and any prior use of the dynamic variable
will surely be a dynamic binding? I'm going to do some further testing
anyway, since I'm interested, but so far things appear to work.

>> p.s. I should point out that my personal view is that a serious well
>> maintained Emacs library such as Org-mode should have a zero warning
>> policy for official releases.
>
> Here's a problem that originates outside of our control.  At the very
> least, we can't fix it just in org.

I agree we can't fix the source of the problem but IF we can fix the
warning by removing `lack of prefixes' in Org-mode, then we have
demonstrated that we acknowledge the warning and have dealt with it.

In other words, if we can fix the problem within Org-mode we are not
propagating the problem. If we don't, then perhaps we didn't fix the
warning because we don't fix warnings.

However, it may indeed be impossible to fix as you pointed out!

Best, Martyn

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

* Re: var `date' lacks a prefix warnings
  2012-04-27 14:45 ` Bastien
@ 2012-04-27 20:35   ` Martyn Jago
  0 siblings, 0 replies; 5+ messages in thread
From: Martyn Jago @ 2012-04-27 20:35 UTC (permalink / raw)
  To: emacs-orgmode

Hi Bastien

Bastien <bzg@gnu.org> writes:

> Hi Martyn,
>
> Martyn Jago <martyn.jago@btinternet.com> writes:
>

[...]

> We first need to fix Calendar so that it doesn't use ̀date' and `entry'
> as the name for dynamically variables that are passed around.
>
> Then preparing a patch for Org would be great.
>
> I'll ping Glenn on the emacs-devel mailing list about this.

I took in Glen's and Edward's replies - wow what a history lesson!

 - quote Edward Reingold: "who'd have guessed how much it would grow
over almost 30 years, or that my code would still be around" [1]

So it doesn't look like the problem will be fixed at source any time
quickly.  

I'm going to persevere until I've talked myself out of it since I'm
learning a lot!

Best, Martyn



bookmark: 

http://article.gmane.org/gmane.emacs.devel/150087

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

end of thread, other threads:[~2012-04-27 20:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-27 13:04 var `date' lacks a prefix warnings Martyn Jago
2012-04-27 14:45 ` Bastien
2012-04-27 20:35   ` Martyn Jago
2012-04-27 18:53 ` Achim Gratz
2012-04-27 20:17   ` Martyn Jago

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).