Next: , Previous: , Up: Borg User Manual   [Contents][Index]


9 Low-level functions

You normally should not have to use the following low-level functions directly. That being said, you might want to do so anyway if you build your own tools on top of Borg.

Function: borg-worktree clone

This function returns the top-level of the working tree of the clone named CLONE.

Function: borg-gitdir clone

This function returns the Git directory of the clone named CLONE.

It always returns BORG-USER-EMACS-DIRECTORY/.git/modules/CLONE, even when CLONE’s Git directory is actually located inside the working tree.

Macro: borg-do-drones (var [result]) body...)

This macro loop over drones. BODY is evaluated with VAR bound to each drone, in turn. Inside BODY variables set in .gitmodules are cached. Then RESULT is evaluated to get the return value, defaulting to nil.

Function: borg-get clone variable &optional all

This function returns the value of the Git variable submodule.CLONE.VARIABLE defined in ~/.config/emacs/.gitmodules. If optional ALL is non-nil, then it returns all values as a list.

Function: borg-get-all clone variable

This function returns all values of the Git variable submodule.CLONE.VARIABLE defined in ~/.config/emacs/.gitmodules as a list.

Function: borg-load-path clone

This function returns the load-path for the clone named CLONE.

Function: borg-info-path clone &optional setup

This function returns the Info-directory-list for the clone named CLONE.

If optional SETUP is non-nil, then it returns a list of directories containing texi and/or info files. Otherwise it returns a list of directories containing a file named dir.

Function: borg-dronep name

This function returns non-nil if a drone named NAME exists.

If that is set in .gitmodules, then it returns the value of submodule.NAME.path, nil otherwise.

Function: borg-drones &optional include-variables

This function returns a list of all assimilated drones.

The returned value is a list of the names of the assimilated drones, unless optional INCLUDE-VARIABLES is non-nil, in which case elements of the returned list have the form (NAME . ALIST).

ALIST is an association list. Property names are symbols and correspond to a VARIABLE defined in the Borg repository’s .gitmodules file as submodule.NAME.VARIABLE.

Each property value is either a string or a list of strings. If INCLUDE-VARIABLES is raw then all values are lists. Otherwise a property value is only a list if the corresponding property name is a member of borg--multi-value-variables. If a property name isn’t a member of borg--multi-value-variables but it does have multiple values anyway, then it is undefined with value is included in the returned value.

Function: borg-clones

This function returns a list of all cloned packages.

The returned value includes the names of all drones, as well as the names of all other repositories that are located directly inside borg-drones-directory but aren’t tracked as submodules.

Function: borg-read-package prompt &optional edit-url

This function reads a package name and the url of its upstream repository from the user, and returns them as a list.

When the epkg package is available, then the user is only prompted for the name of the package, and the upstream url is retrieved from the Epkg database. If the package isn’t in the database then the url has to be provided by the user. If optional EDIT-URL is non-nil, then the url from the database, if any, is provided as initial input for the user to edit.

PROMPT is used when prompting for the package name.

Function: borg-read-clone prompt

This function reads the name of a cloned package from the user.

There exist a few more functions, but those are considered to be internal and might therefore change in incompatible ways without that being noted in the change log.

Function: borg--maybe-absorb-gitdir pkg
Function: borg--maybe-reuse-gitdir pkg
Function: borg--restore-worktree pkg
Function: borg--call-git pkg &rest args
Function: borg--expand-load-path drone path
Function: borg--sort-submodule-sections

Next: Function and Command Index, Previous: Variables, Up: Borg User Manual   [Contents][Index]