Subject: bug#12124: 24.1.50; warning pollution

From: Stefan Monnier <[email-masked]>
Date: Fri, 03 Aug 2012 19:20:11 -0400

>>> Why instead of keeping old definitions of labels and flet don't we use
>>> aliases for cl-flet/labels (among others)?
>> Because they do not do the same (almost, but not quite).
> But the warnings say to use cl-flet/labels instead, so it should works
> as expected, what is the difference?

Warnings about obsolete features just point to the replacement feature,
but in many/most cases a human needs to adjust the code accordingly.

Some of the differences are that `labels' defines lexically-scoped vars
which can be captured in closures using the lexical-let machinery,
whereas `cl-labels' relies on lexical-binding to get the same effect, so
the vars won't get captured if the file doesn't use lexical-binding.

`flet' does something vaguely related to common-lisp's `flet' but in
a very different way (basically with dynamic scoping rather than
lexical scoping).  `cl-flet' works like common-lisp's `flet'.  As you
know, lexical and dynamic scoping often can be used interchangeably, but
not always.

> You can try with helm:
> install it and byte compile it.
> Do M-x helm-M-x and type some commands.
> You should have completion on your command.

> Now switch to another emacs and run the same command:
> It is not working, no completion.
> So it is not the flet itself that doesn't work but the function that is
> called inside this flet clause.
> recompile with this emacs and restart emacs.
> It is working.

Please make a separate bug-report for that.  And please give a more
detailed recipe (especially regarding the "install it, byte compile it
and do M-x ..." where it's not clear where and how "emacs" is started).

        Stefan