emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* feature request: org-yank to call org-paste-subtree
@ 2008-10-26  4:37 Samuel Wales
  2008-10-26  6:30 ` Carsten Dominik
  2008-10-28  8:10 ` Carsten Dominik
  0 siblings, 2 replies; 11+ messages in thread
From: Samuel Wales @ 2008-10-26  4:37 UTC (permalink / raw)
  To: emacs-orgmode

I am not up to coding this, but here is the defcustom.

(defcustom org-yank-adjust nil
  "Non-nil means that, where possible, org-yank will call org-paste-subtree
instead of yank.  This adjusts the level of the yank to avoid swallowing
succeeding headlines."
  :group 'org-edit-structure
  :type 'boolean)

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-10-26  4:37 feature request: org-yank to call org-paste-subtree Samuel Wales
@ 2008-10-26  6:30 ` Carsten Dominik
  2008-10-26  8:35   ` Samuel Wales
  2008-10-28  8:10 ` Carsten Dominik
  1 sibling, 1 reply; 11+ messages in thread
From: Carsten Dominik @ 2008-10-26  6:30 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Hi Samuel,

this is a very interesting idea, but I fear that in practice it might  
be too magic and cause side effects in places you'd would not want them.

I need to think more about this, comments are welcome.

- Carsten

On Oct 26, 2008, at 5:37 AM, Samuel Wales wrote:

> I am not up to coding this, but here is the defcustom.
>
> (defcustom org-yank-adjust nil
>  "Non-nil means that, where possible, org-yank will call org-paste- 
> subtree
> instead of yank.  This adjusts the level of the yank to avoid  
> swallowing
> succeeding headlines."
>  :group 'org-edit-structure
>  :type 'boolean)
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-10-26  6:30 ` Carsten Dominik
@ 2008-10-26  8:35   ` Samuel Wales
  0 siblings, 0 replies; 11+ messages in thread
From: Samuel Wales @ 2008-10-26  8:35 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

I find that org-paste-subtree works perfectly all the time for
headlines, and that org-yank does not work for headlines any time the
levels are wrong.  But I just started using them.

Approximate and prob wrong:

(defun org-yank-possibly-adjusted ()
  (save-excursion
    (if (and org-yank-adjust (org-kill-is-subtree-p))
        (call-interactively 'org-paste-subtree)
      (call-interactively 'yank))))
(defun org-yank ()
  "Yank, and if the yanked text is a single subtree, fold it.
In fact, if the yanked text is a sequence of subtrees, fold all of them."
  (interactive)
  (if org-yank-folded-subtrees
      (let ((beg (point)) end)
        (org-yank-possibly-adjusted)
...

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-10-26  4:37 feature request: org-yank to call org-paste-subtree Samuel Wales
  2008-10-26  6:30 ` Carsten Dominik
@ 2008-10-28  8:10 ` Carsten Dominik
  2008-10-28  8:16   ` Carsten Dominik
  2008-11-01  0:23   ` Samuel Wales
  1 sibling, 2 replies; 11+ messages in thread
From: Carsten Dominik @ 2008-10-28  8:10 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Hi Samuel,

this is not the default behavior in the latest git, below
is the preliminary documentation.  Depending on the reactions I get,
I might still turn this off by default.  However, I like it
and will keep it on.

Thanks!

- Carsten


---------------------------------------------------------------------
When yanking a cut/copied subtree or a series of trees, even
the nomal yank key `C-y' does now adjust the level of the tree
to make it fit into the current outline position, without
loosing its identity, and without swallowing other subtrees.

This uses the command `org-past-subtree'.  An additional
change in that command has been implemented:  Normally, this
command picks the right outline level from the surrounding
*visible* headlines, and uses the smaller on.  So it the
cursor is between a level 4 and a level 3 headline, the tree
will be pasted as level 3.  Now, if the cursor is actually
*at* the beginning of a headline, the level of that headline
will be used.  So lets say you have a tree like this:

   * Level one
   ** Level two
   (1)
   (2)* Level one again

with (1) and (2) indicating possible cursor positions for the
insertion.  When at (1), the tree will be pasted as level 2.
When at (2), it will be pasted as level 1.

If you do not like `C-y' to behave like this, configure the
variable `org-yank-adjusted-subtrees'.
--------------------------------------------------------------------

On Oct 26, 2008, at 5:37 AM, Samuel Wales wrote:

> I am not up to coding this, but here is the defcustom.
>
> (defcustom org-yank-adjust nil
>  "Non-nil means that, where possible, org-yank will call org-paste- 
> subtree
> instead of yank.  This adjusts the level of the yank to avoid  
> swallowing
> succeeding headlines."
>  :group 'org-edit-structure
>  :type 'boolean)
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-10-28  8:10 ` Carsten Dominik
@ 2008-10-28  8:16   ` Carsten Dominik
  2008-10-28  8:32     ` Manish
  2008-11-01  0:23   ` Samuel Wales
  1 sibling, 1 reply; 11+ messages in thread
From: Carsten Dominik @ 2008-10-28  8:16 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode


On Oct 28, 2008, at 9:10 AM, Carsten Dominik wrote:

> Hi Samuel,
>
> this is not the default behavior in the latest git, below

this is *now* the default.....   might become a typist in my
next life, but not in this one...... :-(

>
> is the preliminary documentation.  Depending on the reactions I get,
> I might still turn this off by default.  However, I like it
> and will keep it on.
>
> Thanks!
>
> - Carsten
>
>
> ---------------------------------------------------------------------
> When yanking a cut/copied subtree or a series of trees, even
> the nomal yank key `C-y' does now adjust the level of the tree
> to make it fit into the current outline position, without
> loosing its identity, and without swallowing other subtrees.
>
> This uses the command `org-past-subtree'.  An additional
> change in that command has been implemented:  Normally, this
> command picks the right outline level from the surrounding
> *visible* headlines, and uses the smaller on.  So it the
> cursor is between a level 4 and a level 3 headline, the tree
> will be pasted as level 3.  Now, if the cursor is actually
> *at* the beginning of a headline, the level of that headline
> will be used.  So lets say you have a tree like this:
>
>  * Level one
>  ** Level two
>  (1)
>  (2)* Level one again
>
> with (1) and (2) indicating possible cursor positions for the
> insertion.  When at (1), the tree will be pasted as level 2.
> When at (2), it will be pasted as level 1.
>
> If you do not like `C-y' to behave like this, configure the
> variable `org-yank-adjusted-subtrees'.
> --------------------------------------------------------------------
>
> On Oct 26, 2008, at 5:37 AM, Samuel Wales wrote:
>
>> I am not up to coding this, but here is the defcustom.
>>
>> (defcustom org-yank-adjust nil
>> "Non-nil means that, where possible, org-yank will call org-paste- 
>> subtree
>> instead of yank.  This adjusts the level of the yank to avoid  
>> swallowing
>> succeeding headlines."
>> :group 'org-edit-structure
>> :type 'boolean)
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-10-28  8:16   ` Carsten Dominik
@ 2008-10-28  8:32     ` Manish
  2008-10-28  8:53       ` Carsten Dominik
  0 siblings, 1 reply; 11+ messages in thread
From: Manish @ 2008-10-28  8:32 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Hi Carsten,

Latest update from git throws this and aborts compilation; both under
Windows+Cygwin and Debian Unstable.  Do I need any pre-requisite
package?

,----[ org compile error while "make" ]
| In end of data:
| org-bibtex.el:205:1:Warning: the following functions are not known to be
|     defined: bibtex-beginning-of-entry, bibtex-parse-entry,
|     bibtex-generate-autokey, bibtex-url
| Wrote /home/zms/elisp/org-mode.git/lisp/org-bibtex.elc
| emacs -batch -q -eval "(progn (add-to-list (quote load-path)
(expand-file-name \"./lisp/\")) (add-to-list (quote load-path)
\"/usr/local/share/emacs/site-lisp\"))" -f batch-byte-compile
lisp/org-clock.el
|
| In toplevel form:
| lisp/org-clock.el:1045:1:Error: Cannot open load file: timestamp
| make: *** [lisp/org-clock.elc] Error 1
`----

Regards,
-- 
Manish


On Tue, Oct 28, 2008 at 1:46 PM, Carsten Dominik wrote:
>
> On Oct 28, 2008, at 9:10 AM, Carsten Dominik wrote:
>
>> Hi Samuel,
>>
>> this is not the default behavior in the latest git, below
>
> this is *now* the default.....  might become a typist in my
> next life, but not in this one...... :-(
>
>>
>> is the preliminary documentation. Depending on the reactions I get,
>> I might still turn this off by default. However, I like it
>> and will keep it on.
>>
>> Thanks!
>>
>> - Carsten
>>
>>
>> ---------------------------------------------------------------------
>> When yanking a cut/copied subtree or a series of trees, even
>> the nomal yank key `C-y' does now adjust the level of the tree
>> to make it fit into the current outline position, without
>> loosing its identity, and without swallowing other subtrees.
>>
>> This uses the command `org-past-subtree'. An additional
>> change in that command has been implemented: Normally, this
>> command picks the right outline level from the surrounding
>> *visible* headlines, and uses the smaller on. So it the
>> cursor is between a level 4 and a level 3 headline, the tree
>> will be pasted as level 3. Now, if the cursor is actually
>> *at* the beginning of a headline, the level of that headline
>> will be used. So lets say you have a tree like this:
>>
>> * Level one
>> ** Level two
>> (1)
>> (2)* Level one again
>>
>> with (1) and (2) indicating possible cursor positions for the
>> insertion. When at (1), the tree will be pasted as level 2.
>> When at (2), it will be pasted as level 1.
>>
>> If you do not like `C-y' to behave like this, configure the
>> variable `org-yank-adjusted-subtrees'.
>> --------------------------------------------------------------------
>>
>> On Oct 26, 2008, at 5:37 AM, Samuel Wales wrote:
>>
>>> I am not up to coding this, but here is the defcustom.
>>>
>>> (defcustom org-yank-adjust nil
>>> "Non-nil means that, where possible, org-yank will call org-paste-subtree
>>> instead of yank. This adjusts the level of the yank to avoid swallowing
>>> succeeding headlines."
>>> :group 'org-edit-structure
>>> :type 'boolean)

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-10-28  8:32     ` Manish
@ 2008-10-28  8:53       ` Carsten Dominik
  0 siblings, 0 replies; 11+ messages in thread
From: Carsten Dominik @ 2008-10-28  8:53 UTC (permalink / raw)
  To: Manish; +Cc: emacs-orgmode



Fixed, thanks.


It was a typo in the package name.  But I have now actually removed  
the dependence on the package.

- Carsten


On Oct 28, 2008, at 9:32 AM, Manish wrote:

> Hi Carsten,
>
> Latest update from git throws this and aborts compilation; both under
> Windows+Cygwin and Debian Unstable.  Do I need any pre-requisite
> package?
>
> ,----[ org compile error while "make" ]
> | In end of data:
> | org-bibtex.el:205:1:Warning: the following functions are not known  
> to be
> |     defined: bibtex-beginning-of-entry, bibtex-parse-entry,
> |     bibtex-generate-autokey, bibtex-url
> | Wrote /home/zms/elisp/org-mode.git/lisp/org-bibtex.elc
> | emacs -batch -q -eval "(progn (add-to-list (quote load-path)
> (expand-file-name \"./lisp/\")) (add-to-list (quote load-path)
> \"/usr/local/share/emacs/site-lisp\"))" -f batch-byte-compile
> lisp/org-clock.el
> |
> | In toplevel form:
> | lisp/org-clock.el:1045:1:Error: Cannot open load file: timestamp
> | make: *** [lisp/org-clock.elc] Error 1
> `----
>
> Regards,
> -- 
> Manish
>
>
> On Tue, Oct 28, 2008 at 1:46 PM, Carsten Dominik wrote:
>>
>> On Oct 28, 2008, at 9:10 AM, Carsten Dominik wrote:
>>
>>> Hi Samuel,
>>>
>>> this is not the default behavior in the latest git, below
>>
>> this is *now* the default.....  might become a typist in my
>> next life, but not in this one...... :-(
>>
>>>
>>> is the preliminary documentation. Depending on the reactions I get,
>>> I might still turn this off by default. However, I like it
>>> and will keep it on.
>>>
>>> Thanks!
>>>
>>> - Carsten
>>>
>>>
>>> ---------------------------------------------------------------------
>>> When yanking a cut/copied subtree or a series of trees, even
>>> the nomal yank key `C-y' does now adjust the level of the tree
>>> to make it fit into the current outline position, without
>>> loosing its identity, and without swallowing other subtrees.
>>>
>>> This uses the command `org-past-subtree'. An additional
>>> change in that command has been implemented: Normally, this
>>> command picks the right outline level from the surrounding
>>> *visible* headlines, and uses the smaller on. So it the
>>> cursor is between a level 4 and a level 3 headline, the tree
>>> will be pasted as level 3. Now, if the cursor is actually
>>> *at* the beginning of a headline, the level of that headline
>>> will be used. So lets say you have a tree like this:
>>>
>>> * Level one
>>> ** Level two
>>> (1)
>>> (2)* Level one again
>>>
>>> with (1) and (2) indicating possible cursor positions for the
>>> insertion. When at (1), the tree will be pasted as level 2.
>>> When at (2), it will be pasted as level 1.
>>>
>>> If you do not like `C-y' to behave like this, configure the
>>> variable `org-yank-adjusted-subtrees'.
>>> --------------------------------------------------------------------
>>>
>>> On Oct 26, 2008, at 5:37 AM, Samuel Wales wrote:
>>>
>>>> I am not up to coding this, but here is the defcustom.
>>>>
>>>> (defcustom org-yank-adjust nil
>>>> "Non-nil means that, where possible, org-yank will call org-paste- 
>>>> subtree
>>>> instead of yank. This adjusts the level of the yank to avoid  
>>>> swallowing
>>>> succeeding headlines."
>>>> :group 'org-edit-structure
>>>> :type 'boolean)

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-10-28  8:10 ` Carsten Dominik
  2008-10-28  8:16   ` Carsten Dominik
@ 2008-11-01  0:23   ` Samuel Wales
  2008-11-13 22:32     ` Samuel Wales
  1 sibling, 1 reply; 11+ messages in thread
From: Samuel Wales @ 2008-11-01  0:23 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Thanks, Carsten, I look forward to trying it in the next release.

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-11-01  0:23   ` Samuel Wales
@ 2008-11-13 22:32     ` Samuel Wales
  2008-11-13 22:32       ` Samuel Wales
  2008-11-14  6:50       ` Carsten Dominik
  0 siblings, 2 replies; 11+ messages in thread
From: Samuel Wales @ 2008-11-13 22:32 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Another enhancement here would be getting yank-pop to work.

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-11-13 22:32     ` Samuel Wales
@ 2008-11-13 22:32       ` Samuel Wales
  2008-11-14  6:50       ` Carsten Dominik
  1 sibling, 0 replies; 11+ messages in thread
From: Samuel Wales @ 2008-11-13 22:32 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Ah, meant to say, works great.  :)

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

* Re: feature request: org-yank to call org-paste-subtree
  2008-11-13 22:32     ` Samuel Wales
  2008-11-13 22:32       ` Samuel Wales
@ 2008-11-14  6:50       ` Carsten Dominik
  1 sibling, 0 replies; 11+ messages in thread
From: Carsten Dominik @ 2008-11-14  6:50 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode


On Nov 13, 2008, at 11:32 PM, Samuel Wales wrote:

> Another enhancement here would be getting yank-pop to work.


OK, I made it work, but yank-pop will not adjust tree
levels or fold.  This would be complex to implement, and I am
not confident I can do this right.

- Carsten

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

end of thread, other threads:[~2008-11-14  7:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-26  4:37 feature request: org-yank to call org-paste-subtree Samuel Wales
2008-10-26  6:30 ` Carsten Dominik
2008-10-26  8:35   ` Samuel Wales
2008-10-28  8:10 ` Carsten Dominik
2008-10-28  8:16   ` Carsten Dominik
2008-10-28  8:32     ` Manish
2008-10-28  8:53       ` Carsten Dominik
2008-11-01  0:23   ` Samuel Wales
2008-11-13 22:32     ` Samuel Wales
2008-11-13 22:32       ` Samuel Wales
2008-11-14  6:50       ` Carsten Dominik

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