Browse Source

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

Bastien Guerry 4 years ago
parent
commit
90884b9748
3 changed files with 29 additions and 28 deletions
  1. 2 2
      contrib/lisp/ox-deck.el
  2. 20 16
      lisp/org-element.el
  3. 7 10
      lisp/org.el

+ 2 - 2
contrib/lisp/ox-deck.el

@@ -319,7 +319,7 @@ and have the id \"title-slide\"."
         (include (plist-get info :deck-include-extensions))
         (exclude (plist-get info :deck-exclude-extensions))
         (scripts '()) (sheets '()) (snippets '()))
-    (add-to-list 'scripts (concat prefix "jquery-1.7.2.min.js"))
+    (add-to-list 'scripts (concat prefix "jquery.min.js"))
     (add-to-list 'scripts (concat prefix "core/deck.core.js"))
     (add-to-list 'scripts (concat prefix "modernizr.custom.js"))
     (add-to-list 'sheets  (concat prefix "core/deck.core.css"))
@@ -368,7 +368,7 @@ holding export options."
   "Transcode an ITEM element from Org to HTML.
 CONTENTS holds the contents of the item.  INFO is a plist holding
 contextual information.
-If the containing headline has the property :slide, then
+If the containing headline has the property :STEP, then
 the \"slide\" class will be added to the to the list element,
  which will make the list into a \"build\"."
   (let ((text (org-html-item item contents info)))

+ 20 - 16
lisp/org-element.el

@@ -3385,13 +3385,12 @@ Return a list whose CAR is `subscript' and CDR a plist with
 Assume point is at the underscore."
   (save-excursion
     (unless (bolp) (backward-char))
-    (let ((bracketsp (if (looking-at org-match-substring-with-braces-regexp)
-			 t
-		       (not (looking-at org-match-substring-regexp))))
+    (looking-at org-match-substring-regexp)
+    (let ((bracketsp (match-beginning 4))
 	  (begin (match-beginning 2))
-	  (contents-begin (or (match-beginning 5)
+	  (contents-begin (or (match-beginning 4)
 			      (match-beginning 3)))
-	  (contents-end (or (match-end 5) (match-end 3)))
+	  (contents-end (or (match-end 4) (match-end 3)))
 	  (post-blank (progn (goto-char (match-end 0))
 			     (skip-chars-forward " \t")))
 	  (end (point)))
@@ -3434,12 +3433,12 @@ Return a list whose CAR is `superscript' and CDR a plist with
 Assume point is at the caret."
   (save-excursion
     (unless (bolp) (backward-char))
-    (let ((bracketsp (if (looking-at org-match-substring-with-braces-regexp) t
-		       (not (looking-at org-match-substring-regexp))))
+    (looking-at org-match-substring-regexp)
+    (let ((bracketsp (match-beginning 4))
 	  (begin (match-beginning 2))
-	  (contents-begin (or (match-beginning 5)
+	  (contents-begin (or (match-beginning 4)
 			      (match-beginning 3)))
-	  (contents-end (or (match-end 5) (match-end 3)))
+	  (contents-end (or (match-end 4) (match-end 3)))
 	  (post-blank (progn (goto-char (match-end 0))
 			     (skip-chars-forward " \t")))
 	  (end (point)))
@@ -5602,14 +5601,19 @@ cache, unless optional argument IGNORE-CHANGES is non-nil."
 	      (cond
 	       ((< key beg)
 		(setq node (avl-tree--node-left node)))
-	       ((= key beg)
-		(if (memq (org-element-type element) '(item table-row))
-		    (setq last (avl-tree--node-data node)
-			  node (avl-tree--node-left node))
-		  (throw 'found (avl-tree--node-data node))))
-	       (t
+	       ((> key beg)
+		(setq last (avl-tree--node-data node)
+		      node (avl-tree--node-right node)))
+	       ;; When KEY is at the beginning of a table or list,
+	       ;; make sure to return it instead of the first row or
+	       ;; item.
+	       ((and (memq (org-element-type element) '(item table-row))
+		     (= (org-element-property
+			 :contents-begin (org-element-property :parent element))
+			beg))
 		(setq last (avl-tree--node-data node)
-		      node (avl-tree--node-right node))))))
+		      node (avl-tree--node-left node)))
+	       (t (throw 'found (avl-tree--node-data node))))))
 	  last)))))
 
 (defun org-element-cache-put (data &optional element)

+ 7 - 10
lisp/org.el

@@ -5638,21 +5638,20 @@ stacked delimiters is N.  Escaping delimiters is not possible."
 	    next (concat "\\(?:" nothing left next right "\\)+" nothing)))
     (concat left "\\(" re "\\)" right)))
 
-(defvar org-match-substring-regexp
+(defconst org-match-substring-regexp
   (concat
    "\\(\\S-\\)\\([_^]\\)\\("
-   "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
+   "\\(?:" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
    "\\|"
-   "\\(" (org-create-multibrace-regexp "(" ")" org-match-sexp-depth) "\\)"
+   "\\(?:" (org-create-multibrace-regexp "(" ")" org-match-sexp-depth) "\\)"
    "\\|"
-   "\\(\\(?:\\*\\|[-+]?[^-+*!@#$%^_ \t\r\n,:\"?<>~;./{}=()]+\\)\\)\\)")
+   "\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)")
   "The regular expression matching a sub- or superscript.")
 
-(defvar org-match-substring-with-braces-regexp
+(defconst org-match-substring-with-braces-regexp
   (concat
-   "\\(\\S-\\)\\([_^]\\)\\("
-   "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
-   "\\)")
+   "\\(\\S-\\)\\([_^]\\)"
+   "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)")
   "The regular expression matching a sub- or superscript, forcing braces.")
 
 (defun org-make-link-regexps ()
@@ -6089,8 +6088,6 @@ by a #."
 
 (defvar org-latex-and-related-regexp nil
   "Regular expression for highlighting LaTeX, entities and sub/superscript.")
-(defvar org-match-substring-regexp)
-(defvar org-match-substring-with-braces-regexp)
 
 (defun org-compute-latex-and-related-regexp ()
   "Compute regular expression for LaTeX, entities and sub/superscript.