GNU bug report logs - #8151
add flyspell-prog-mode initiation example to Info

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Wed, 2 Mar 2011 12:25:01 UTC

Severity: minor

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: bug#8151: add flyspell-prog-mode initiation example to Info
Date: Thu, 03 Mar 2011 00:35:59 -0700
On 3/2/11 5:22 AM, jidanni <at> jidanni.org wrote:
> In (info "(emacs) Spelling")
>
>     Type `M-x flyspell-mode' to enable or disable this mode in the
>     current buffer. To enable `flyspell-mode' in all text mode buffers,
>     add `turn-on-flyspell' to `text-mode-hook'. ...
>
>        Flyspell Prog mode works just like ordinary Flyspell mode, except
>     that it only checks words in comments and string constants.  This
>     feature is useful for editing programs.  Type `M-x flyspell-prog-mode'
>     to enable or disable this mode in the current buffer.
>
> OK, but the second paragraph doesn't say what hook to turn
> flyspell-prog-mode on for all programs!

In the absence of specific information, use the same method you would use to
turn any other minor mode on for all buffers in a particular major mode (or its
derivatives).

> Or mention how to turn it on one by one...

Do you mean buffer by buffer, or major mode by major mode?

Either way, that is not specific to flyspell-prog-mode.

> Well it turns out one needs to use a totally different method to turn on
> flyspell-prog-mode, e.g.,
> (add-hook 'perl-mode-hook
>    (function (lambda ()(flyspell-prog-mode))))
> And it turns out there is no way to turn off flyspell-prog-mode... OK,
> probably just turn off flyspell-mode.

(function (lambda () (foo-mode))) = (lambda () (foo-mode)) = (function foo-mode) 
= (quote foo) = 'foo

(funcall 'turn-on-foo-mode) = (foo-mode 1) = (foo-mode)

> Also in the mode line there is no distinction of the two types of
> flyspell-mode... probably because no big deal.

It might make sense to use Fly/Text and Fly/Prog in the mode line.

-- 
Kevin Rodgers
Denver, Colorado, USA





This bug report was last modified 14 years and 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.