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

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

Re: Defining functions on the fly


From: Andreas Röhler
Subject: Re: Defining functions on the fly
Date: Mon, 15 Jun 2015 12:33:04 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


Am 15.06.2015 um 12:00 schrieb Tassilo Horn:
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

Hi Andreas,

have a bunch of subroutines which are useful in several modes -
beginning/end of expressions, string positions, comments etc.

Now every mode should get its own prefix.
I don't quite get what you are trying to achieve.  If your
beginning-of-expression function is useful in a-mode, b-mode, and
c-mode, what's the purpose of defining it three times?

AFAIU tab-completion of mode's symbols requires it equally prefixed.

If you really want to have separate {a,b,c}-beginning-of-expression
functions, then you could do it by defining aliases.

   (dolist (prefix (list "a" "b" "c"))
     (defalias (intern (concat prefix "-beginning-of-expression"))
               #'beginning-of-expression))



That works, thanks!



reply via email to

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