From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: org-stow (Proof of concept) Date: Sat, 12 Feb 2011 11:57:01 +0100 Message-ID: <87wrl5tmwo.fsf@altern.org> References: <7c8ed5db209c02a3b75c8a843794e5b5.squirrel@mail.panix.com> <87ei7esndb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=49581 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoFJG-00031G-4l for emacs-orgmode@gnu.org; Sat, 12 Feb 2011 08:14:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoFJD-00022M-V2 for emacs-orgmode@gnu.org; Sat, 12 Feb 2011 08:14:45 -0500 Received: from mail-fx0-f41.google.com ([209.85.161.41]:51815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoFJD-000228-Io for emacs-orgmode@gnu.org; Sat, 12 Feb 2011 08:14:43 -0500 Received: by fxm12 with SMTP id 12so3847486fxm.0 for ; Sat, 12 Feb 2011 05:14:42 -0800 (PST) In-Reply-To: (Tom Breton's message of "Fri, 11 Feb 2011 20:22:49 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Tom Breton (Tehom)" Cc: emacs-orgmode@gnu.org Hi Tom, "Tom Breton (Tehom)" writes: > I pushed it just now; it's on branch stow-design.=20=20 Thanks!=20=20 (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=20 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 |=20 | * Tasks :Task: |=20 | ** TODO Drop off Stuff :stowable: | :PROPERTIES: | :ID: 746eba6c-3e4b-441e-815c-cb2b88d848c6 | :STOW-TO: /home/guerry/test.org Tasks=20 | :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 o= rg-stow-source) (or null org-stow-target))") signal(error ("Bad type spec: (list string (repeat org-stow-source) (or n= ull 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 or= g-stow-target))) cl-make-type-test(apair org-stow-apair) #[(form type &optional string) "\306 \203=00\307W\204=00 \307U\205P\310\= n\307\"\203=00\n\202=1F\311\312!\313\314=0B\f\"\315\316\317\206/\320\fD=0B\= 320\nDFEE=14=0B\n=3D\203F\321=14\322E\202O\323=0B\nDC=14\322F*\207" [cl-opt= imize-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/em= acs/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) :pa= th (org-stow-target->path target-parent) :rv-virt-path (cons (first apair) = (org-stow-target->rv-virt-path target-parent))))))(("Drop off Stuff" ([cl-s= truct-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 virtu= al) :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 "D= rop off Stuff"]) nil))) (let* ((alist (quote nil))) (dolist (src sources) (let* ((headline (org-s= tow-source->headline src)) (apair (assoc headline alist))) (if apair (progn= (check-type apair org-stow-apair) (push src (second apair))) (push (list h= eadline (list src) nil) alist)))) (when (eq (org-stow-target->type target-p= arent) (quote item)) (dolist (trgt (org-stow-get-target-children target-par= ent)) (let* ((rv-virt-path (org-stow-target->rv-virt-path trgt)) (headline = (if rv-virt-path (car rv-virt-path) (last ...))) (apair (assoc headline ali= st))) (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-44= 1e-815c-cb2b88d848c6" nil "Drop off Stuff"]) [cl-struct-org-stow-target ite= m ("/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))) ch= ild-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 ite= m ("/home/guerry/test.org" "Tasks") nil]) funcall(org-stow-get-actions-item ([cl-struct-org-stow-source "746eba6c-3= e4b-441e-815c-cb2b88d848c6" ("Drop off Stuff") nil]) [cl-struct-org-stow-ta= rget 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 targe= t-path)) (actions (org-stow-get-actions (list source) target))) (dolist (ac= t actions) (apply (function org-stow-do-action) act)) (org-toggle-tag "stow= able" (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) --=20 Bastien