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

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

calling similar function


From: scm
Subject: calling similar function
Date: 7 Jul 2006 19:54:54 -0700
User-agent: G2/0.2

Greetings,

I was wondering if someone could shed some light on how I could call an
interactive function by another interactive function. I want to do this
to save on some coding, as the two functions are identical except their
names.

Here is the function I want to call:

(defun list (command)
  (interactive "sCommand> ")
    (if (string-match "ls" command)
        (shell-command "ls")))

Here is my attempt at coding an interactive calling function.

(defun list-foo ()
  (interactive)
  (list))

I want to be able to M-x list-foo and have list be called.

Thanks in advance to anyone who has the time to lend to this question.



reply via email to

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