unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Define skeleton from alist?
@ 2016-07-13  8:11 Paul Rankin
  2016-07-14  2:38 ` John Mastro
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Rankin @ 2016-07-13  8:11 UTC (permalink / raw)
  To: help-gnu-emacs

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.



^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <mailman.1264.1468397506.26859.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2016-07-15  1:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-13  8:11 Define skeleton from alist? Paul Rankin
2016-07-14  2:38 ` 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

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 read-only IMAP folder(s) and NNTP newsgroup(s).