* help with flyspell-mode
@ 2009-11-22 2:15 Daniel Dalton
2009-11-22 5:06 ` Bernardo
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Dalton @ 2009-11-22 2:15 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 382 bytes --]
Hi,
How can I enable flyspell-mode for documents that don't have an
extension?
eg. I've auto enabled it through .emacs for text, python, etc. Like
this:
emacs /tmp/stuff.txt
Loads flyspell-mode, but emacs /tmp/stuff wouldn't.
Anyone know how to enable flyspell mode for files with no extension?
Thanks
--
Cheers,
Dan
http://members.iinet.net.au/~ddalton/
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: help with flyspell-mode
[not found] <mailman.11262.1258856141.2239.help-gnu-emacs@gnu.org>
@ 2009-11-22 2:34 ` Les Harris
2009-11-22 11:05 ` Daniel Dalton
` (2 more replies)
2009-11-22 16:14 ` harven
1 sibling, 3 replies; 9+ messages in thread
From: Les Harris @ 2009-11-22 2:34 UTC (permalink / raw)
To: help-gnu-emacs
Daniel Dalton <d.dalton@iinet.net.au> writes:
> Anyone know how to enable flyspell mode for files with no extension?
Using a file local variable for the files with no extension would be one
option. ie, adding:
-*- mode: flyspell; -*-
to the top of your file would turn flyspell mode on. This is only
useful for files you visit often though.
Alternatively, you can add an element to magic-mode-alist which makes
emacs match a given regular expression or match function against the
file being opened and setting the given mode. This method is only
useful if you can predict in someway what might be in the extension-less
files.
Unfortunately, Fundamental mode doesn't run any hooks so that method
won't work.
So a couple of suboptimal ideas is all I can come up with. Would love
to hear of a more robust approach perhaps using 'file' and setting the
mode based off that some how.
--
Do they only stand
By ignorance, is that their happy state,
The proof of their obedience and their faith?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: help with flyspell-mode
2009-11-22 2:15 help with flyspell-mode Daniel Dalton
@ 2009-11-22 5:06 ` Bernardo
0 siblings, 0 replies; 9+ messages in thread
From: Bernardo @ 2009-11-22 5:06 UTC (permalink / raw)
To: help-gnu-emacs
>
> How can I enable flyspell-mode for documents that don't have an
> extension?
> eg. I've auto enabled it through .emacs for text, python, etc. Like
> this:
> emacs /tmp/stuff.txt
> Loads flyspell-mode, but emacs /tmp/stuff wouldn't.
>
> Anyone know how to enable flyspell mode for files with no extension?
>
> Thanks
>
possibly by using local variables e.g. something like this within a file
# -*- eval: (flyspell-mode) -*-
see (info "(emacs) Choosing Modes")
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: help with flyspell-mode
2009-11-22 2:34 ` Les Harris
@ 2009-11-22 11:05 ` Daniel Dalton
2009-11-22 14:38 ` Colin S. Miller
2009-11-28 3:09 ` Stefan Monnier
2 siblings, 0 replies; 9+ messages in thread
From: Daniel Dalton @ 2009-11-22 11:05 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 884 bytes --]
On Sat, Nov 21, 2009 at 06:34:12PM -0800, Les Harris wrote:
>
> Using a file local variable for the files with no extension would be one
> option. ie, adding:
>
> -*- mode: flyspell; -*-
>
> to the top of your file would turn flyspell mode on. This is only
> useful for files you visit often though.
>
> Alternatively, you can add an element to magic-mode-alist which makes
> emacs match a given regular expression or match function against the
> file being opened and setting the given mode. This method is only
Yes, thanks I might have a play with this at some stage, but it is
probably easier if I just use the txt extention:)
Also, speaking of this can you show me the sintax of how I would
automatically set message-mode for a filename containing the words
"mutt-localhost"?
Thanks
--
Cheers,
Dan
http://members.iinet.net.au/~ddalton/
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: help with flyspell-mode
2009-11-22 2:34 ` Les Harris
2009-11-22 11:05 ` Daniel Dalton
@ 2009-11-22 14:38 ` Colin S. Miller
2009-11-26 7:54 ` Kevin Rodgers
2009-11-28 3:09 ` Stefan Monnier
2 siblings, 1 reply; 9+ messages in thread
From: Colin S. Miller @ 2009-11-22 14:38 UTC (permalink / raw)
To: help-gnu-emacs
Les Harris wrote:
>
> Unfortunately, Fundamental mode doesn't run any hooks so that method
> won't work.
>
The OP might be able to add a defadvice to 'fundamental-mode.
The advice function could check the extension of the current buffer's
file, and run (flyspell-mode 't) if there isn't one.
HTH,
Colin S. Miller
--
Replace the obvious in my email address with the first three letters of the hostname to reply.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: help with flyspell-mode
[not found] <mailman.11262.1258856141.2239.help-gnu-emacs@gnu.org>
2009-11-22 2:34 ` Les Harris
@ 2009-11-22 16:14 ` harven
1 sibling, 0 replies; 9+ messages in thread
From: harven @ 2009-11-22 16:14 UTC (permalink / raw)
To: help-gnu-emacs
Daniel Dalton <d.dalton@iinet.net.au> writes:
> Hi,
>
> How can I enable flyspell-mode for documents that don't have an
> extension?
> eg. I've auto enabled it through .emacs for text, python, etc. Like
> this:
> emacs /tmp/stuff.txt
> Loads flyspell-mode, but emacs /tmp/stuff wouldn't.
>
> Anyone know how to enable flyspell mode for files with no extension?
If you want to have flyspell mode enabled for all files, you may
want to try the find-file-hook.
(add-hook 'find-file-hook 'turn-on-flyspell)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: help with flyspell-mode
2009-11-22 14:38 ` Colin S. Miller
@ 2009-11-26 7:54 ` Kevin Rodgers
2009-11-26 11:27 ` Lennart Borgman
0 siblings, 1 reply; 9+ messages in thread
From: Kevin Rodgers @ 2009-11-26 7:54 UTC (permalink / raw)
To: help-gnu-emacs
Colin S. Miller wrote:
> Les Harris wrote:
>>
>> Unfortunately, Fundamental mode doesn't run any hooks so that method
>> won't work.
>>
>
> The OP might be able to add a defadvice to 'fundamental-mode.
> The advice function could check the extension of the current buffer's
> file, and run (flyspell-mode 't) if there isn't one.
Or:
(add-hook 'fundamental-mode 'turn-on-flyspell)
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: help with flyspell-mode
2009-11-26 7:54 ` Kevin Rodgers
@ 2009-11-26 11:27 ` Lennart Borgman
0 siblings, 0 replies; 9+ messages in thread
From: Lennart Borgman @ 2009-11-26 11:27 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
On Thu, Nov 26, 2009 at 8:54 AM, Kevin Rodgers
<kevin.d.rodgers@gmail.com> wrote:
> Colin S. Miller wrote:
>>
>> Les Harris wrote:
>>>
>>> Unfortunately, Fundamental mode doesn't run any hooks so that method
>>> won't work.
>>>
>>
>> The OP might be able to add a defadvice to 'fundamental-mode.
>> The advice function could check the extension of the current buffer's
>> file, and run (flyspell-mode 't) if there isn't one.
>
> Or:
>
> (add-hook 'fundamental-mode 'turn-on-flyspell)
That will not work.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: help with flyspell-mode
2009-11-22 2:34 ` Les Harris
2009-11-22 11:05 ` Daniel Dalton
2009-11-22 14:38 ` Colin S. Miller
@ 2009-11-28 3:09 ` Stefan Monnier
2 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2009-11-28 3:09 UTC (permalink / raw)
To: help-gnu-emacs
> Unfortunately, Fundamental mode doesn't run any hooks so that method
It does. It runs after-change-major-mode-hook.
Of course, some buffers are put in fundamental-mode by default without
ever actually calling fundamental-mode.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-11-28 3:09 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-22 2:15 help with flyspell-mode Daniel Dalton
2009-11-22 5:06 ` Bernardo
[not found] <mailman.11262.1258856141.2239.help-gnu-emacs@gnu.org>
2009-11-22 2:34 ` Les Harris
2009-11-22 11:05 ` Daniel Dalton
2009-11-22 14:38 ` Colin S. Miller
2009-11-26 7:54 ` Kevin Rodgers
2009-11-26 11:27 ` Lennart Borgman
2009-11-28 3:09 ` Stefan Monnier
2009-11-22 16:14 ` harven
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).