From: letters@hotpop.com (Jari Aalto+mail.emacs)
Subject: Difficult lisp macro question (related to gnus-group.el)
Date: Mon, 18 Aug 2003 18:23:27 +0300 [thread overview]
Message-ID: <d6f3ouq8.fsf@blue.sea.net> (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
next reply other threads:[~2003-08-18 15:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-18 15:23 Jari Aalto+mail.emacs [this message]
2003-08-18 19:35 ` Kai Großjohann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d6f3ouq8.fsf@blue.sea.net \
--to=letters@hotpop.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).