GNU bug report logs - #21048
letrec is not documented in the manual

Previous Next

Package: emacs;

Reported by: Rustom Mody <rustompmody <at> gmail.com>

Date: Mon, 13 Jul 2015 16:00:06 UTC

Severity: minor

Tags: fixed

Found in version 24.4

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 21048 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rustompmody <at> gmail.com, 21048 <at> debbugs.gnu.org
Subject: Re: bug#21048: 24.4; Letrec docs
Date: Wed, 09 Oct 2019 19:33:20 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks, but I have trouble understanding what the text you wrote
> says.  I think it needs clarifying, or maybe a descriptive enough
> example.

Yeah, it's pretty subtle what the difference is -- feel free to rewrite
to make it clearer.

I went through the tree looking for a real-life example of when this
macro is useful, and the first half-dozen examples I looked at could
have been written with let* instead and worked just as well, as far as I
can tell.

But I found one in elisp-mode.el and I adapted it slightly and added
this to the manual:

----

For instance, here's a closure that removes itself from a hook after
being run once:

@lisp
(letrec ((hookfun (lambda ()
                    (message "Run once")
                    (remove-hook 'post-command-hook hookfun))))
  (add-hook 'post-command-hook hookfun))
@end lisp


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.