summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-05-04 13:34:08 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-05-04 14:20:09 +0200
commit8638c14fbdb5a8ca4ed04c0343f246eed4e22760 (patch)
tree4346857bb5e238c56b8890014599ddbd67742981
parentaf853dd3aa4ce42f8e860ed45ced7f922cb08091 (diff)
downloadorg-mode-8638c14fbdb5a8ca4ed04c0343f246eed4e22760.tar.gz
org-agenda: Fix error on empty headlines
* lisp/org-agenda.el (org-agenda-get-timestamps): (org-agenda-get-deadlines): (org-agenda-get-scheduled): (org-agenda-get-blocks): Handle empty headlines.
-rw-r--r--lisp/org-agenda.el15
1 files changed, 5 insertions, 10 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index d84efc3..535a6fb 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5656,8 +5656,8 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
(memq 'agenda org-agenda-use-tag-inheritance))))
tags (org-get-tags-at nil (not inherited-tags))
level (make-string (org-reduced-level (org-outline-level)) ? ))
- (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
- (setq head (or (match-string 1) ""))
+ (looking-at "\\*+[ \t]+\\(.*\\)")
+ (setq head (match-string 1))
(setq txt (org-agenda-format-item
(if inactivep org-agenda-inactive-leader nil)
head level category tags timestr
@@ -6123,10 +6123,7 @@ specification like [h]h:mm."
(or (eq org-agenda-use-tag-inheritance t)
(memq 'agenda org-agenda-use-tag-inheritance))))
tags (org-get-tags-at pos1 (not inherited-tags)))
- (setq head (buffer-substring
- (point)
- (progn (skip-chars-forward "^\r\n")
- (point))))
+ (setq head (buffer-substring (point) (line-end-position)))
(if (string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
(setq timestr
(concat (substring s (match-beginning 1)) " "))
@@ -6304,9 +6301,7 @@ an hour specification like [h]h:mm."
tags (org-get-tags-at nil (not inherited-tags)))
(setq level (make-string (org-reduced-level (org-outline-level)) ? ))
- (setq head (buffer-substring
- (point)
- (progn (skip-chars-forward "^\r\n") (point))))
+ (setq head (buffer-substring (point) (line-end-position)))
(if (string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
(setq timestr
(concat (substring s (match-beginning 1)) " "))
@@ -6394,7 +6389,7 @@ an hour specification like [h]h:mm."
tags (org-get-tags-at nil (not inherited-tags)))
(setq level (make-string (org-reduced-level (org-outline-level)) ? ))
- (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
+ (looking-at "\\*+[ \t]+\\(.*\\)")
(setq head (match-string 1))
(let ((remove-re
(if org-agenda-remove-timeranges-from-blocks