emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bastien.guerry@wikimedia.fr>
To: "Tom Breton (Tehom)" <tehom@panix.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-stow (Proof of concept)
Date: Sat, 12 Feb 2011 11:57:01 +0100	[thread overview]
Message-ID: <87wrl5tmwo.fsf@altern.org> (raw)
In-Reply-To: <a7b1eac03cb06430d7c44841306c5a06.squirrel@mail.panix.com> (Tom Breton's message of "Fri, 11 Feb 2011 20:22:49 -0500")

Hi Tom,

"Tom Breton (Tehom)" <tehom@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\0\b\307W\204\0	\307U\205P\310\n\307\"\203\0\n\202\x1f\311\312!\313\314\v\f\"\315\316\317\206/\320\fD\v\320\nDFEE\x14\v\n=\203F\321\x14\322E\202O\323\v\nDC\x14\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 (org-entry-get-multivalued-property (point) "STOW-TO")) (source (org-stow-source-at-point)) (target (org-stow-path->target target-path)) (actions (org-stow-get-actions (list source) target))) (dolist (act actions) (apply (function org-stow-do-action) act)) (org-toggle-tag "stowable" (quote off)) (org-toggle-tag "stowed" (quote on)))
  org-stow-item()
  call-interactively(org-stow-item t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)

-- 
 Bastien

  reply	other threads:[~2011-02-12 13:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 23:15 org-stow (Proof of concept) Tom Breton (Tehom)
2011-02-11 13:37 ` Bastien
2011-02-12  0:57   ` brian powell
2011-02-12  1:22   ` Tom Breton (Tehom)
2011-02-12 10:57     ` Bastien [this message]
2011-02-12 21:49       ` Tom Breton (Tehom)
2011-02-12 23:51         ` Bastien
2011-02-13 21:45           ` Tom Breton (Tehom)

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=87wrl5tmwo.fsf@altern.org \
    --to=bastien.guerry@wikimedia.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=tehom@panix.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).