From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Mitchell Subject: [PATCH] org: Match case of todo keywords when determining empty headings Date: Tue, 29 Mar 2011 09:44:07 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=34166 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4UXH-0001El-G8 for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 04:44:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4UXG-0000zw-0r for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 04:44:23 -0400 Received: from lo.gmane.org ([80.91.229.12]:56063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4UXF-0000zf-Na for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 04:44:21 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q4UXC-000418-F3 for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 10:44:18 +0200 Received: from e4300lm.epcc.ed.ac.uk ([129.215.63.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Mar 2011 10:44:18 +0200 Received: from wence by e4300lm.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Mar 2011 10:44:18 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * lisp/org.el (org-point-at-end-of-empty-headline): Bind case-fold-search to nil. --- Samuel Wales wrote: > I have found another todo keyword bug of the same type as the other 6. > A headline with a word that is the same as a todo keyword but not in > upper case has different behavior. > Example: > * test > * Question[] > * test > Have QUESTION as a todo keyword. Put point at the marked spot. Press > TAB. The headline will outdent instead of cycling visibility. It > should cycle visibility as it does with other headlines. This is because the check for an empty heading thinks Question is a todo keyword, because it doesn't match the case of the values in org-todo-keywords. This patch fixes the problem by binding case-fold-search to nil in the relevant place. Cheers, Lawrence lisp/org.el | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 28025ea..7a4c504 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -19649,8 +19649,9 @@ empty." (and (looking-at "[ \t]*$") (save-excursion (beginning-of-line 1) - (looking-at (concat "^\\(\\*+\\)[ \t]+\\(" org-todo-regexp - "\\)?[ \t]*$"))))) + (let ((case-fold-search nil)) + (looking-at (concat "^\\(\\*+\\)[ \t]+\\(" org-todo-regexp + "\\)?[ \t]*$")))))) (defun org-at-heading-or-item-p () (or (org-on-heading-p) (org-at-item-p))) -- 1.7.4.rc2.18.gb20e9