From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Rankin Newsgroups: gmane.emacs.help Subject: Define skeleton from alist? Date: Wed, 13 Jul 2016 18:11:27 +1000 Message-ID: <1468397487.752665.664828897.4AC040A5@webmail.messagingengine.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1468397543 11427 80.91.229.3 (13 Jul 2016 08:12:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2016 08:12:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 13 10:12:15 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bNFHB-0004Cm-Gi for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jul 2016 10:12:13 +0200 Original-Received: from localhost ([::1]:45793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNFH5-0000Xe-HJ for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jul 2016 04:12:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNFGh-0000XZ-Es for help-gnu-emacs@gnu.org; Wed, 13 Jul 2016 04:11:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNFGe-0001Mr-3P for help-gnu-emacs@gnu.org; Wed, 13 Jul 2016 04:11:43 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:48848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNFGb-0001L8-LG for help-gnu-emacs@gnu.org; Wed, 13 Jul 2016 04:11:40 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9D55820597 for ; Wed, 13 Jul 2016 04:11:27 -0400 (EDT) Original-Received: from web1 ([10.202.2.211]) by compute1.internal (MEProxy); Wed, 13 Jul 2016 04:11:27 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=paulwrankin.com; h=content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=MD4 S0BqVltyr946QVmLNsOj6U+4=; b=UAJ0tnsc/U479QNO7qF3olK7Dqy+uOEIktH oaZmQdUw0A/FKrhuYQq4A8/ZpprwS59Aq8zSeX/uZHugjphHyiGqx6ut6f/EaBQV fWUDU8nlzk6YSMr7p4iDLu6DqhmTbBvxTEqPNxgNjA5Ii6qDjjtiNrNb3EFefuKf ku4W7gfI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=MD4S0BqVltyr946QVmLNsOj6U+4=; b=S6D3I /jXY0qgZPGRZSdrqT84IFmZBifwgcf2Kq/C1A6h8TQGfdqL25aC1NfZuqLcMnGwt uFvtUMGBFwufXC3xe1S76attBq3nIY20aiF3WzfivhGbufLi5gb2yVjxGwfPG9j/ sSsaFlCSD8EngR8bOetmgu3o4PIiLnR6jVijI8= Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id 648E96A23B; Wed, 13 Jul 2016 04:11:27 -0400 (EDT) X-Sasl-Enc: QhF5NoCpCDgpA797fZ/1IRoZnZgPTM8rT2RN1LvltZ7d 1468397487 X-Mailer: MessagingEngine.com Webmail Interface - ajax-bf4e2c8f X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110803 Archived-At: Hello, does anyone really know their skeletons? I'd like to create a skeleton with define-skeleton using strings from an alist. The skeleton should loop through the alist using the car of each element as both the prompt and first string inserted, then the cadr as initial value for user input. The alist: (defcustom fountain-title-page-list (list (list "title" "") (list "credit" "written by") (list "author" user-full-name) (list "source" "") (list "date" "") (list "contact" user-mail-address)) "Association list of strings used to create `fountain-title-page-skeleton'." :type '(repeat (group (string :tag "Key") (string :tag "Initial value"))) :group 'fountain) My feeble non-functional attempt at the define-skeleton: (define-skeleton fountain-title-page-skeleton "Skeleton for inserting title page data. See `skeleton-insert'." nil '(dolist (var fountain-title-page-list (list v1 v2 "\n")) (setq v1 (concat (car var) ": ")) (setq v2 (skeleton-read v1 (cadr var))))) Any help would be much appreciated.