Gnus development mailing list
 help / color / mirror / Atom feed
* Need gnus-group-load-hook?
@ 1997-04-18 17:59 Norman Walsh
  1997-04-18 18:17 ` Per Abrahamsen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Norman Walsh @ 1997-04-18 17:59 UTC (permalink / raw)


Hello world,

I download mail from my ISP, where it's spooled, to my own machine through
a mechanism that I hacked together.  Don't ask.

Anyway, I wanted "g" in the group buffer to run my own elisp function to
"do the right thing".  Redefining the key in my .gnus.el file doesn't work
because the definition goes away when gnus finishes loading.  It also
goes away when I redefine it in gnus-load-hook.

So I finally arrived at the following:

;; Maybe there ought to be a gnus-group-load-hook?
(add-hook 'gnus-group-mode-hook (lambda nil
			    (define-key gnus-group-mode-map "g" 
			      'get-new-mail-and-news)))

Is there a better way to do this?  (And would that way be gnus-group-load-hook
a l\'a gnus-sum-load-hook? ;-)

--norm

P.S. I'm running gnus.5.4.45 under GNU Emacs 19.34.


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

* Re: Need gnus-group-load-hook?
  1997-04-18 17:59 Need gnus-group-load-hook? Norman Walsh
@ 1997-04-18 18:17 ` Per Abrahamsen
  1997-04-18 19:00 ` David Moore
  1997-04-19  2:06 ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 4+ messages in thread
From: Per Abrahamsen @ 1997-04-18 18:17 UTC (permalink / raw)
  Cc: ding


Norman Walsh <norm@berkshire.net> writes:

> Is there a better way to do this?

You can use `eval-after-load'.  It is not better, but perhaps a little
more intuitive.


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

* Re: Need gnus-group-load-hook?
  1997-04-18 17:59 Need gnus-group-load-hook? Norman Walsh
  1997-04-18 18:17 ` Per Abrahamsen
@ 1997-04-18 19:00 ` David Moore
  1997-04-19  2:06 ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 4+ messages in thread
From: David Moore @ 1997-04-18 19:00 UTC (permalink / raw)


Norman Walsh <norm@berkshire.net> writes:

> ;; Maybe there ought to be a gnus-group-load-hook?
> (add-hook 'gnus-group-mode-hook (lambda nil
> 			    (define-key gnus-group-mode-map "g" 
> 			      'get-new-mail-and-news)))

Why not just stick (require 'gnus-group) before this line in your .gnus?


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

* Re: Need gnus-group-load-hook?
  1997-04-18 17:59 Need gnus-group-load-hook? Norman Walsh
  1997-04-18 18:17 ` Per Abrahamsen
  1997-04-18 19:00 ` David Moore
@ 1997-04-19  2:06 ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-04-19  2:06 UTC (permalink / raw)


Norman Walsh <norm@berkshire.net> writes:

> So I finally arrived at the following:
> 
> ;; Maybe there ought to be a gnus-group-load-hook?
> (add-hook 'gnus-group-mode-hook (lambda nil
> 			    (define-key gnus-group-mode-map "g" 
> 			      'get-new-mail-and-news)))
> 
> Is there a better way to do this? 

No, that's the canonical way to alter mode-specific keymaps.  Only you
should use `local-set-key' instead of `define-key'.

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


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

end of thread, other threads:[~1997-04-19  2:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-18 17:59 Need gnus-group-load-hook? Norman Walsh
1997-04-18 18:17 ` Per Abrahamsen
1997-04-18 19:00 ` David Moore
1997-04-19  2:06 ` Lars Magne Ingebrigtsen

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).