From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Malone Subject: Two questions about using a =#+begin_src emacs-lisp= block Date: Sun, 20 Feb 2011 17:08:34 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1588657963==" Return-path: Received: from [140.186.70.92] (port=55018 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrHSH-0003A4-HV for emacs-orgmode@gnu.org; Sun, 20 Feb 2011 17:08:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrHSG-0005pi-FD for emacs-orgmode@gnu.org; Sun, 20 Feb 2011 17:08:37 -0500 Received: from mail-iw0-f169.google.com ([209.85.214.169]:53076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrHSF-0005op-U2 for emacs-orgmode@gnu.org; Sun, 20 Feb 2011 17:08:36 -0500 Received: by iwl42 with SMTP id 42so2209622iwl.0 for ; Sun, 20 Feb 2011 14:08:34 -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: emacs-orgmode --===============1588657963== Content-Type: multipart/alternative; boundary=90e6ba6e89c2075779049cbdfd05 --90e6ba6e89c2075779049cbdfd05 Content-Type: text/plain; charset=ISO-8859-1 Hi, First off, my =org-mode= is up-to-date - just did a =git pull && make clean && make=. Needless to say, the following were an issue before then... * Question 1: Is there a way to force, upon export, an =emacs-lisp= session to be run within the current buffer? For instance, the following code =============================================================== #+begin_src emacs-lisp :exports both (buffer-file-name) #+end_src =============================================================== exports to LaTeX as =============================================================== \begin{verbatim} (buffer-file-name) \end{verbatim} =============================================================== In other words, as far as I can tell, the code is passed to the interpreter, which does not know about the current buffer information, and therefore the result of the =emacs-lisp= code is an empty string. By contrast, if I use =C-c C-c= to evaluate the code block, then I get the proper result printed in the =.org= buffer: =============================================================== #+results: : /home/cmalone/org_tests/python_class_lstings.org =============================================================== Ultimately, I'd like to, upon export, have a =emacs-lisp= code block that does a regexp search on the file and returns a list of matches, which can then be placed in a =latex= code block. This sort of action suffers from the same issue as the =(buffer-file-name)= code - in essence this is a minimal (non)working example. * Question 2: Why does the following code, upon export, ask if I want to evaluate the =emacs-lisp= code *TWICE* and then give a /Invalid read syntax: "#"/ error in the message window?: =============================================================== #+begin_src emacs-lisp :exports both (buffer-file-name) #+end_src #+begin_src sh :exports both ls -l #+end_src =============================================================== Note that this works fine as long as the =:exports= tag for the =emacs-lisp= code block is *NOT* =both= or =results=. Also note that the value of the =:exports= tag on the =sh= code block is irelevant for this error to appear. Also, it doesn't have to be this particular combination of =emacs-lisp= and =sh= blocks; for instance it fails with an =emacs-lisp= and a =python= source block. Is this a bug? Chris --90e6ba6e89c2075779049cbdfd05 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: base64 SGksPGJyPjxicj5GaXJzdCBvZmYsIG15ID1vcmctbW9kZT0gaXMgdXAtdG8tZGF0ZSAtIGp1c3Qg ZGlkIGEgPWdpdCBwdWxsICZhbXA7JmFtcDsgbWFrZSBjbGVhbiAmYW1wOyZhbXA7IG1ha2U9LqAg TmVlZGxlc3MgdG8gc2F5LCB0aGUgZm9sbG93aW5nIHdlcmUgYW4gaXNzdWUgYmVmb3JlIHRoZW4u Li48YnI+PGJyPiogUXVlc3Rpb24gMTo8YnI+SXMgdGhlcmUgYSB3YXkgdG8gZm9yY2UsIHVwb24g ZXhwb3J0LCBhbiA9ZW1hY3MtbGlzcD0gc2Vzc2lvbiB0byBiZSBydW4gd2l0aGluIHRoZSBjdXJy ZW50IGJ1ZmZlcj+gIEZvciBpbnN0YW5jZSwgdGhlIGZvbGxvd2luZyBjb2RlPGJyPgo8YnI+PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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oKCgoKCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgoCA8YnI+oCBscyAtbKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoCA8YnI+CiMrZW5k X3NyYzxicj49PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT08YnI+PGJyPk5vdGUgdGhhdCB0aGlzIHdvcmtzIGZpbmUgYXMgbG9uZyBh cyB0aGUgPTpleHBvcnRzPSB0YWcgZm9yIHRoZSA9ZW1hY3MtbGlzcD0gY29kZSBibG9jayBpcyAq Tk9UKiA9Ym90aD0gb3IgPXJlc3VsdHM9LqAgQWxzbyBub3RlIHRoYXQgdGhlIHZhbHVlIG9mIHRo ZSA9OmV4cG9ydHM9IHRhZyBvbiB0aGUgPXNoPSBjb2RlIGJsb2NrIGlzIGlyZWxldmFudCBmb3Ig dGhpcyBlcnJvciB0byBhcHBlYXIuoCBBbHNvLCBpdCBkb2VzbiYjMzk7dCBoYXZlIHRvIGJlIHRo aXMgcGFydGljdWxhciBjb21iaW5hdGlvbiBvZiA9ZW1hY3MtbGlzcD0gYW5kID1zaD0gYmxvY2tz OyBmb3IgaW5zdGFuY2UgaXQgZmFpbHMgd2l0aCBhbiA9ZW1hY3MtbGlzcD0gYW5kIGEgPXB5dGhv bj0gc291cmNlIGJsb2NrLjxicj4KPGJyPklzIHRoaXMgYSBidWc/PGJyPjxicj5DaHJpczxicj4K --90e6ba6e89c2075779049cbdfd05-- --===============1588657963== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1588657963==--