From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: org-paste-subtree and org-refile broken Date: Sat, 20 Aug 2011 20:41:24 +0200 Message-ID: <87liuoj57v.wl%dmaus@ictsoc.de> References: <87pqkac7hy.fsf@fastmail.fm> <87pqk93h9c.wl%dmaus@ictsoc.de> <877h6h4g2y.wl%dmaus@ictsoc.de> <87ty9lpfwj.fsf@fastmail.fm> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sat_Aug_20_20:41:24_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuqUI-00009W-86 for emacs-orgmode@gnu.org; Sat, 20 Aug 2011 14:41:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QuqUG-0001Wo-Ua for emacs-orgmode@gnu.org; Sat, 20 Aug 2011 14:41:42 -0400 Received: from app1b.xlhost.de ([213.202.242.162]:39323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuqUG-0001VU-My for emacs-orgmode@gnu.org; Sat, 20 Aug 2011 14:41:40 -0400 In-Reply-To: <87ty9lpfwj.fsf@fastmail.fm> 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: Matt Lundin Cc: David Maus , Org Mode , Sebastien Vauban --pgp-sign-Multipart_Sat_Aug_20_20:41:24_2011-1 Content-Type: text/plain; charset=US-ASCII At Sat, 13 Aug 2011 09:03:40 -0500, Matt Lundin wrote: > > David Maus writes: > > > At Sat, 13 Aug 2011 09:25:19 +0200, > > David Maus wrote: > >> > >> Hi Matt, > >> Hi Sebastien, > >> > >> I pushed a temporary workaround to master that should fix the problem > >> with refile and capture. Both depend on a buggy behavior of > >> org-paste-subtree, i.e. pasting a subtree *above* the target headline > >> when called with point at the beginning of the target headline. > > > > If you have already pulled, please pull again. Had confused something, > > fixed now. > > Thanks for fixing this! Refiling is working well now. Could you explain > what you mean by a "buggy behavior of org-paste-subtree." AFAIK, > org-paste-subtree has always pasted the subtree above the current tree > if the point is at the beginning of the headline. Is there something in > the documentation that suggests that this should not be the case? I > believe this behavior is consistent with > org-insert-heading-respect-content, which inserts a new heading above > the current heading if called at the beginning of a headline. For > instance, in the following example... > > --8<---------------cut here---------------start------------->8--- > * One > Text in one > * Two > Text in two > ** Subpoint two > Text in subpoint two. > * Three > Text in three > * Four > Text in four > --8<---------------cut here---------------end--------------->8--- > > If I kill headline four, move the point to the beginning of headline > three, and yank (i.e., call org-paste-subtree), I get the following, > which seems to me correct: > > --8<---------------cut here---------------start------------->8--- > * One > Text in one > * Two > Text in two > ** Subpoint two > Text in subpoint two. > * Four > Text in four > > * Three > Text in three > --8<---------------cut here---------------end--------------->8--- > > Similarly, if I place the cursor on three and call > org-insert-heading-respect-content (M-RET), the new headline is inserted > above the headline: > > --8<---------------cut here---------------start------------->8--- > * One > Text in one > * Two > Text in two > ** Subpoint two > Text in subpoint two. > * > * Three > Text in three > * Four > Text in four > --8<---------------cut here---------------end--------------->8--- > What bothers me is the fact that paste-subtree operates on the previous sibling of a headline if called with explicit level and point at the beginning of a headline. --8<---------------cut here---------------start------------->8--- * One Text in one * Two Text in two ** Subpoint two Text in subpoint two. * Three Text in three * Four Text in four --8<---------------cut here---------------end--------------->8--- Cut Four, move point at the beginning of Three and paste with a level of 2 (C-u 2 C-c C-x C-y) and you get: --8<---------------cut here---------------start------------->8--- * One Text in one * Two Text in two ** Subpoint two Text in subpoint two. ** Four Text in four * Three Text in three --8<---------------cut here---------------end--------------->8--- For refile this means that if you refile Four to Two, refile operates on Two by operating on Two's following-sibling, Three. There seems to be no practical problem, it's just... strange. Especially if you consider pasting a subtree with point somewhere on a headline but not at the beginning. Here [] represents point. --8<---------------cut here---------------start------------->8--- * One Text in one * T[]wo Text in two ** Subpoint two Text in subpoint two. * Three Text in three --8<---------------cut here---------------end--------------->8--- I've noticed that Org did not cover this case, e.g. calculated the paste level correctly but pasted above. What I expected Org to do in this case is to paste the subtree as last child of Two. If this expectation is implemented (I am on it) then pasting above if point is at beginning of headline is strange because point is still on the heading but the direction of paste is reversed. It's not a practical problem if the subtree is pasted with the same level as the target headline (i.e. its sibling), but still... Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Sat_Aug_20_20:41:24_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk5P/9QACgkQma24O1pEeObI8QD+PJdYpvg4jmb99/uo2IAKl+nF Zw78j+SdoybCaF9TJNABAMN/fWhMQ5A4WVxz2G/JpjVO0y8c3M/aPwUzK44/OJfL =4aFF -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sat_Aug_20_20:41:24_2011-1--