From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Two questions about using a =#+begin_src emacs-lisp= block Date: Mon, 21 Feb 2011 15:34:42 -0700 Message-ID: <8739nh2ezn.fsf@gmail.com> References: <874o7x5ms7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=36800 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PreMN-0000RQ-0U for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 17:36:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PreMK-0003ZZ-PW for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 17:36:02 -0500 Received: from mail-gw0-f47.google.com ([74.125.83.47]:40704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PreMK-0003ZT-EG for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 17:36:00 -0500 Received: by gwj18 with SMTP id 18so1230566gwj.34 for ; Mon, 21 Feb 2011 14:35:59 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dan Davison Cc: Chris Malone , emacs-orgmode [...] >> >> This is due to the fact that during export Org-mode copies the entire >> buffer contents into a new export buffer (which is not associated with >> any file, hence `buffer-file-name' returning nothing). This is done so >> that the exporter can operate destructively on the file contents without >> affecting the original buffer. > > Ideally this should be an implementation detail that is completely > hidden from the user. So I'd say that the fact that execution on export > does not behave like interactive execution is a bug. Should we consider > fixing this? > I'd push back on considering this a bug. Babel currently makes no guarantees about the location in which evaluation takes place (other than the :dir header argument), and I would consider it an implementation detail that evaluation of emacs-lisp does sometimes take place inside the Org-mode buffer (this is not true, nor could it be for any other language). By contrast Babel *does* guarantee that header arguments are resolved in the original Org-mode buffer, a guarantee that we explicitly maintain during export despite the Org-mode buffer shuffling. Best -- Eric