From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: copying a folded task expands when pasting Date: Thu, 17 Apr 2014 15:59:54 +0200 Message-ID: <87tx9scazp.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wampw-0003g6-5G for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 09:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wampp-0000r1-T9 for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 09:58:44 -0400 Received: from plane.gmane.org ([80.91.229.3]:49668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wampp-0000qt-NT for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 09:58:37 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Wampo-0001Qo-Az for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 15:58:36 +0200 Received: from g231235137.adsl.alicedsl.de ([92.231.235.137]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Apr 2014 15:58:36 +0200 Received: from tjolitz by g231235137.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Apr 2014 15:58:36 +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 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