1

I am used to create new footnotes in Emacs Org Mode with the key binding C-c C-x f.

But now there are shown several options in the echo area, when I use this key binding, although the cursor is not on a footnote reference or definition. and I did not use a prefix argument. And I didn't change any variables or configurations (intentional).

2 Answers 2

2

Let's look at the docstring of org-footnote-action (emphasis mine):

(org-footnote-action &optional SPECIAL)

Do the right thing for footnotes.

When at a footnote reference, jump to the definition.

When at a definition, jump to the references if they exist, offer to create them otherwise.

When neither at definition or reference, create a new footnote, interactively if possible.

With prefix arg SPECIAL, or when no footnote can be created, offer additional commands in a menu.

So it seems that when point is at beginning of line it is considered no footnote can be created. Arguably, this could be made more explicit.

I actually wonder if it's a bug: the test is performed by function org-footnote--allow-reference-p, where one can read on the source (for org-version 9.1.14):

(defun org-footnote--allow-reference-p ()
  "Non-nil when a footnote reference can be inserted at point."
  ;; XXX: This is similar to `org-footnote-in-valid-context-p' but
  ;; more accurate and usually faster, except in some corner cases.
  ;; It may replace it after doing proper benchmarks as it would be
  ;; used in fontification.
  (unless (bolp)
         ...

As we can see, the beginning of line test is the very first one. Also, it turns out that the mentionned org-footnode-in-valid-context-p function does return t when point is at beginning of line.

0

By chance I found my mistake: The cursor was at the beginning of a line.

But I don't understand exactly what's the problem. Perhaps it is in conjunction with the variable org-footnote-define-inline, which defines where the footnote appears.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.