Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH]: New gnus-parameters variable
@ 2004-01-01  2:08 Xavier Maillard
  2004-01-02 19:47 ` Lars Magne Ingebrigtsen
       [not found] ` <plop87d6a4e7z9.fsf-icAv0V0KtPVAfugRpC6u6w@public.gmane.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Xavier Maillard @ 2004-01-01  2:08 UTC (permalink / raw)


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

Hi and Happy new year !

Following an idea from Alex Schroeder[1], I have hacked something that
could be of interest for people (I guess ;)). As I said in another
post, I am not familiar (yet) to gnus internals and so, my "patch" is
actually some elisp I wrote separately.

What it does is quite simple, it adds a new gnus-parameters variable
(dictionary) which allow to enable flyspell with per-group dictionary.

That way, one can simply use it is to say something like this:

,----
| (setq gnus-parameters 
|       '(("list\\..*april.*" 
|          (dictionary . "francais"))
|         ("list.debian-user-french" 
|          (dictionary . "francais"))))
| 
| 
| (setq gnus-parameter-dictionary-alist
|       '(("ml.emacs.ding" . "american")))
`----

And whenever he enters those groups, and reply or post something, it
will launch flyspell with the right dictionary.

Here us my add-on:

,---- 
| (gnus-define-group-parameter
|  dictionary
|  :function-document
|  "Return the dictionary used for the current group (if any)."
|  :variable-document
|  "Alist of regexps (to match group names) and default dictionary to use when composing a new message."
|  :parameter-type '(string :tag "Dictionary")
|  :parameter-document "\
| The default dictionary to use in the group.")
| 
| 
| (gnus-setup-dictionary "list.debian-user-french")
| 
| (defun gnus-setup-dictionary (group)
|   "Decide wich dictionary to use for group `group`."
|   (let ((group (or group ""))
|         dictionary)
| 
|     (setq dictionary (gnus-parameter-dictionary group))
|     (message "Dictionary used: %s" dictionary)
| 
|     (when dictionary
|       (set (make-local-variable 'ispell-local-dictionary) dictionary))
|     ))
| 
| 
| (add-hook 'gnus-message-setup-hook
|           (lambda ()
|             (gnus-setup-dictionary 
|              (if (boundp 'gnus-newsgroup-name)
|                  gnus-newsgroup-name ""))))
`----

IMO, this code can be enhanced but it works already as-is so feel free
to use/copy/paste/modify/incorporate it in gnus. My work is 
licensed under the GNU General Public License and I also let my
copyrights go to the FSF (if needed).

Cheers,

zeDek

Footnotes: 
[1] http://www.emacswiki.org/cgi-bin/wiki.pl/GnusSpelling
-- 
Xavier MAILLARD (GnuPG: 1024D/1E028EA5)
EmacsOS user (http://emacsfr.org)
APRIL (http://www.april.org)


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

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

* Re: [PATCH]: New gnus-parameters variable
  2004-01-01  2:08 [PATCH]: New gnus-parameters variable Xavier Maillard
@ 2004-01-02 19:47 ` Lars Magne Ingebrigtsen
  2004-01-03  1:49   ` Xavier Maillard
       [not found] ` <plop87d6a4e7z9.fsf-icAv0V0KtPVAfugRpC6u6w@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2004-01-02 19:47 UTC (permalink / raw)


Xavier Maillard <zedek@gnu-rox.org> writes:

> What it does is quite simple, it adds a new gnus-parameters variable
> (dictionary) which allow to enable flyspell with per-group dictionary.

Cool.

> IMO, this code can be enhanced but it works already as-is so feel free
> to use/copy/paste/modify/incorporate it in gnus. My work is 
> licensed under the GNU General Public License and I also let my
> copyrights go to the FSF (if needed).

But you haven't signed assignment papers yet?  If not, could you fill
out the following and email it to the FSF?

----------------------

Please email the following information to fsf-records@gnu.org, and we
will send you the assignment form for your past and future changes.
Please use your full name as the subject line of the message.


[What is the name of the program or package you're contributing to?]


[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]


[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]


[For the copyright registration, what country are you a citizen of?]


[What year were you born?]


[Please write your email address here.]


[Please write your postal address here.]





[Which files have you changed so far, and which new files have you written
so far?]


-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: [PATCH]: New gnus-parameters variable
  2004-01-02 19:47 ` Lars Magne Ingebrigtsen
@ 2004-01-03  1:49   ` Xavier Maillard
  0 siblings, 0 replies; 4+ messages in thread
From: Xavier Maillard @ 2004-01-03  1:49 UTC (permalink / raw)


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

On 2 Jan 2004, Lars Magne Ingebrigtsen<larsi@gnus.org> mused:
> Xavier Maillard <zedek@gnu-rox.org> writes:
>
>> What it does is quite simple, it adds a new gnus-parameters variable
>> (dictionary) which allow to enable flyspell with per-group
>> dictionary.
>
> Cool.

Wow :) 

>> IMO, this code can be enhanced but it works already as-is so feel
>> free to use/copy/paste/modify/incorporate it in gnus. My work is
>> licensed under the GNU General Public License and I also let my
>> copyrights go to the FSF (if needed).
>
> But you haven't signed assignment papers yet?  If not, could you fill
> out the following and email it to the FSF?

Ok I just sent the mail. 

Thanx

zeDek
-- 
GnusFR  (http://www.gnusfr.org)
EmacsFR (http://www.emacsfr.org)

.emacs: Because customisation is fun!


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

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

* Re: [PATCH]: New gnus-parameters variable
       [not found] ` <plop87d6a4e7z9.fsf-icAv0V0KtPVAfugRpC6u6w@public.gmane.org>
@ 2004-01-05 22:52   ` Jochen Küpper
  0 siblings, 0 replies; 4+ messages in thread
From: Jochen Küpper @ 2004-01-05 22:52 UTC (permalink / raw)


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

On Thu, 01 Jan 2004 03:08:26 +0100 Xavier Maillard wrote:

zeDek> What it does is quite simple, it adds a new gnus-parameters variable
zeDek> (dictionary) which allow to enable flyspell with per-group dictionary.

Does this mean posting-styles are totally superfluous sometime soon?

Greetings,
Jochen
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
        (Part 3 you find in my messages before fall 2003.)

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

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

end of thread, other threads:[~2004-01-05 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-01  2:08 [PATCH]: New gnus-parameters variable Xavier Maillard
2004-01-02 19:47 ` Lars Magne Ingebrigtsen
2004-01-03  1:49   ` Xavier Maillard
     [not found] ` <plop87d6a4e7z9.fsf-icAv0V0KtPVAfugRpC6u6w@public.gmane.org>
2004-01-05 22:52   ` Jochen Küpper

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 NNTP newsgroup(s).