all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Rankin <hello@paulwrankin.com>
To: help-gnu-emacs@gnu.org
Subject: Define skeleton from alist?
Date: Wed, 13 Jul 2016 18:11:27 +1000	[thread overview]
Message-ID: <1468397487.752665.664828897.4AC040A5@webmail.messagingengine.com> (raw)

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.



             reply	other threads:[~2016-07-13  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-13  8:11 Paul Rankin [this message]
2016-07-14  2:38 ` Define skeleton from alist? John Mastro
2016-07-14  6:00   ` Paul Rankin
     [not found] <mailman.1264.1468397506.26859.help-gnu-emacs@gnu.org>
2016-07-13 21:37 ` Gene
2016-07-14  1:12   ` Paul Rankin
     [not found]   ` <mailman.1366.1468458751.26859.help-gnu-emacs@gnu.org>
2016-07-15  1:13     ` Gene

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=1468397487.752665.664828897.4AC040A5@webmail.messagingengine.com \
    --to=hello@paulwrankin.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.