[Top][All Lists]

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

Understanding internal use functions

From: Paul W. Rankin
Subject: Understanding internal use functions
Date: Mon, 06 May 2019 14:15:34 +1000
User-agent: mu4e 1.2.0; emacs 26.2


I saw this in the Elisp manual:

By convention, if a function’s symbol consists of two names separated
by ‘--’, the function is intended for internal use and the first part
names the file defining the function.  For example, a function named
‘vc-git--rev-parse’ is an internal function defined in ‘vc-git.el’.
Internal-use functions written in C have names ending in ‘-internal’,
e.g., ‘bury-buffer-internal’.  Emacs code contributed before 2018 may
follow other internal-use naming conventions, which are being phased
(info "(elisp) Function Names")

How should I decide whether a function is for internal use, as opposed to just another function?

A command, i.e. (commandp FUNCTION) -> t, is interactive and so clearly not intended for internal use, but I assume this does not mean all non-interactive functions should be considered internal use?

It seems easier for internal use variables; if the user changes the `this--internal-variable' then the program may not work. Functions leave me a bit more bewildered... Or should I just think of it in the same way, e.g. "don't run this function yourself or you'll break things"?


reply via email to

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