info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get value of parameter in macro


From: Ted Zlatanov
Subject: Re: How to get value of parameter in macro
Date: Wed, 06 Jan 2010 09:35:08 -0600
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.90 (gnu/linux)

On Wed, 06 Jan 2010 12:36:03 +0100 Cecil Westerhof <address@hidden> wrote: 

CW> I am trying my first stab at macro's. I want to define key bindings to a
CW> jump to a group. I tried something like:
CW>     (defmacro gnus-group-jump-bind (key-binding group-to-jump-to)
CW>       (define-key gnus-group-mode-map key-binding
CW>         (lambda ()
CW>           (interactive)
CW>           (gnus-group-jump-to-group group-to-jump-to))))

CW>     (gnus-group-jump-bind "vjd" "nndraft:drafts")

CW> The key binding is okay, but the lambda function not. This becomes:
CW>     (lambda nil (interactive) (gnus-group-jump-to-group group-to-jump-to))

CW> instead of:
CW>     (lambda nil (interactive) (gnus-group-jump-to-group "nndraft:drafts"))

CW> What do I need to do to get the value of group-to-jump-to instead of the
CW> string?

Read the manual section on macros again, and again, and again.  It
really takes a while.  You are trying to find the , interpolation
marker, e.g. ",group-to-jump-to" will become "nndraft:drafts" but again
you should read the manual very thoroughly.

Ted


reply via email to

[Prev in Thread] Current Thread [Next in Thread]