Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2021-05-20 15:45:45 +02:00
commit dce8b3f254
2 changed files with 23 additions and 0 deletions

View File

@ -288,6 +288,10 @@ otherwise."
((= (point) (org-element-property :begin context)))
;; Within recursive object too, but not in a link.
((eq type 'link) nil)
((eq type 'table-cell)
;; :contents-begin is not reliable on empty cells, so special
;; case it.
(<= (point) (org-element-property :contents-end context)))
((let ((cbeg (org-element-property :contents-begin context))
(cend (org-element-property :contents-end context)))
(and cbeg (>= (point) cbeg) (<= (point) cend))))))))

View File

@ -90,6 +90,25 @@
(org-test-with-temp-text " *bold*<point>"
(let ((org-footnote-auto-label t)) (org-footnote-new))
(buffer-string))))
;; Arrow new footnotes in empty cells.
(should
(string-match-p
" \\[fn:1\\]"
(org-test-with-temp-text "| <point> |"
(let ((org-footnote-auto-label t)) (org-footnote-new))
(buffer-string))))
(should
(string-match-p
"|\\[fn:1\\]"
(org-test-with-temp-text "|<point> |"
(let ((org-footnote-auto-label t)) (org-footnote-new))
(buffer-string))))
(should
(string-match-p
" \\[fn:1\\]"
(org-test-with-temp-text "| <point>|"
(let ((org-footnote-auto-label t)) (org-footnote-new))
(buffer-string))))
;; When creating a new footnote, move to its definition.
(should
(string=