From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Surrounding Lexical Variable Reference in the Body of defun Date: Wed, 22 Aug 2012 11:11:06 -0400 Message-ID: References: <8b43586d-2ad4-4cf6-ae15-446e909bf496@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1345648516 31355 80.91.229.3 (22 Aug 2012 15:15:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Aug 2012 15:15:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 22 17:15:16 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T4CeK-0001Cb-Cs for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Aug 2012 17:15:16 +0200 Original-Received: from localhost ([::1]:44201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4CeI-0000S9-Nl for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Aug 2012 11:15:14 -0400 Original-Received: by 10.66.85.199 with SMTP id j7mr3216095paz.36.1345648267571; Wed, 22 Aug 2012 08:11:07 -0700 (PDT) Original-Path: usenet.stanford.edu!g10no2990852pbl.0!news-out.google.com!t10ni20369549pbh.0!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe04.iad.POSTED!00000000!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) Cancel-Lock: sha1:tBQVUP5nXwT81ShHjeCmtHTCZEI= Original-Lines: 16 Original-X-Complaints-To: abuse@UsenetServer.com Original-NNTP-Posting-Date: Wed, 22 Aug 2012 15:11:07 UTC X-Received-Bytes: 1277 Original-Xref: usenet.stanford.edu gnu.emacs.help:194110 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86475 Archived-At: > 1. Why does this restriction exists? Is it inevitable because of > some design decision of Emacs? Or is it temporary and removed in > a (near) future release? It is because of a technical limitation in the byte-compiler's handling of dynamically loaded docstrings. You can work around this by replacing your defun with (defalias counter (lambda () (setq x (1+ x)))). I believe this is fixed in the Emacs trunk (where defun is just a macro that expands to a defalias+lambda and where the docstrings handling was improved accordingly). Stefan