From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Declaring a local dynamic variable? Date: 23 Sep 2013 16:17:39 GMT Message-ID: References: <878uyo4w8n.fsf@informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1379953222 15876 80.91.229.3 (23 Sep 2013 16:20:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Sep 2013 16:20:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 23 18:20:26 2013 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 1VO8s4-0001gJ-Pv for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Sep 2013 18:20:24 +0200 Original-Received: from localhost ([::1]:41623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO8s4-0000u1-Aj for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Sep 2013 12:20:24 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-X-Trace: individual.net fZckEu3gWhHfzHP727bidApBF7UWi+vqZiMeO7muHMJe3Hy+sp Cancel-Lock: sha1:gRgVgqWMnvURq8UKQIH83jYwt40= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/pre1.0.0-18 (Linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:201250 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:93520 Archived-At: Pascal J. Bourguignon wrote: > Joost Kremers writes: >> If I purposefully use a local dynamic variable as in: > > CL has the (declare (special var…)) declaration for that. Yeah, I was wondering if there was something similar for Elisp. > To implement that in emacs lisp, you could define defun, let, let* and > locally in a separate package, oops, no package in emacs. Something that will hopefully be remedied one day. :-) > To implement that in emacs lisp, you could define defun@, let@, > let*@ and locally@ as macros that will check for the special > declarations and define the variables as symbol-macrolets expanding to > (symbol-value 'variable), and that save the old symbol-value and restore > it. Something like: Erm, I believe you. :-) I'm afraid I don't have the time to go through your code and grok it fully, but I'm duly impressed. -- Joost Kremers joostkremers@fastmail.fm Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)