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
:END:.*\n?" nil 'move) > >> (point) > >> (unless keep-planning > >> (goto-char (point-min)) > >> (while (re-search-forward org-planning-line-re nil t) > >> ;; Remove planning

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

2020-05-13 Thread Ihor Radchenko
(point) >> (unless keep-planning >> (goto-char (point-min)) >> (while (re-search-forward org-planning-line-re nil t) >> ;; Remove planning line >> (kill-whole-line))) >> (setq text (buffer-substring (point-min

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

2020-05-13 Thread John Kitchin
min)) > (while (re-search-forward org-planning-line-re nil t) > ;; Remove planning line > (kill-whole-line))) > (setq text (buffer-substring (point-min) (point-max > (-reduce-r #'funcall (reverse (cons text (cons #'identity > org

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

2020-05-11 Thread Ihor Radchenko
ll (reverse (cons text (cons #'identity org-quick-peek-filter-functions)) Best, Ihor John Kitchin writes: > Hi everyone, > > I am trying to get the body of a heading up to the next subheading. For > example with this org file, > > * quiz one > > This is the d

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

2020-05-11 Thread briangpowell .
g to get the body of a heading up to the next subheading. For > example with this org file, > > * quiz one > > This is the description. > Use emacs for this. > > ** question 1 > what is 40 + 2 > > If the point is in the first heading, I want to run a function that w

get the body of a heading up to the next subheading

2020-05-11 Thread John Kitchin
Hi everyone, I am trying to get the body of a heading up to the next subheading. For example with this org file, * quiz one This is the description. Use emacs for this. ** question 1 what is 40 + 2 If the point is in the first heading, I want to run a function that would return the string