"Rick Lupton" <m...@ricklupton.name> writes: > Thanks for the comments. On this point, I'd like to modify > `org-insert-heading' to allow for choosing the level of the newly inserted > heading, but first wanted to check if you have a preference for how to change > it. > > > I think it would be simplest to change the current: > > (defun org-insert-heading (&optional arg invisible-ok top) > "...When optional argument TOP is non-nil, insert a level 1 heading, > unconditionally." > > to: > > (defun org-insert-heading (&optional arg invisible-ok level) > "...When optional argument LEVEL is a number, insert a heading at that > level. For backwards compatibility, when LEVEL is non-nil but not a number, > insert a level-1 heading." > > but that is not totally backwards compatible -- is that ok?
I think that it is OK. I very much doubt that anyone at all uses numerical value for TOP in the existing `org-insert-heading' calls from Elisp. And adding yet another extra optional argument is not justified in this particular case. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>