bookmark-make-record-function is a variable defined in `bookmark.el'.
Its value is

  • This variable may be risky if used as a file-local variable.

A function that should be called to create a bookmark record.
Modes may set this variable buffer-locally to enable bookmarking of
locations that should be treated specially, such as Info nodes,
news posts, images, pdf documents, etc.

The function will be called with no arguments.
It should signal a user error if it is unable to construct a record for
the current location.

The returned record should be a cons cell of the form (NAME . ALIST)
where ALIST is as described in `bookmark-alist' and may typically contain
a special cons (handler . HANDLER-FUNC) which specifies the handler function
that should be used instead of `bookmark-default-handler' to open this
bookmark. See the documentation for `bookmark-alist' for more.

NAME is a suggested name for the constructed bookmark. It can be nil
in which case a default heuristic will be used. The function can also
equivalently just return ALIST without NAME.