From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: Archive subtrees hierarchical (keep the parent structure) Date: Tue, 05 Aug 2014 12:39:28 -0400 Message-ID: References: <87bns012a6.fsf@voyager.localdomain> <87wqanx88p.fsf@voyager.localdomain> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEhps-0002B7-K6 for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 12:43:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEhpn-0004ej-6A for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 12:43:40 -0400 Received: from mail-qg0-x229.google.com ([2607:f8b0:400d:c04::229]:65322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEhpn-0004ed-1a for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 12:43:35 -0400 Received: by mail-qg0-f41.google.com with SMTP id q107so1322034qgd.0 for ; Tue, 05 Aug 2014 09:43:34 -0700 (PDT) In-reply-to: <87wqanx88p.fsf@voyager.localdomain> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Florian Adamsky Cc: emacs-orgmode@gnu.org Hi Florian, * On 2014-08-05 at 11:32, Florian Adamsky wrote: >> This code looks useful and an improvement over the previous setup I >> was >> using. https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01218.html >> >> Can you explain what else is needed for your code to work? Currently I >> have > > No, just run M-x org-archive-subtree-hierarchical. I tried the code > with the latest org-mode version 8.3beta and with emacs -q and in both > cases it works without problems. > > However, if you set the following variable to the new function, it > should work with the default keybinding for org-archive: > > #+BEGIN_SRC emacs-lisp > (setq org-archive-default-command 'org-archive-subtree-hierarchical) > #+END_SRC > > If you have any trouble, please give me a note. You are correct that M-x org-archive-subtree-hierarchical works just fine. But I can't get it to work with the default keybinding as you show above. C-c C-x C-s is my (the?) default keybinding for archiving trees/subtrees. Is this the correct keybinding? When I describe that with C-h k C-c C-x C-s I see: > C-c C-x C-s runs the command org-advertized-archive-subtree, which is > an alias for `org-archive-subtree' in `org.el'. > > It is bound to C-c C-x C-s, to Archive file>. > > (org-advertized-archive-subtree &optional FIND-DONE) So I have tried mapping all of those to call the new function: (setq org-archive-default-command 'org-archive-subtree-hierarchical) (setq org-archive-subtree 'org-archive-subtree-hierarchical) (setq org-advertized-archive-subtree 'org-archive-subtree-hierarchical) But it still doesn't work. I can bind org-archive-subtree-hierarchical directly to C-c C-x C-s, which will work. Is that the correct solution? Thanks, -k.