From mboxrd@z Thu Jan 1 00:00:00 1970 From: jdavidboyd@adboyd.com (J. David Boyd) Subject: Re: copying a folded task expands when pasting Date: Thu, 17 Apr 2014 11:09:54 -0400 Message-ID: References: <87tx9scazp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WanxC-00058H-Ml for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 11:10:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wanx2-0008T7-Qs for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 11:10:18 -0400 Received: from plane.gmane.org ([80.91.229.3]:50168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wanx2-0008Sv-Kc for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 11:10:08 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Wanx1-0003kZ-AD for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 17:10:07 +0200 Received: from www1.g9.pair.com ([66.39.4.53]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Apr 2014 17:10:07 +0200 Received: from jdavidboyd by www1.g9.pair.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Apr 2014 17:10:07 +0200 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: emacs-orgmode@gnu.org Thorsten Jolitz writes: > jdavidboyd@adboyd.com (J. David Boyd) writes: > >> Is there anyway to turn this off. >> >> I keep my tasks folded, mostly, except for the current one I am working on. >> >> Prior to archiving, when I've marked them DONE, I move them to the >> bottom of >> the file they are in. >> >> So, I C-w on a folded DONE task, move to the bottom of the file, and >> S-Ins to >> place it there. But every time it unfolds it, leaving the point at >> the bottom >> of the entry. Then I need to move back up and refold it. >> >> Minor point yes, but it's the way I like to work. >> >> So, I haven't found any setting that relates to folding/unfolding on >> cut and >> paste. >> >> Am I missing something, or is that just the way it works? > > As always, it might already exist in Org-mode/Emacs, but its easy to > implement anyway: > > #+begin_src emacs-lisp > (defun tj/yank-folded-subtree () > (interactive) > (save-excursion > (yank '(4)) > (hide-subtree))) > #+end_src > > #+results: > : tj/yank-folded-subtree > > or a bit more convenient: > > #+begin_src emacs-lisp > (defun tj/kill-and-append-folded-subtree () > "Kill subtree at point and yank it folded at EOB." > (interactive) > (save-excursion > (org-mark-subtree) > (when (use-region-p) > (kill-region (region-beginning) (region-end))) > (goto-char (point-max)) > (unless (looking-at "^$") (newline)) > (yank '(4)) > (hide-subtree))) > #+end_src > > #+results: > : tj/kill-and-append-folded-subtree > > --- > cheers, > Thorsten Thanks, I like the idea of moving to the end automatically and pasting it folded. That is great! Dave