From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: An elisp question Date: Tue, 16 Sep 2008 13:09:59 -0700 Message-ID: <001f01c91838$32b44540$0200a8c0@us.oracle.com> References: <87zlm7alrq.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1221595807 19358 80.91.229.12 (16 Sep 2008 20:10:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Sep 2008 20:10:07 +0000 (UTC) To: "'Rodolfo Medina'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 16 22:11:04 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kfgt2-00018G-9q for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Sep 2008 22:11:00 +0200 Original-Received: from localhost ([127.0.0.1]:34123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kfgs0-0008P0-4E for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Sep 2008 16:09:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kfgrf-0008OZ-R9 for help-gnu-emacs@gnu.org; Tue, 16 Sep 2008 16:09:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kfgre-0008Nz-Kd for help-gnu-emacs@gnu.org; Tue, 16 Sep 2008 16:09:35 -0400 Original-Received: from [199.232.76.173] (port=51474 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kfgre-0008Nv-El for help-gnu-emacs@gnu.org; Tue, 16 Sep 2008 16:09:34 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]:51343) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kfgrd-0001Fq-F0 for help-gnu-emacs@gnu.org; Tue, 16 Sep 2008 16:09:33 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m8GK9QbQ009502; Tue, 16 Sep 2008 14:09:26 -0600 Original-Received: from acsmt702.oracle.com (acsmt702.oracle.com [141.146.40.80]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m8GK9POE015946; Tue, 16 Sep 2008 14:09:25 -0600 Original-Received: from dradamslap1 (/141.144.58.96) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 16 Sep 2008 20:09:22 +0000 X-Mailer: Microsoft Office Outlook 11 In-reply-to: <87zlm7alrq.fsf@gmail.com> Thread-Index: AckYNB2Oq5ktKbh1THW8n1cD/Ne6bQAA6d5w X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57709 Archived-At: > I have a set of `setq' conditions that I wish to group into a > function and put inside another function: > > (defun my-test () > (interactive) > (if (equal (y-or-n-p "Yes or no? ") t) > (setq ps-print-footer t > ps-print-footer-frame nil > ps-top-margin 18 > ps-bottom-margin 5 > ps-left-margin 9 > ps-right-margin 7 > ps-print-header nil > ps-show-n-of-n nil > ps-print-footer-frame nil > ps-footer-lines 1 > ps-left-footer (quote ( )) > ps-footer-offset 0 > ) > (message "hallo"))) > > How can I group all those `setq' conditions into a function > and put that function name in place of them in `my-test' > definition? (defun foo () (setq ps-print-footer t ps-print-footer-frame nil ps-top-margin 18 ps-bottom-margin 5 ps-left-margin 9 ps-right-margin 7 ps-print-header nil ps-show-n-of-n nil ps-print-footer-frame nil ps-footer-lines 1 ps-left-footer (quote ( )) ps-footer-offset 0)) (defun my-test () (interactive) (if (equal (y-or-n-p "Yes or no? ") t) (foo) (message "hallo"))) Is this some kind of homework assignment? ;-)