~l3kn/org-fc#14: 
undefined content-position function

The function org-fc-content-position is undefined and referenced in a couple cloze functions. I have defined it locally as:

(defun org-fc-content-position () "Get the position of content for heading at point." (cons (org-element-at-point) (org-element-property :contents-end (org-element-at-point))))

I based it off the prior definition of org-fc-type-cloze-hide-holes. Did you have other plans for this?

-- Trey

Status
RESOLVED FIXED
Submitter
Trey
Assigned to
No-one
Submitted
3 years ago
Updated
3 years ago
Labels
Bug

Trey 3 years ago ยท edit

Sorry for the formatting issues:

(defun org-fc-content-position ()
  "Get the position of content for heading at point."
  (cons (org-element-at-point) (org-element-property :contents-end (org-element-at-point))))

Trey outgoing@sr.ht writes:

The function org-fc-content-position is undefined and referenced in a couple cloze functions. I have defined it locally as:

(defun org-fc-content-position () "Get the position of content for heading at point." (cons (org-element-at-point) (org-element-property :contents-end (org-element-at-point))))

I based it off the prior definition of org-fc-type-cloze-hide-holes. Did you have other plans for this?

-- Trey

-- Trey

~l3kn 3 years ago

You're right, I refactored some of the cloze code and thought that function was only needed for text-input cards.

I've pushed a fix using (org-element-property :contents-end (org-element-at-point)) so the code on main isn't broken but it'll have to be limited to the region of the section below the heading (excluding all subheadings) to support nested cloze deletions.

~l3kn 3 years ago

I've pushed an improved version that's limited to the region before the first subheading, can you check if that works as you'd expect?

~kindablue 3 years ago

It works as expected. Thanks for getting to this.

~l3kn REPORTED FIXED 3 years ago

Register here or Log in to comment, or comment via email.