Skip to content

Instantly share code, notes, and snippets.

@perusio
Created January 1, 2011 18:02
Show Gist options
  • Save perusio/761890 to your computer and use it in GitHub Desktop.
Save perusio/761890 to your computer and use it in GitHub Desktop.
A Emacs Lisp skeleton for inserting a hook_views_api
(define-skeleton hook-views-api-skel
"Inserts a hook_views_api template in the current buffer."
nil
> "/**" \n
> -2 "* Implementation of hook_views_api().\n"
> "*/" \n
> "function " (setq v1 (skeleton-read "Module name: ")) "_views_api() {" \n
> "return array(" \n
> "'api' => " (setq v2 (skeleton-read "API version: ")) | "2" "," \n
> "'path' => drupal_get_path('module', '" v1 "') . " (setq v2 (skeleton-read "Path: ")) | "'/includes/views'" "," \n
> ");\n"
> -2 "} // " v1 "_views_api")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment