emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [patch] Do not run flyspell checks on org keywords
@ 2011-05-24  8:18 Sébastien Delafond
  2011-05-31 13:14 ` Sébastien Delafond
  2011-06-01 11:53 ` Julien Danjou
  0 siblings, 2 replies; 4+ messages in thread
From: Sébastien Delafond @ 2011-05-24  8:18 UTC (permalink / raw)
  To: emacs-orgmode

Here is a small patch that prevents flyspelle from checking all the Org
keywords. This is especially useful when using a dictionary other than
english.

Cheers,

--Seb

From 0a6493331f1d84a4c44533bdea1c3c9b41c997eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Delafond?= <sdelafond@gmail.com>
Date: Mon, 23 May 2011 18:16:57 +0200
Subject: [PATCH] [flyspell] Do not run flyspell-checks on {todo,all-time,additional-option-like}-keywords

  * this is useful when using flyspell with a non-English dictionary,
    or if some of your keywords are in another language
---
 lisp/org.el |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 9f8fa92..676f08f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20135,9 +20135,15 @@ To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
 
 ;; Make flyspell not check words in links, to not mess up our keymap
 (defun org-mode-flyspell-verify ()
-  "Don't let flyspell put overlays at active buttons."
-  (and (not (get-text-property (max (1- (point)) (point-min)) 'keymap))
-       (not (get-text-property (max (1- (point)) (point-min)) 'org-no-flyspell))))
+  "Don't let flyspell put overlays at active buttons, or on
+   {todo,all-time,additional-option-like}-keywords."
+  (let ((pos (max (1- (point)) (point-min)))
+	(word (thing-at-point 'word)))
+    (and (not (get-text-property pos 'keymap))
+	 (not (get-text-property pos 'org-no-flyspell))
+	 (not (member word org-todo-keywords-1))
+	 (not (member word org-all-time-keywords))
+	 (not (member word org-additional-option-like-keywords)))))
 
 (defun org-remove-flyspell-overlays-in (beg end)
   "Remove flyspell overlays in region."
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] Do not run flyspell checks on org keywords
  2011-05-24  8:18 [patch] Do not run flyspell checks on org keywords Sébastien Delafond
@ 2011-05-31 13:14 ` Sébastien Delafond
  2011-05-31 14:09   ` Christian Moe
  2011-06-01 11:53 ` Julien Danjou
  1 sibling, 1 reply; 4+ messages in thread
From: Sébastien Delafond @ 2011-05-31 13:14 UTC (permalink / raw)
  To: emacs-orgmode

No one interested in this one ? :)

Cheers,

--Seb

On 2011-05-24, Sébastien Delafond <sdelafond@gmail.com> wrote:
>
> Here is a small patch that prevents flyspelle from checking all the Org
> keywords. This is especially useful when using a dictionary other than
> english.
>
> Cheers,
>
> --Seb
>
> From 0a6493331f1d84a4c44533bdea1c3c9b41c997eb Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?S=C3=A9bastien=20Delafond?= <sdelafond@gmail.com>
> Date: Mon, 23 May 2011 18:16:57 +0200
> Subject: [PATCH] [flyspell] Do not run flyspell-checks on {todo,all-time,additional-option-like}-keywords
>
>   * this is useful when using flyspell with a non-English dictionary,
>     or if some of your keywords are in another language
> ---
>  lisp/org.el |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/org.el b/lisp/org.el
> index 9f8fa92..676f08f 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -20135,9 +20135,15 @@ To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
>  
>  ;; Make flyspell not check words in links, to not mess up our keymap
>  (defun org-mode-flyspell-verify ()
> -  "Don't let flyspell put overlays at active buttons."
> -  (and (not (get-text-property (max (1- (point)) (point-min)) 'keymap))
> -       (not (get-text-property (max (1- (point)) (point-min)) 'org-no-flyspell))))
> +  "Don't let flyspell put overlays at active buttons, or on
> +   {todo,all-time,additional-option-like}-keywords."
> +  (let ((pos (max (1- (point)) (point-min)))
> +	(word (thing-at-point 'word)))
> +    (and (not (get-text-property pos 'keymap))
> +	 (not (get-text-property pos 'org-no-flyspell))
> +	 (not (member word org-todo-keywords-1))
> +	 (not (member word org-all-time-keywords))
> +	 (not (member word org-additional-option-like-keywords)))))
>  
>  (defun org-remove-flyspell-overlays-in (beg end)
>    "Remove flyspell overlays in region."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Do not run flyspell checks on org keywords
  2011-05-31 13:14 ` Sébastien Delafond
@ 2011-05-31 14:09   ` Christian Moe
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Moe @ 2011-05-31 14:09 UTC (permalink / raw)
  To: Sébastien Delafond; +Cc: emacs-orgmode


I would be interested, if I could could get ispell.el to work with 
hunspell in a UTF-8 environment (it's the 21st century), or even in 
Emacs' Slovenian language environment (Latin-2), without breaking 
words for every non-ascii character it encounters...

This is off-topic (sorry), but if anyone has a working setup for 
something like the above, I'd be grateful if you'd share it with me 
off-list.

I'm using GNU Emacs 23 and hunspell under Mac OS X. Hunspell seems to 
work perfectly well from the command line with a UTF-8 text file, even 
when I'm using it with a Latin-2-encoded dictionary.

Yours,
Christian


On 5/31/11 3:14 PM, Sébastien Delafond wrote:
> No one interested in this one ? :)
>
> Cheers,
>
> --Seb
>
> On 2011-05-24, Sébastien Delafond<sdelafond@gmail.com>  wrote:
>>
>> Here is a small patch that prevents flyspelle from checking all the Org
>> keywords. This is especially useful when using a dictionary other than
>> english.
>>
>> Cheers,
>>
>> --Seb
>>
>>  From 0a6493331f1d84a4c44533bdea1c3c9b41c997eb Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?S=C3=A9bastien=20Delafond?=<sdelafond@gmail.com>
>> Date: Mon, 23 May 2011 18:16:57 +0200
>> Subject: [PATCH] [flyspell] Do not run flyspell-checks on {todo,all-time,additional-option-like}-keywords
>>
>>    * this is useful when using flyspell with a non-English dictionary,
>>      or if some of your keywords are in another language
>> ---
>>   lisp/org.el |   12 +++++++++---
>>   1 files changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/lisp/org.el b/lisp/org.el
>> index 9f8fa92..676f08f 100644
>> --- a/lisp/org.el
>> +++ b/lisp/org.el
>> @@ -20135,9 +20135,15 @@ To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
>>
>>   ;; Make flyspell not check words in links, to not mess up our keymap
>>   (defun org-mode-flyspell-verify ()
>> -  "Don't let flyspell put overlays at active buttons."
>> -  (and (not (get-text-property (max (1- (point)) (point-min)) 'keymap))
>> -       (not (get-text-property (max (1- (point)) (point-min)) 'org-no-flyspell))))
>> +  "Don't let flyspell put overlays at active buttons, or on
>> +   {todo,all-time,additional-option-like}-keywords."
>> +  (let ((pos (max (1- (point)) (point-min)))
>> +	(word (thing-at-point 'word)))
>> +    (and (not (get-text-property pos 'keymap))
>> +	 (not (get-text-property pos 'org-no-flyspell))
>> +	 (not (member word org-todo-keywords-1))
>> +	 (not (member word org-all-time-keywords))
>> +	 (not (member word org-additional-option-like-keywords)))))
>>
>>   (defun org-remove-flyspell-overlays-in (beg end)
>>     "Remove flyspell overlays in region."
>
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Do not run flyspell checks on org keywords
  2011-05-24  8:18 [patch] Do not run flyspell checks on org keywords Sébastien Delafond
  2011-05-31 13:14 ` Sébastien Delafond
@ 2011-06-01 11:53 ` Julien Danjou
  1 sibling, 0 replies; 4+ messages in thread
From: Julien Danjou @ 2011-06-01 11:53 UTC (permalink / raw)
  To: Sebastien Delafond; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

On Tue, May 24 2011, Sébastien Delafond wrote:

> Here is a small patch that prevents flyspelle from checking all the Org
> keywords. This is especially useful when using a dictionary other than
> english.

Pushed.

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-01 11:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-24  8:18 [patch] Do not run flyspell checks on org keywords Sébastien Delafond
2011-05-31 13:14 ` Sébastien Delafond
2011-05-31 14:09   ` Christian Moe
2011-06-01 11:53 ` Julien Danjou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).