[Top][All Lists]

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

Re: defining a M-x function

From: Marco Wahl
Subject: Re: defining a M-x function
Date: 5 Sep 2006 00:05:24 -0700
User-agent: G2/0.2

Johannes Quint schrieb:

> how can i define a function which i can call via M-x?
> thanks for help, jq

This is merely a question for, isn't it?
Anyway, here is an example:

Write the function e.g. in the *scratch* buffer, e.g.

(defun jq-callable-via-M-x ()
  (print "This is function jq-callable-via-M-x! Yeah!"))

Mark the whole function and do 'M-x eval-region'.  This adds the
function to the, err, system.

Then you can use 'M-x jq-callable-via-M-x'.
The key for M-x callability is the line '(interactive)'.


reply via email to

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