Function: haskell-cabal-get-field

haskell-cabal-get-field is an interactive and natively compiled function defined in haskell-cabal.el.

Signature

(haskell-cabal-get-field NAME)

Documentation

Read the value of field with NAME from project's cabal file.

If there is no valid .cabal file to get the setting from (or there is no corresponding setting with that name in the .cabal file), then this function returns nil.

Key Bindings

This command is not in any keymaps.

Aliases

haskell-cabal-guess-setting (obsolete since March 14, 2016)

Source Code

;; Defined in /nix/store/9lz2mhw95f9fqxr9mnq46k3f6qz3aq83-emacs-packages-deps/share/emacs/site-lisp/elpa/haskell-mode-20260904.1042/haskell-cabal.el
;;;###autoload
(defun haskell-cabal-get-field (name)
  "Read the value of field with NAME from project's cabal file.
If there is no valid .cabal file to get the setting from (or
there is no corresponding setting with that name in the .cabal
file), then this function returns nil."
  (interactive)
  (when (and name buffer-file-name)
    (let ((cabal-file (haskell-cabal-find-file)))
      (when (and cabal-file (file-readable-p cabal-file))
        (with-temp-buffer
          (insert-file-contents cabal-file)
          (haskell-cabal--get-field name))))))