Re: [Orgmode] org-stow (Proof of concept)

2011-02-13 Thread Tom Breton (Tehom)

 I'm roughly parsing 37% of this :)

I will try to use less jargon.

 Again, can you demonstrate a clear and simple use-case, assuming people
 like me don't know anything about stow, stew, straw or whatsover?

OK, here's a use-case.  This is actually what I did right now while
recording a note that tells me to document a use-case.

 * First I make a note with org-remember (C-c r)
 * C-u C-c C-c to save it and go to it
 * M-x org-stow-make-item-stowable
   * It prompts me for a parent item.  I choose
 
\home\tehom\projects\elisp\org-mode\doc\local\org-stow.org/org-stow/Progress/
 With TAB, that's just a few keystrokes
 * M-x org-stow-item
   * Now there is a dblock from under Progress in org-stow.org that
 corresponds to this note, but that dblock is still empty.
 * Update dblocks
   * C-u C-c C-x C-u
   * You don't have to do this immediately; it will work at any time
   * Now it appears in two places: In notes and under the heading Progress.
 * Can do other work on that item
   * In fact, I set it to TODO
   * Update dblocks again.
   * Now the stowed copy says TODO too
   * When I finish the writeup, I will come back here and set DONE
 and update.

Another use-case:
 * At this point I added this write-up as another note.  So now
   everything I'm doing to answer you is in notes.
 * M-x org-stow-make-item-stowable
   * This time I store it in
 \home\tehom\projects\elisp\org-mode\doc\local\org-stow.org/org-stow/Docs/
 * M-x org-stow-item, update dblocks
   * Now the doc section of this file contains this item
 * Finish writing it (a moment from now) and update.

So I've added to a document while just dealing with notes, and
crucially, I can retract individual notes that become obsolete.


Take care,

Tom Breton (Tehom)



___
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


Re: [Orgmode] org-stow (Proof of concept)

2011-02-12 Thread Bastien
Hi Tom,

Tom Breton (Tehom) te...@panix.com writes:

 I pushed it just now; it's on branch stow-design.  

Thanks!  

(On a side note: I'd rather keep org-mode.git (remote) branches for
stuff we know we _will_ include, not just for testing code.  Better 
point to a public branch of yours in that case.)

 Here is a little
 documentation:

Can you show a real use-case?  I'm still unsure in what situation
org-stow.el is useful... lack of imagination :)

 The commands:

  * org-stow-make-item-stowable makes an item stowable.  It prompts you for
 where to stow the item and remembers that information.

  * org-stow-item stows the item at point, marking it accordingly.

I tries this.

With this file:

