Gnus development mailing list
 help / color / mirror / Atom feed
* Difficult lisp macro question (related to gnus-group.el)
@ 2003-08-18 15:23 Jari Aalto+mail.emacs
  2003-08-18 19:35 ` Kai Großjohann
  0 siblings, 1 reply; 2+ messages in thread
From: Jari Aalto+mail.emacs @ 2003-08-18 15:23 UTC (permalink / raw)



I noticed that the `gnus-group-quick-select-group' function M-RET in
Group buffer only sets few hooks to nil:

  (let (gnus-visual
	gnus-score-find-score-files-function
	gnus-home-score-file
	gnus-apply-kill-hook
	gnus-summary-expunge-below)

I'm in a process of making and proposing a patch to allow user to
define what hooks he want to be set to `nil' instead of the hard coded
version. However, I don't seem to be able to solve how to contruct `let' 
dynamically from a variable, say `hook-list'. That is:

- Given a defvar hook-list (list of hooks to disable)
- The function definition's let should include all those
  hooks defined in `hook-list' locally set to nil.

  (let (gnus-visual     ;;  User given hook 1
        ...             ;;  User given hook 2
        ...             ;;  ...
        )

If this is not clear, Example below hopefully demontrates the
intention. I have a problem figuring out how I make the
`my-let-transform' to contruct that `let' around the BODY which
includes all `list' variables set to nil.

    (let ((list '(a
                  b
                  c)))

      (setq a 1)

      (defmacro my-let-transform (list &rest body)
        (` 
         (progn
           (,@ body))))

      (defun my-test ()
        (my-let-transform list
                          (message "A: %d" a)))

      (my-test))


=> The result of `my-test' should show after macroexpand:

      (defun my-test ()
        (let (a
              b
              c)
          (message "A: %d" a)))

Any ideas?
Jari




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

* Re: Difficult lisp macro question (related to gnus-group.el)
  2003-08-18 15:23 Difficult lisp macro question (related to gnus-group.el) Jari Aalto+mail.emacs
@ 2003-08-18 19:35 ` Kai Großjohann
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Großjohann @ 2003-08-18 19:35 UTC (permalink / raw)


letters@hotpop.com (Jari Aalto+mail.emacs) writes:

>       (defmacro my-let-transform (list &rest body)
>         (` 
>          (progn
>            (,@ body))))

Untested:

(defmacro my-let-transform (list &rest body)
  `(let ,list ,@body))

-- 
Two cafe au lait please, but without milk.



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

end of thread, other threads:[~2003-08-18 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-18 15:23 Difficult lisp macro question (related to gnus-group.el) Jari Aalto+mail.emacs
2003-08-18 19:35 ` Kai Großjohann

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