Browse Source

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

Eric Schulte 8 years ago
parent
commit
432e1256bc
2 changed files with 23 additions and 16 deletions
  1. 1 1
      lisp/org-latex.el
  2. 22 15
      lisp/org-list.el

+ 1 - 1
lisp/org-latex.el

@@ -258,7 +258,7 @@ For example \orgTITLE for #+TITLE."
   :type 'boolean)
 
 (defcustom org-export-latex-date-format
-  "%d %B %Y"
+  "\\today"
   "Format string for \\date{...}."
   :group 'org-export-latex
   :type 'string)

+ 22 - 15
lisp/org-list.el

@@ -468,10 +468,10 @@ This checks `org-list-ending-method'."
 		     (looking-at org-list-end-re))
 		(throw 'exit nil))
 	       ;; Skip blocks, drawers, inline-tasks, blank lines
-	       ((looking-at "^[ \t]*#\\+end_")
-		(re-search-backward "^[ \t]*#\\+begin_" nil t))
-	       ((looking-at "^[ \t]*:END:")
-		(re-search-backward drawers-re nil t)
+	       ((and (looking-at "^[ \t]*#\\+end_")
+		     (re-search-backward "^[ \t]*#\\+begin_" lim-up t)))
+	       ((and (looking-at "^[ \t]*:END:")
+		     (re-search-backward drawers-re lim-up t))
 		(beginning-of-line))
 	       ((and inlinetask-re (looking-at inlinetask-re))
 		(org-inlinetask-goto-beginning)
@@ -689,10 +689,10 @@ Assume point is at an item."
 			     (memq (assq (car beg-cell) itm-lst) itm-lst))))
 	       ;; Skip blocks, drawers, inline tasks, blank lines
 	       ;; along the way.
-	       ((looking-at "^[ \t]*#\\+end_")
-		(re-search-backward "^[ \t]*#\\+begin_" nil t))
-	       ((looking-at "^[ \t]*:END:")
-		(re-search-backward drawers-re nil t)
+	       ((and (looking-at "^[ \t]*#\\+end_")
+		     (re-search-backward "^[ \t]*#\\+begin_" lim-up t)))
+	       ((and (looking-at "^[ \t]*:END:")
+		     (re-search-backward drawers-re lim-up t))
 		(beginning-of-line))
 	       ((and inlinetask-re (looking-at inlinetask-re))
 		(org-inlinetask-goto-beginning)
@@ -756,11 +756,11 @@ Assume point is at an item."
 	      (throw 'exit (push (cons 0 (point)) end-lst-2)))
 	     ;; Skip blocks, drawers, inline tasks and blank lines
 	     ;; along the way
-	     ((looking-at "^[ \t]*#\\+begin_")
-	      (re-search-forward "^[ \t]*#\\+end_")
+	     ((and (looking-at "^[ \t]*#\\+begin_")
+		   (re-search-forward "^[ \t]*#\\+end_" lim-down t))
 	      (forward-line 1))
-	     ((looking-at drawers-re)
-	      (re-search-forward "^[ \t]*:END:" nil t)
+	     ((and (looking-at drawers-re)
+		   (re-search-forward "^[ \t]*:END:" lim-down t))
 	      (forward-line 1))
 	     ((and inlinetask-re (looking-at inlinetask-re))
 	      (org-inlinetask-goto-end))
@@ -2073,6 +2073,10 @@ in subtree, ignoring drawers."
 	   block-item
 	   lim-up
 	   lim-down
+	   (drawer-re (concat "^[ \t]*:\\("
+			      (mapconcat 'regexp-quote org-drawers "\\|")
+			      "\\):[ \t]*$"))
+	   (keyword-re (concat "^[ \t]*" org-keyword-time-regexp))
 	   (orderedp (org-entry-get nil "ORDERED"))
 	   (bounds
 	    ;; In a region, start at first item in region
@@ -2085,11 +2089,14 @@ in subtree, ignoring drawers."
 		  (error "No item in region"))
 		(setq lim-down (copy-marker limit))))
 	     ((org-on-heading-p)
-	      ;; On an heading, start at first item after drawers
+	      ;; On an heading, start at first item after drawers and
+	      ;; time-stamps (scheduled, etc.)
 	      (let ((limit (save-excursion (outline-next-heading) (point))))
 		(forward-line 1)
-		(when (looking-at org-drawer-regexp)
-		  (re-search-forward "^[ \t]*:END:" limit nil))
+		(while (or (looking-at drawer-re) (looking-at keyword-re))
+		  (if (looking-at keyword-re)
+		      (forward-line 1)
+		    (re-search-forward "^[ \t]*:END:" limit nil)))
 		(if (org-list-search-forward (org-item-beginning-re) limit t)
 		    (setq lim-up (point-at-bol))
 		  (error "No item in subtree"))