From 6144a83c5db861ba89284f844f3975061b9b582b Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Mon, 9 Apr 2012 20:48:43 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20bug=20in=20using=20=CC=80org-cycle-level'?= =?UTF-8?q?=20in=20non-org=20modes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * org.el (org-point-at-end-of-empty-headline): Only try to match ̀org-todo-line-regexp' when the value is non-nil, e.g. in non-org modes. Thanks to Jambunathan for bringing this up. --- lisp/org.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 7afaba2ea..1ffd029ac 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -20780,11 +20780,12 @@ This version does not only check the character property, but also If the heading only contains a TODO keyword, it is still still considered empty." (and (looking-at "[ \t]*$") - (save-excursion - (beginning-of-line 1) - (let ((case-fold-search nil)) - (looking-at org-todo-line-regexp))) - (string= (match-string 3) ""))) + (when org-todo-line-regexp + (save-excursion + (beginning-of-line 1) + (let ((case-fold-search nil)) + (looking-at org-todo-line-regexp) + (string= (match-string 3) "")))))) (defun org-at-heading-or-item-p () (or (org-at-heading-p) (org-at-item-p)))