[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trouble using snippet.el with abbrev tables

From: Peter Michaux
Subject: Trouble using snippet.el with abbrev tables
Date: Mon, 4 Feb 2008 17:09:41 -0800


I'm new to Emacs and having trouble getting snippet.el working.

The instruction in the file may be good for an Emacs expert but I'm
still missing something.

I've tried various combinations of the following configuration in my
.emacs file with no luck.

(autoload 'javascript-mode "javascript" nil t)
(add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))

(load "snippet")

(add-hook 'javascript-mode-hook
          (lambda ()

              ; someone suggested the following line but it seems redundant
              (require 'javascript-mode)
              (abbrev-mode 1)
              (define-abbrev-table 'javascript-mode-abbrev-table ())
              (snippet-with-abbrev-table 'javascript-mode-abbrev-table
                ("for" .  "for $${element} in $${sequence}:")
                ("im"  .  "import $$")
                ("if"  .  "if $${True}:")
                ("wh"  .  "while $${True}:"))


Not only does it not work but it seems horribly inefficient to define
a new abbrev table each time the JavaScript mode starts.

Any ideas? Does anyone have it working?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]