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: Tassilo Horn
Subject: Re: Defining functions on the fly
Date: Mon, 15 Jun 2015 12:00:18 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

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?

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))

Bye,
Tassilo



reply via email to

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