1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- (require 'cl-lib)
- (require 'guix nil t)
- (require 'guix-config)
- (require 'guix-utils)
- (defgroup guix-external nil
- "Settings for external programs."
- :group 'guix)
- (defcustom guix-guile-program
- (list (or guix-config-guile-program
- (executable-find "guile"))
-
-
- "--no-auto-compile")
- "Name of the 'guile' executable used for Guix REPL.
- May be either a string (the name of the executable) or a list of
- strings of the form:
- (NAME . ARGS)
- Where ARGS is a list of arguments to the guile program."
- :type 'string
- :group 'guix-external)
- (defcustom guix-dot-program
- (executable-find "dot")
- "Name of the 'dot' executable."
- :type 'string
- :group 'guix-external)
- (defcustom guix-dot-default-arguments
- '("-Tpng")
- "Default arguments for 'dot' program."
- :type '(repeat string)
- :group 'guix-external)
- (defcustom guix-dot-file-name-function #'guix-png-file-name
- "Function used to define a file name of a temporary 'dot' file.
- The function is called without arguments."
- :type '(choice (function-item guix-png-file-name)
- (function :tag "Other function"))
- :group 'guix-external)
- (defun guix-dot-arguments (output-file &rest args)
- "Return a list of dot arguments for writing a graph into OUTPUT-FILE.
- If ARGS is nil, use `guix-dot-default-arguments'."
- (or guix-dot-program
- (error (concat "Couldn't find 'dot'.\n"
- "Set `guix-dot-program' to a proper value")))
- (cl-list* guix-dot-program
- (concat "-o" output-file)
- (or args guix-dot-default-arguments)))
- (defun guix-dot-file-name ()
- "Call `guix-dot-file-name-function'."
- (funcall guix-dot-file-name-function))
- (defun guix-png-file-name ()
- "Return '.png' file name in the `guix-temporary-directory'."
- (guix-temporary-file-name "graph-" ".png"))
- (defun guix-html-file-name ()
- "Return '.html' file name in the `guix-temporary-directory'."
- (guix-temporary-file-name "graph-" ".html"))
- (provide 'guix-external)
|