From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/53759 Path: main.gmane.org!not-for-mail From: letters@hotpop.com (Jari Aalto+mail.emacs) Newsgroups: gmane.emacs.gnus.general Subject: Difficult lisp macro question (related to gnus-group.el) Date: Mon, 18 Aug 2003 18:23:27 +0300 Sender: ding-owner@lists.math.uh.edu Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1061229368 27416 80.91.224.253 (18 Aug 2003 17:56:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 18 Aug 2003 17:56:08 +0000 (UTC) Original-X-From: ding-owner+M2300@lists.math.uh.edu Mon Aug 18 19:56:06 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19ooEg-00073R-00 for ; Mon, 18 Aug 2003 19:56:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19ooDH-0002Nj-00; Mon, 18 Aug 2003 12:54:39 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19oljV-00027G-00 for ding@lists.math.uh.edu; Mon, 18 Aug 2003 10:15:45 -0500 Original-Received: (qmail 94113 invoked by alias); 18 Aug 2003 15:15:45 -0000 Original-Received: (qmail 94108 invoked from network); 18 Aug 2003 15:15:44 -0000 Original-Received: from fep06-0.kolumbus.fi (HELO fep06-app.kolumbus.fi) (193.229.0.57) by sclp3.sclp.com with SMTP; 18 Aug 2003 15:15:44 -0000 Original-Received: from poboxes.com ([81.197.1.6]) by fep06-app.kolumbus.fi with ESMTP id <20030818151509.YUKX8538.fep06-app.kolumbus.fi@poboxes.com> for ; Mon, 18 Aug 2003 18:15:09 +0300 Original-To: ding@gnus.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/20.7 (windows-nt) (i386-*-nt5.0.2195) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:53759 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:53759 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