,
| #+TITLE: Test org-stow
| 
| * Tasks   
:Task:
| 
| ** TODO Drop off Stuff
:stowable:
|:PROPERTIES:
|:ID:   746eba6c-3e4b-441e-815c-cb2b88d848c6
|:STOW-TO:  /home/guerry/test.org Tasks 
|:END:
`

M-x org-stow-make-item-stowable RET on TODO Drop off stuff is okay.

But M-x org-stow-item RET on the same item is not -- here is a
backtrace:

Debugger entered--Lisp error: (error Bad type spec: (list string (repeat 
org-stow-source) (or null org-stow-target)))
  signal(error (Bad type spec: (list string (repeat org-stow-source) (or null 
org-stow-target
  error(Bad type spec: %s (list string (repeat org-stow-source) (or null 
org-stow-target)))
  cl-make-type-test(apair (list string (repeat org-stow-source) (or null 
org-stow-target)))
  cl-make-type-test(apair org-stow-apair)
  #[(form type optional string) \306 \203\307W\204 
\307U\205P\310\n\307\\203\n\202\311\312!\313\314\f\\315\316\317\206/\320\fD\320\nDFEE\n=\203F\321\322E\202O\323\nDC\322F*\207
 [cl-optimize-speed cl-optimize-safety form temp type string cl-compiling-file 
3 cl-simple-expr-p make-symbol --cl-var-- or cl-make-type-test signal (quote 
wrong-type-argument) list quote progn nil let body] 9 
(/usr/local/share/emacs/24.0.50/lisp/emacs-lisp/cl-macs.elc . 93074)](apair 
org-stow-apair)
  (check-type apair org-stow-apair)
  (lambda (apair) (check-type apair org-stow-apair) (if (third apair) (cdr 
apair) (list (second apair) (org-stow-make-target :type (quote virtual) :path 
(org-stow-target-path target-parent) :rv-virt-path (cons (first apair) 
(org-stow-target-rv-virt-path target-parent))((Drop off Stuff 
([cl-struct-org-stow-source 746eba6c-3e4b-441e-815c-cb2b88d848c6 nil Drop 
off Stuff]) nil))
  mapcar((lambda (apair) (check-type apair org-stow-apair) (if (third apair) 
(cdr apair) (list (second apair) (org-stow-make-target :type (quote virtual) 
:path (org-stow-target-path target-parent) :rv-virt-path (cons (first apair) 
(org-stow-target-rv-virt-path target-parent)) ((Drop off Stuff 
([cl-struct-org-stow-source 746eba6c-3e4b-441e-815c-cb2b88d848c6 nil Drop 
off Stuff]) nil)))
  (let* ((alist (quote nil))) (dolist (src sources) (let* ((headline 
(org-stow-source-headline src)) (apair (assoc headline alist))) (if apair 
(progn (check-type apair org-stow-apair) (push src (second apair))) (push (list 
headline (list src) nil) alist (when (eq (org-stow-target-type 
target-parent) (quote item)) (dolist (trgt (org-stow-get-target-children 
target-parent)) (let* ((rv-virt-path (org-stow-target-rv-virt-path trgt)) 
(headline (if rv-virt-path (car rv-virt-path) (last ...))) (apair (assoc 
headline alist))) (if apair (progn (check-type apair org-stow-apair) (assert 
(null ...)) (setf (third apair) trgt)) (push (list headline (quote nil) trgt) 
alist) (mapcar (function (lambda (apair) (check-type apair org-stow-apair) 
(if (third apair) (cdr apair) (list (second apair) (org-stow-make-target :type 
(quote virtual) :path (org-stow-target-path target-parent) :rv-virt-path (cons 
... ...)) alist))
  org-stow-get-split-arglists(([cl-struct-org-stow-source 
746eba6c-3e4b-441e-815c-cb2b88d848c6 nil Drop off Stuff]) 
[cl-struct-org-stow-target item (/home/guerry/test.org Tasks) nil])
  (let* ((source-children (apply (function nconc) (mapcar (function (lambda 
(src) (let* ... ... children))) source-list))) (child-groups 
(org-stow-get-split-arglists source-children target))) (apply (function nconc) 
(mapcar (function (lambda (group) (apply (function org-stow-get-actions) 
group))) child-groups)))
  org-stow-get-actions-item(([cl-struct-org-stow-source 
746eba6c-3e4b-441e-815c-cb2b88d848c6 (Drop off Stuff) nil]) 
[cl-struct-org-stow-target item (/home/guerry/test.org Tasks) nil])
  funcall(org-stow-get-actions-item ([cl-struct-org-stow-source 
746eba6c-3e4b-441e-815c-cb2b88d848c6 (Drop off Stuff) nil]) 
[cl-struct-org-stow-target item (/home/guerry/test.org Tasks) nil])
  org-stow-get-actions(([cl-struct-org-stow-source 
746eba6c-3e4b-441e-815c-cb2b88d848c6 (Drop off Stuff) nil]) 
[cl-struct-org-stow-target item (/home/guerry/test.org Tasks) nil])
  (let* ((target-path 

Re: [Orgmode] org-stow (Proof of concept)

2011-02-12 Thread Tom Breton (Tehom)

 M-x org-stow-make-item-stowable RET on TODO Drop off stuff is okay.

 But M-x org-stow-item RET on the same item is not -- here is a
 backtrace:

D'oh!  I completely forgot about the type-checking code!

That's for development, not production.  It just assertfails if the wrong
type is used.  Very helpful in finding problems early.  It relies on a
type-checking support module in emtest that defines certain types that
Common Lisp provides but cl doesn't.

I am pushing a quick fix where if that module is not available, the type
just always succeeds.

If you'd like the type-checking support (which is stand-alone) or all of
emtest, I can certainly include it.  Since you seem to have chosen ert, I
don't know what you want in this regard.

Tom Breton (Tehom)



___
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


Re: [Orgmode] org-stow (Proof of concept)

2011-02-12 Thread Bastien
Hi Tom,

Tom Breton (Tehom) te...@panix.com writes:

 D'oh!  I completely forgot about the type-checking code!

 That's for development, not production.  It just assertfails if the wrong
 type is used.  Very helpful in finding problems early.  It relies on a
 type-checking support module in emtest that defines certain types that
 Common Lisp provides but cl doesn't.

 I am pushing a quick fix where if that module is not available, the type
 just always succeeds.

 If you'd like the type-checking support (which is stand-alone) or all of
 emtest, I can certainly include it.  Since you seem to have chosen ert, I
 don't know what you want in this regard.

I'm roughly parsing 37% of this :)

Again, can you demonstrate a clear and simple use-case, assuming people
like me don't know anything about stow, stew, straw or whatsover?

Thanks!!

-- 
 Bastien

___
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


Re: [Orgmode] org-stow (Proof of concept)

2011-02-11 Thread Bastien
Tom Breton (Tehom) te...@panix.com writes:

 Any interest in trying this out?  I can push it if anyone else wants to
 try it out.

I'm interested!  Please let me know where I can read some code.

Thanks :)

-- 
 Bastien

___
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


Re: [Orgmode] org-stow (Proof of concept)

2011-02-11 Thread Tom Breton (Tehom)
 Tom Breton (Tehom) te...@panix.com writes:

 Any interest in trying this out?  I can push it if anyone else wants to
 try it out.

 I'm interested!  Please let me know where I can read some code.

 Thanks :)

I pushed it just now; it's on branch stow-design.  Here is a little
documentation:

*** How it works

It works by using dblocks as fake symbolic links.  After you stow items,
you do org-dblock-update with a prefix argument (C-u C-c C-x C-u) which
syncs the dblocks.

That may or may not be the best way to do this.  It's still experimental.

*** How to use it

The commands:

 * org-stow-make-item-stowable makes an item stowable.  It prompts you for
where to stow the item and remembers that information.

 * org-stow-item stows the item at point, marking it accordingly.

 * org-stow-unstow-item unstows the item at point, if it was stowed,
marking it accordingly.

 * org-dblock-update - existing org command.  Updates the dblocks to
reflect the current (un)stowing.

Thanks for the interest, and thanks Brian too.

Tom Breton (Tehom)



___
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


[Orgmode] org-stow (Proof of concept)

2011-01-14 Thread Tom Breton (Tehom)
I've written an addon that I call org-stow.  The basic idea is that
all remember notes live in a notes section, and you can make another
location pretend that the note lives there.  You build all or part of
a document that way.  If you know how stow works, it's like stow for
outline items.

Yes, it's a little bit like refiling a note, but:
 * Hopefully it's more convenient and natural to populate a whole
   document this way.
 * If you change your mind about a note later, you can just unstow
   it.

It's at the proof of concept stage now.  It stows notes, but doesn't
yet unstow them.

I used dblocks to mirror notes.  They are automatically inserted by
org-stow, and their dynamic contents is essentially copied from the
notes.

Any interest in trying this out?  I can push it if anyone else wants to
try it out.

Tom Breton (Tehom)



___
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