help-gnu-emacs
[Top][All Lists]
Advanced

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

emacs lisp - unable to write a function maker


From: C K Kashyap
Subject: emacs lisp - unable to write a function maker
Date: Fri, 16 Sep 2011 14:16:04 +0530

Hi,
I was trying to write a function that would help in creating various abbreviation functions.


(defun makeAbrevFun (name val) 
  (eval 
   (defun name () (insert val))))

The intention is that the below code would create a function called "aa" 
(makeAbrevFun 'aa "aaaaaaaaaaaaaa")
That can be invoked by doing (aa)C-X C-e
This does not work. Could someone please let me know how I can achieve this?
Regards,
Kashyap


reply via email to

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