Cecil Westerhof <[email protected]> writes:

> And solved this problem also:
>     (setq gnus-group-jump-list
>           (list
>            '("d" "nndraft:drafts")
>            ))
>
>     (defmacro gnus-group-jump-bind (key-binding group-to-jump-to)
>       `(define-key gnus-group-mode-map ,(symbol-value key-binding)
>         (lambda ()
>           (interactive)
>           (gnus-group-jump-to-group ,(symbol-value group-to-jump-to)))))
>
>     (defun gnus-group-do-jump-bind ()
>        (dolist (this-jump gnus-group-jump-list)
>          (let ((this-group (second this-jump))
>                (this-key   (concat "vj" (first this-jump))))
>          (gnus-group-jump-bind this-key this-group))))

Pascal Bourguignon told me that it was not necessary to use a macro. So
I rewrote it without using a macro:
    (defun gnus-group-jump-bind ()
      "Define the key bindings for jumping to groups;"
      (dolist (this-jump gnus-group-jump-list)
        (let ((this-description (second this-jump))
              (this-group       (third  this-jump))
              (this-key         (concat "vj" (first this-jump))))
          (define-key gnus-group-mode-map this-key
            `(lambda ()
              ,this-description
              (interactive)
              (gnus-group-jump-to-group ,this-group))))))

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
_______________________________________________
info-gnus-english mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to