* lisp/org-footnote.el (org-footnote-get-definition): Footnotes
definitions are global, so ignore narrowing right from the start.
Also skip false positives.
* lisp/org-footnote.el (org-footnote-goto-definition): Throw an error
when definition is outside narrowed part of buffer. Do not move
point either.
* testing/lisp/test-org-footnote.el (test-org-footnote/goto-definition):
New test.
Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/97158>
* lisp/org-footnote.el (org-footnote--allow-reference-p): Allow new
footnotes in headlines.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): Add test.
Reported-by: Thomas S. Dye <tsd@tsdye.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/96843>
* lisp/org-footnote.el (org-footnote--allow-reference-p): New
function.
(org-footnote-new): Use new function.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): New test.
In particular, Org now refuses to add a footnote reference in
a keyword, e.g., TITLE.
* org-footnote.el (org-footnote-new): When point is at a
position where no footnote can be inserted, offer the menu
from `org-footnote-action' instead.
(org-footnote-inline-footnotes): New command.
(org-footnote-action): Make the new command accessible through
the menu.
Thanks to Leonard Randall for the suggestion.
* org.el (org-fontify-entities): Use `org-at-comment-p'.
(org-in-commented-line): Delete.
(org-in-indented-comment-line): Delete.
(org-at-comment-p): Also match indented comments and save
match data.
* org-footnote.el (org-footnote-in-valid-context-p): Use
`org-at-comment-p'.
* lisp/org-element.el (org-element-footnote-definition-parser):
Require 2 blank lines to separate footnote definition.
* lisp/org-footnote.el (org-footnote-at-definition-p): Require 2 blank
lines to separate footnote definition.
* doc/org.texi: Update documentation for footnotes.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org-footnote.el: Add tests.
Footnote definitions can still be separated with other footnote
definitions and headlines. This change allows to have multiple
paragraphs in a footnote definition without resorting to the "\par"
trick.
* org.el (org-emphasis-alist, org-protecting-blocks):
* org-src.el (org-edit-src-find-region-and-lang):
* org-list.el (org-list-forbidden-blocks):
* org-footnote.el (org-footnote-forbidden-blocks): Remove
references to the deleted DocBook exporter.
* org.texi (Top, Markup, Initial text, Images and tables)
(@LaTeX{} fragments, @LaTeX{} fragments, Exporting)
(Export options, JavaScript support, Beamer class export):
Remove references to the DocBook export, which has been
deleted.
(History and Acknowledgments): Mention that DocBook has been
deleted, suggest to use the Texinfo exporter instead, then to
convert the .texi to DocBook with makeinfo.
(Links in ODT export, Tables in ODT export): Fix indices.
* lisp/org-macs.el (org-if-unprotected, org-if-unprotected-1,
org-if-unprotected-at): Removed macros.
(org-re-search-forward-unprotected): Removed function.
* lisp/org.el (org-format-latex): Remove reference to `org-protected'.
* lisp/org-list.el (org-list-struct): Remove reference to
`org-example' and `org-protected'.
* lisp/org-footnote.el (org-footnote-at-reference-p): Remove reference
to `org-protected'.
* lisp/org-capture.el (org-capture-fill-template): Remove reference to
`org-protected'.
* contrib/lisp/org-wikinodes.el (org-wikinodes-process-links-for-export):
Remove reference to `org-protected' value.
These text properties were used by the old export framework. They are
not needed anymore.
* lisp/org-clock.el (org-clocktable-defaults,
org-clocktable-write-default): Avoid requiring the whole export
framework just to check one variable.
* lisp/org-footnote.el (org-footnote-section): Update
docstring.
(org-footnote-normalize): Remove all export related part from the
function.
* lisp/org-inlinetask.el (org-inlinetask-export,
org-inlinetask-export-templates): Removed variables.
(org-inlinetask-export-handler): Removed function.
* lisp/org-plot.el: Remove dependency on `org-exp' library.
* lisp/org.el (org-additional-option-like-keywords): Remove variable.
(org-get-export-keywords): New function.
(org-options-keywords): Update default list of keywords.
(org-remove-flyspell-overlays-in): Apply changes to keywords
compilation.
(org-highlight-latex-fragments-and-specials)
org-latex-and-specials-regexp,
org-export-html-special-string-regexps): Remove variables.
(org-compute-latex-and-specials-regexp,
org-do-latex-and-special-faces, org-remove-file-link-modifiers):
Remove functions.
(org-set-regexps-and-options, org-set-font-lock-defaults): Apply all
removals.
(org-use-sub-superscripts): Fix docstring. Remove unused group.
(org-match-sexp-depth): Make it a defconst instead of a defcustom in
order to remove `org-export-translation' group completely.
The new export framework shouldn't be as much interleaved with Org
core as with the previous one. For example, export options, which are
back-end dependent, shouldn't interfere with the display of the
buffer.
* org-footnote.el (org-footnote-create-definition): Prevent
`electric-indent-mode' from inserting the definition at the
wrong place.
Thanks to Xue Fuqiao for reporting this bug.
* lisp/org-footnote.el (org-footnote-new): Don't call
org-footnote-unique-label if org-footnote-auto-label is set to
random.
Calling org-footnote-unique-label calls org-footnote-all-labels, which
can dramatically slow down footnote creation in a buffer with many
footnotes. This is unecessary if org-footnote-auto-label is set to
random.
* lisp/org-footnote.el (org-footnote-delete-definitions): Remove blank
lines before the footnote definition instead of removing those after
it.
* testing/lisp/test-org-footnote.el: Adapt tests.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.
This commit also bumps the version number to 7.8.06.
The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.
This commit reverts back the maint branch to its state before
merging the master branch. From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
* lisp/org-footnote.el (org-footnote-normalize): Remove an useless
part of the function.
(org-insert-footnote-reference-near-definition): Remove function.
* lisp/org-footnote.el (org-footnote-normalize): Fix normalization of
inline footnotes with no footnote section.
* testing/lisp/test-org-footnote.el: New test file.
Thanks to Samuel Wales for reporting this.
* lisp/org-footnote.el (org-footnote-normalize): Force a paragraph
break after the last footnote definition. This is an an
implicit assumption made by the org-lparse.el library. With
this change, footnote definitions can reliably be exported
with ODT backend. See
http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg01013.html.
* lisp/org-footnote.el (org-blank-before-new-entry,
org-export-footnotes-seen, org-export-footnotes-data): Fix bogus
declarations.
This fixes bug #10745. Thanks to Steve Revilak for the report and to
Glenn Morris for the solution.
* lisp/org-footnote.el (org-footnote-create-definition): Fix space
insertion when creating a new footnote. This fixes newline munching
when `org-footnote-section' is nil and blank lines stacking when it
isn't nil.
Thanks to Eric Abrahamsen for reporting this.
* lisp/org-footnote.el (org-footnote-normalize): Ensure footnote
definition will be inserted at the end of the section corresponding
to to its first reference.
* lisp/org-footnote.el (org-footnote-at-definition-p): Make sure to
move point at the beginning of the separator before skiping white
spaces. Refactor code.
* lisp/org-footnote.el (org-footnote-new): Cannot insert an inline
footnote at beginning of line anymore.
(org-footnote-at-reference-p): Don't recognize inline footnotes at
beginning of line.
It is technically possible to allow inline footnotes at beginning of
line, their syntax being different enough from standard references.
Though, after normalizing them, they will become standard footnotes
still at beginning of line, which will break them.
Additionally, replace one
(or (org-mode-p) (derived-mode-p 'org-mode))
with
(derived-mode-p 'org-mode)
cause that is reflexive anyway (returns true, if the current mode is
org-mode).
Delete one check testing for org-mode or org derived mode
Hi all,
org-footnote-renumber-fn:N invalidates footnotes that appear as the
first thing on a line. Here's a test file including the recipe.
--8<---------------cut here---------------start------------->8---
* Bla
This is a line in which the following footnote that is inserted exactly
[fn:1] is the first thing in that line. And now invoke
org-footnote-renumber-fn:N and see it breaking.
* Footnotes
[fn:1] Test
--8<---------------cut here---------------end--------------->8---
Note, that in larger org files, it's likely that you don't even notice
that the footnotes break.
Once I added a patch on patchwork that fixed this issue, and that's
shown as "accepted".
http://patchwork.newartisans.com/patch/705/
I think, I've marked it as deferred or so myself because I've thought
the issue was fixed in the meantime, but that doesn't seem to be true.
Here's an updated patch.
* lisp/org-footnote.el (org-footnote-goto-definition): This patch
makes sure the function says when a definition has been found.
Thus, moving from the reference to the definition doesn't offer to
create the latter again.
* lisp/org-footnote.el (org-footnote-create-definition): When the tag
is missing, it is created before any existing footnote, or at end of
buffer. In the latter case, the marker pointing at the position
where the new footnote is going to be inserted (at end of buffer)
stays before the tag. This patch makes sure that the marker will be
kept after the tag.
* lisp/org-footnote.el (org-footnote-normalize): be sure to separate
the last footnote definition from the rest of the buffer.
Thanks to Jambunathan K for reporting this.
* lisp/org-footnote.el (org-footnote-get-definition): the function has
to widen buffer if definition has not been found in the current
narrowed part. Be sure to restore that restriction once the
definition is found.
Also remove blank lines before the ";;; org*el ends here" declarations.
Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.
Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
* lisp/org-footnote.el (org-footnote-normalize): effectively remove
any footnote tag in non Org buffers, as detailled in
org-footnote-tag-for-non-org-mode-files doc-string.
* lisp/org-footnote.el (org-footnote-tag-for-non-org-mode-files):
notify the opportunity to set the variable to the empty string.
(org-footnote-normalize, org-footnote-create-definition): carefully
check for inserted newlines and presence of the footnote
tag.