I have some very long function names I want to use short forms for in particular files, eg

(defalias-local avlfn a-very-long-function-name)

Is that possible, or is that something I may have to write myself?

Can I define something like what within a function or a mode?


I think I may have a partial answer here, but it applies in a let binding rather than the whole file.

1 Answer 1


No, there really isn’t a built–in way to scope names to a particular file or package. Loading a file just adds new things to the global environment, or changes things in the global environment. The global environment we use as users is just the sum of all those additions and changes.

However, as pointed out in the linked question and answer, let and flet (aka cl-flet) can certainly be used to shorten function and variable and function names if you want. Not everyone likes putting all of their code into a big let or flet though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.