Browse Source

Merge branch 'master' of orgmode.org:org-mode

Bastien Guerry 14 years ago
parent
commit
aaad53f50a
2 changed files with 16 additions and 10 deletions
  1. 9 6
      lisp/org-latex.el
  2. 7 4
      lisp/org.el

+ 9 - 6
lisp/org-latex.el

@@ -2412,12 +2412,15 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 		 (replace-match (org-export-latex-protect-string
 				 (concat "$^{" (match-string 1) "}$")))
 	       (replace-match "")
-	       (let ((end (save-excursion
-			    (if (re-search-forward "^$\\|^#.*$\\|\\[[0-9]+\\]" nil t)
-				(match-beginning 0) (point-max)))))
-		 (setq footnote (concat (org-trim (buffer-substring (point) end))
-					; last } won't be part of a link or list.
-					"\n"))
+	       (let* ((end (save-excursion
+			     (if (re-search-forward "^$\\|^#.*$\\|\\[[0-9]+\\]" nil t)
+				 (match-beginning 0) (point-max))))
+		      (body (org-trim (buffer-substring (point) end))))
+		 ;; Fix for footnotes ending on a link or a list.
+		 (setq footnote
+		       (concat body
+			       (if (string-match "ORG-LIST-END-MARKER\\'" body)
+				   "\n" " ")))
 		 (delete-region (point) end))
 	       (goto-char foot-beg)
 	       (delete-region foot-beg foot-end)

+ 7 - 4
lisp/org.el

@@ -19052,6 +19052,8 @@ If point is in an inline task, mark that task instead."
      ((looking-at "# ") (setq column 0))
      ;; Headings
      ((looking-at "\\*+ ") (setq column 0))
+     ;; Footnote definition
+     ((looking-at org-footnote-definition-re) (setq column 0))
      ;; Literal examples
      ((looking-at "[ \t]*:[ \t]")
       (setq column (org-get-indentation))) ; do nothing
@@ -19090,15 +19092,16 @@ If point is in an inline task, mark that task instead."
 		  (not (looking-at org-drawer-regexp))
 		  ;; When point started in an inline task, do not move
 		  ;; above task starting line.
-		  (not (and inline-task-p
-			    (looking-at inline-re)))
-		  ;; Skip comments, verbatim, empty lines, tables,
-		  ;; inline tasks, lists, drawers and blocks.
+		  (not (and inline-task-p (looking-at inline-re)))
+		  ;; Skip drawers, blocks, empty lines, verbatim,
+		  ;; comments, tables, footnotes definitions, lists,
+		  ;; inline tasks.
 		  (or (and (looking-at "[ \t]*:END:")
 			   (re-search-backward org-drawer-regexp nil t))
 		      (and (looking-at "[ \t]*#\\+end_")
 			   (re-search-backward "[ \t]*#\\+begin_"nil t))
 		      (looking-at "[ \t]*[\n:#|]")
+		      (looking-at org-footnote-definition-re)
 		      (and (ignore-errors (goto-char (org-in-item-p)))
 			   (goto-char
 			    (org-list-get-top-point (org-list-struct))))