emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ido Magal <ido@idomagal.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org, Rainer M Krug <r.m.krug@gmail.com>
Subject: Re: Embedded code
Date: Thu, 20 Jan 2011 19:54:23 -0800	[thread overview]
Message-ID: <AANLkTi=PccKOfjL26W6PRzwA-aAsXMM6sRovSgnh8nk8@mail.gmail.com> (raw)
In-Reply-To: <AANLkTin5Cv9_P-JNhjHN0yideWbZECTAYS69iKBNnMW1@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2466 bytes --]

So I was able to construct the following functioning bit of code from
someone else recent post:

#+begin_src emacs-lisp :results output raw
(defun tagged (tag &optional scope)
 (let ((entries ()))
   (org-map-entries
     (lambda ()
       (add-to-list 'entries
                    (list (concat "[[" (nth 4 (org-heading-components))
"]]"))))
     tag scope)

   (sort entries (lambda (f s)
                    (string-lessp (car f) (car s))))))

(tagged "buy" 'agenda)
#+end_src

I have a few elementary questions I hope someone can bother to answer:

1. It seems that when org prints a list, it automatically formats it into a
table.  In lisp, what's a proper way of converting a list to a string so I
can have more control over the format?  My first attempts were unsuccessful.

2. I'd like to use Org's macros to replace

#+begin_src
(tagged "foo")
#+end_src

with

{{{(tagged "foo")}}}

but Org macros only expand on export.  Would it be feasible to change the
macro functionality and hook into file loading?  Or is there some other way
I can slim these down to be terse?


On Tue, Jan 18, 2011 at 22:46, Ido Magal <ido@idomagal.com> wrote:

> Excellent.
>
> Now that I see that it's possible, I'm struggling to find sufficient
> examples to help me understand how to go about writing the bits of lisp that
> would allow to me create useful blocks of org-mode code, such as a
> back-links block or a list of links to entries of a certain tag.  I'm
> lisp-illiterate but I was expecting that if it was possible then someone had
> already done it and that I could cut and paste my way to success.
>
> Do these examples exist?  Does anyone use babel to extend the functionality
> of the note organizing aspect of org-mode?  All of the babel examples I've
> found relate to manipulating content for export as opposed to enhancing
> organizational utility.
>
> Cheers and thanks again.
>
>
> On Tue, Jan 18, 2011 at 12:42, Eric Schulte <schulte.eric@gmail.com>wrote:
>
>> >
>> > 2. Is it possible to manipulate or reference the results so that they're
>> not
>> > bound to a RESULTS block.  I'm finding all of the blocks of orgmode
>> > distracting and I'm trying to avoid and eliminate them as much as
>> possible.
>> >  I'm not used to it and they really impedes the readability of my notes.
>>
>> Yes, you can change the look of the results of code blocks, see the
>> results header argument for more information.
>> http://orgmode.org/manual/results.html
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 3749 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

  reply	other threads:[~2011-01-21  3:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17 16:06 Embedded code Ido Magal
2011-01-17 22:01 ` Ido Magal
2011-01-17 23:48   ` Eric Schulte
2011-01-18  8:51     ` Rainer M Krug
2011-01-18 16:16       ` Eric Schulte
2011-01-18 16:44         ` Rainer M Krug
2011-01-18 17:12         ` Ido Magal
2011-01-18 18:35           ` Nick Dokos
2011-01-18 20:42           ` Eric Schulte
2011-01-19  6:46             ` Ido Magal
2011-01-21  3:54               ` Ido Magal [this message]
2011-01-22  2:05                 ` Eric Schulte
2011-01-22  2:10                   ` Ido Magal
2011-01-25  4:41                   ` Ido Magal
2011-01-25 17:16                     ` Eric Schulte
2011-01-26  4:44                       ` Ido Magal
2011-01-26  4:54                         ` Eric Schulte
2011-01-27 20:45                           ` Ido Magal
2011-01-26  9:41                         ` Sébastien Vauban
2011-01-27 22:51                           ` Eric Schulte
2011-02-04  6:52                   ` Ido Magal
2011-02-04 20:35                     ` Eric Schulte
2011-01-19 23:54         ` Dan Davison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi=PccKOfjL26W6PRzwA-aAsXMM6sRovSgnh8nk8@mail.gmail.com' \
    --to=ido@idomagal.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=r.m.krug@gmail.com \
    --cc=schulte.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).