summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ecay <aaronecay@gmail.com>2015-12-05 15:40:36 +0000
committerAaron Ecay <aaronecay@gmail.com>2015-12-05 15:40:36 +0000
commita198d81080f8c0e38944391097bc1f7ceadf496c (patch)
tree134c16ad8a065b20e83ca3636465d44757b49012
parent046310d2739c0354952ecb2b1c52b92d6e497d8e (diff)
downloadorg-mode-a198d81080f8c0e38944391097bc1f7ceadf496c.tar.gz
Revert "Fix a slowdown in footnote parsing."
This reverts commit 046310d2739c0354952ecb2b1c52b92d6e497d8e.
-rw-r--r--lisp/org-footnote.el33
1 files changed, 15 insertions, 18 deletions
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 7ed8a1d..bc874a5 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -200,24 +200,21 @@ extracted will be filled again."
(defun org-footnote-in-valid-context-p ()
"Is point in a context where footnotes are allowed?"
(save-match-data
- (and
- (not (org-at-comment-p))
- (not (org-in-verbatim-emphasis))
- ;; Avoid forbidden blocks.
- (not (org-in-block-p org-footnote-forbidden-blocks))
- ;; Avoid literal example.
- (not (save-excursion
- (beginning-of-line)
- (looking-at "[ \t]*:[ \t]+")))
- ;; The latex fragment check seems expensive, so save it for last.
- ;; See <http://mid.gmane.org/loom.20151204T081351-244@post.gmane.org>.
- (not (org-inside-LaTeX-fragment-p))
- ;; Avoid cited text and headers in message-mode.
- (not (and (derived-mode-p 'message-mode)
- (or (save-excursion
- (beginning-of-line)
- (looking-at message-cite-prefix-regexp))
- (message-point-in-header-p)))))))
+ (not (or (org-at-comment-p)
+ (org-inside-LaTeX-fragment-p)
+ ;; Avoid literal example.
+ (org-in-verbatim-emphasis)
+ (save-excursion
+ (beginning-of-line)
+ (looking-at "[ \t]*:[ \t]+"))
+ ;; Avoid cited text and headers in message-mode.
+ (and (derived-mode-p 'message-mode)
+ (or (save-excursion
+ (beginning-of-line)
+ (looking-at message-cite-prefix-regexp))
+ (message-point-in-header-p)))
+ ;; Avoid forbidden blocks.
+ (org-in-block-p org-footnote-forbidden-blocks)))))
(defun org-footnote-at-reference-p ()
"Is the cursor at a footnote reference?