From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rafael Subject: Please help with a filter Date: Tue, 02 Sep 2014 13:55:37 -0500 Message-ID: <87oauxetsm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOtF9-0003uC-OM for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 14:56:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOtF0-0001P7-Nf for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 14:55:51 -0400 Received: from mail-pd0-x22f.google.com ([2607:f8b0:400e:c02::22f]:43182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOtF0-0001P2-Fk for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 14:55:42 -0400 Received: by mail-pd0-f175.google.com with SMTP id ft15so9310603pdb.34 for ; Tue, 02 Sep 2014 11:55:40 -0700 (PDT) Received: from ladell ([200.57.62.44]) by mx.google.com with ESMTPSA id n2sm6500088pdh.41.2014.09.02.11.55.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Sep 2014 11:55:40 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emacs-orgmode list I want that the result of exporting to markdown the following two blocks be identical: #+begin_src org #+BEGIN_MARKDOWN
#+END_MARKDOWN #+BEGIN_SRC sage 2+3 #+END_SRC #+end_src I have tried the following, which seems similar to examples in the web, and I think it should work, but it doesn't: #+begin_src emacs-lisp (defun org-octopress-src-block (contents backend info) (when (eq backend 'md) (let ( (lang (org-element-property :language info)) (value (org-element-property :value info))) (message "Language is %s. Value is %s" lang value) (when (eq lang "sage" ) (format "
\n" value )) )) ) (add-to-list 'org-export-filter-src-block-functions 'org-octopress-src-block) #+end_src My debugging message says: 'Language is nil. Value is nil', so I cannot get the name of the language from the source code. What should I do to get the filter to work? Thanks in advance,