* 7th todo keyword bug
@ 2011-03-29 2:10 Samuel Wales
2011-03-29 8:44 ` [PATCH] org: Match case of todo keywords when determining empty headings Lawrence Mitchell
0 siblings, 1 reply; 3+ messages in thread
From: Samuel Wales @ 2011-03-29 2:10 UTC (permalink / raw)
To: emacs-orgmode
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.
Thanks.
Samuel
--
The Kafka Pandemic:
http://thekafkapandemic.blogspot.com/2010/12/welcome-to-kafka-pandemic-two-forces_9182.html
I support the Whittemore-Peterson Institute (WPI)
===
I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MRV paper.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] org: Match case of todo keywords when determining empty headings
2011-03-29 2:10 7th todo keyword bug Samuel Wales
@ 2011-03-29 8:44 ` Lawrence Mitchell
2011-03-31 5:28 ` Samuel Wales
0 siblings, 1 reply; 3+ messages in thread
From: Lawrence Mitchell @ 2011-03-29 8:44 UTC (permalink / raw)
To: emacs-orgmode
* 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] org: Match case of todo keywords when determining empty headings
2011-03-29 8:44 ` [PATCH] org: Match case of todo keywords when determining empty headings Lawrence Mitchell
@ 2011-03-31 5:28 ` Samuel Wales
0 siblings, 0 replies; 3+ messages in thread
From: Samuel Wales @ 2011-03-31 5:28 UTC (permalink / raw)
To: Lawrence Mitchell; +Cc: emacs-orgmode
Hi Lawrence,
Thanks!
On 2011-03-29, Lawrence Mitchell <wence@gmx.li> wrote:
> 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.
I figured it would be something like that.
I wonder if there could be a function factored out to do the match?
I'm guessing not as it hasn't been done yet.
Samuel
--
The Kafka Pandemic:
http://thekafkapandemic.blogspot.com/2010/12/welcome-to-kafka-pandemic-two-forces_9182.html
I support the Whittemore-Peterson Institute (WPI)
===
I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MRV paper.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-31 5:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-29 2:10 7th todo keyword bug Samuel Wales
2011-03-29 8:44 ` [PATCH] org: Match case of todo keywords when determining empty headings Lawrence Mitchell
2011-03-31 5:28 ` Samuel Wales
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.