all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

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 --
     [not found] <mailman.1264.1468397506.26859.help-gnu-emacs@gnu.org>
2016-07-13 21:37 ` Define skeleton from alist? 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
2016-07-13  8:11 Paul Rankin
2016-07-14  2:38 ` John Mastro
2016-07-14  6:00   ` Paul Rankin

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.