emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [RFI] Minutes of talks
Date: Thu, 20 Jan 2011 23:33:57 +0100	[thread overview]
Message-ID: <8739ontdbe.wl%n.goaziou@gmail.com> (raw)
In-Reply-To: <80ei89ui8k.fsf@missioncriticalit.com>

Hello,

>>>>> Sébastien Vauban writes:

> --8<---------------cut here---------------start------------->8--- 
> - Alice :: Our objectives are ... 
> - Collegue :: We can show you our architecture. It indeed does this
>   and this ... 
> - Me :: What's your deadline?
>--8<---------------cut here---------------end--------------->8---

> The second one is not that easy to write (typing the terms when
> RET'ing), and is a bit difficult to use when the ideas expressed by
> the person speaking have to be broken into item lists -- not to
> speak about the problem when mixing text and list items and back to
> text, all of that inside another item...

I may have some kind of solution for you:

  1. Get development code for lists at:
     
     git://github.com/ngz/org-mode-lists.git new-struct

  2. Write something like this:

     #+begin_src org
     ,* Act 1 --- Scene 1
     ,  :PROPERTIES:
     ,  :PERSONA:  Francisco Bernardo
     ,  :END:

     ,  Elsinore. A platform before the castle.

     ,  - Bernardo :: Who's there?
     #+end_src

  3. Try the following function:

     #+begin_src emacs-lisp
     (defun org-write-screenplay (&optional checkbox)
       "Insert item at point, with help to write scripts.
     This function looks for the multi-valued property \"PERSONA\" in
     the current headline, and get description tags preferably from
     it. New tags are added to the property at creation.

     Default tag value is chosen to facilitate writing dialogues.

     In another type of list, it just behaves like `org-insert-item'.
     
     If CHECKBOX is non-nil, add a checkbox to the newly created item."
       (interactive "P")
       (let ((itemp (org-in-item-p)) who)
         (if (not itemp)
             (error "Not in a list")
           (let* ((struct (save-excursion (goto-char itemp) (org-list-struct)))
                  (prevs (org-list-prevs-alist struct))
                  (prev-item (org-list-get-prev-item itemp struct prevs))
                  (cur-tag (org-list-get-tag itemp struct))
                  (prev-tag (and prev-item (org-list-get-tag prev-item struct)))
                  (persona (org-entry-get-multivalued-property (point) "PERSONA")))
             (if (and persona cur-tag (member cur-tag persona))
                 (progn
                   (setq who (org-icompleting-read
                              "Who? " persona nil nil nil nil (or prev-tag cur-tag)))
                   ;; Make sure additionnal elements are stored in property
                   (org-list-insert-item (point) struct prevs nil (concat who " :: "))
                   (unless (member who persona)
                     (org-entry-add-to-multivalued-property (point) "PERSONA" who)))
               ;; Non-script type of list: just insert a new item
               (let* ((desc (when prev-tag (concat (read-string "Term: ") " :: ")))
                      (checkp (and checkbox
                                   (or (not desc)
                                       (not (cdr (assq 'checkbox org-list-automatic-rules)))))))
                 (setq struct (org-list-insert-item (point) struct prevs checkp desc))
                 (org-list-write-struct struct (org-list-parents-alist struct))
                 (when checkp (org-update-checkbox-count-maybe))))
             (looking-at org-list-full-item-re)
             (goto-char (match-end 0))))))
     #+end_src

  4. Bind it to an accessible key. With ido, it should help a bit to
     write description lists.

Regards,

-- Nicolas

      parent reply	other threads:[~2011-01-20 22:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19 13:37 [RFI] Minutes of talks Sébastien Vauban
2011-01-19 16:51 ` R: " Giovanni Ridolfi
2011-01-20 22:33 ` Nicolas Goaziou [this message]

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=8739ontdbe.wl%n.goaziou@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.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).