emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* copying a folded task expands when pasting
@ 2014-04-17 12:57 J. David Boyd
  2014-04-17 13:59 ` Thorsten Jolitz
  2014-04-17 14:44 ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: J. David Boyd @ 2014-04-17 12:57 UTC (permalink / raw)
  To: emacs-orgmode


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?

Thanks,

Dave in New Port Richey, FL

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: copying a folded task expands when pasting
  2014-04-17 12:57 copying a folded task expands when pasting J. David Boyd
@ 2014-04-17 13:59 ` Thorsten Jolitz
  2014-04-17 15:09   ` J. David Boyd
  2014-04-17 14:44 ` Bastien
  1 sibling, 1 reply; 5+ messages in thread
From: Thorsten Jolitz @ 2014-04-17 13:59 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: copying a folded task expands when pasting
  2014-04-17 12:57 copying a folded task expands when pasting J. David Boyd
  2014-04-17 13:59 ` Thorsten Jolitz
@ 2014-04-17 14:44 ` Bastien
  2014-04-17 15:12   ` J. David Boyd
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien @ 2014-04-17 14:44 UTC (permalink / raw)
  To: J. David Boyd; +Cc: emacs-orgmode

Hi,

jdavidboyd@adboyd.com (J. David Boyd) writes:

> 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.

You can use C-c C-x C-w to kill (cut) a subtree then C-c C-x C-y to
yank (paste) it again: if the subtree was folded when you cut it, it
will be pasted and folded.

HTH,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: copying a folded task expands when pasting
  2014-04-17 13:59 ` Thorsten Jolitz
@ 2014-04-17 15:09   ` J. David Boyd
  0 siblings, 0 replies; 5+ messages in thread
From: J. David Boyd @ 2014-04-17 15:09 UTC (permalink / raw)
  To: emacs-orgmode

Thorsten Jolitz <tjolitz@gmail.com> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: copying a folded task expands when pasting
  2014-04-17 14:44 ` Bastien
@ 2014-04-17 15:12   ` J. David Boyd
  0 siblings, 0 replies; 5+ messages in thread
From: J. David Boyd @ 2014-04-17 15:12 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> Hi,
>
> jdavidboyd@adboyd.com (J. David Boyd) writes:
>
>> 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.
>
> You can use C-c C-x C-w to kill (cut) a subtree then C-c C-x C-y to yank
> (paste) it again: if the subtree was folded when you cut it, it will be
> pasted and folded.
>
> HTH,

I should have know it was in there somewhere.  Thanks for the info!

Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-17 15:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-17 12:57 copying a folded task expands when pasting J. David Boyd
2014-04-17 13:59 ` Thorsten Jolitz
2014-04-17 15:09   ` J. David Boyd
2014-04-17 14:44 ` Bastien
2014-04-17 15:12   ` J. David Boyd

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).