Re: get the body of a heading up to the next subheading

2020-05-22 Thread Bastien
Hi John, John Kitchin writes: > Here is a new version that might fail some other way! > > (defun canvas-org-get-heading-body () >   "Return the body of the current heading up to the next heading." >   (interactive) >   (save-excursion >     (unless (org-at-heading-p) >       (org-previous-visibl

Re: get the body of a heading up to the next subheading

2020-05-13 Thread Ihor Radchenko
> I don't think there's anything built-in, no. I have needed this in > various places, and did something similar to the above, except with a > combination of `org-back-to-heading', `org-end-of-meta-data', then > `outline-next-heading'. Hmm. I just noticed a reference to built-in org-agenda-get-so

Re: get the body of a heading up to the next subheading

2020-05-13 Thread Eric Abrahamsen
John Kitchin writes: > Thanks! Here is what I am currently using: > > (defun canvas-org-get-heading-body () > "Return the body of the current heading up to the next heading." > (interactive) > (save-excursion > (unless (org-at-heading-p) > (org-previous-visible-heading 1)) > (

Re: get the body of a heading up to the next subheading

2020-05-13 Thread John Kitchin
good point, thanks! Here is a new version that might fail some other way! (defun canvas-org-get-heading-body () "Return the body of the current heading up to the next heading." (interactive) (save-excursion (unless (org-at-heading-p) (org-previous-visible-heading 1)) (org-end-

Re: get the body of a heading up to the next subheading

2020-05-13 Thread Ihor Radchenko
> Thanks! Here is what I am currently using: Note that your code may fail if there is an inline task in the body. Best, Ihor John Kitchin writes: > Thanks! Here is what I am currently using: > > (defun canvas-org-get-heading-body () > "Return the body of the current heading up to the next he

Re: get the body of a heading up to the next subheading

2020-05-13 Thread John Kitchin
Thanks! Here is what I am currently using: (defun canvas-org-get-heading-body () "Return the body of the current heading up to the next heading." (interactive) (save-excursion (unless (org-at-heading-p) (org-previous-visible-heading 1)) (org-end-of-meta-data) (buffer-substr

Re: get the body of a heading up to the next subheading

2020-05-11 Thread Ihor Radchenko
You may use something similar to org-quick-peek--get-entry-text from org-quick-peek package (https://github.com/alphapapa/org-quick-peek): (cl-defun org-quick-peek--get-entry-text (marker &key keep-drawers keep-planning) "Return Org entry text from node at MARKER. If KEEP-DRAWERS is non-nil, dr

Re: get the body of a heading up to the next subheading

2020-05-11 Thread briangpowell .
Emacs was created to do such things--in fact the name E-macs is a terse form of Editor-Macros {originally a derivative of TECO} {There is a huge list of what Emacs should stand for--my fave is: Emacs Makes All Computing Simple} Now, what I'm suggesting is you make a macro, and store and reuse it-