Function: auth-source-backends-parser-file

auth-source-backends-parser-file is a byte-compiled function defined in auth-source.el.gz.

Signature

(auth-source-backends-parser-file ENTRY)

Source Code

;; Defined in /usr/src/emacs/lisp/auth-source.el.gz
(defun auth-source-backends-parser-file (entry)
  ;; take just a file name use it as a netrc/plist file
  ;; matching any user, host, and protocol
  (when (stringp entry)
    (setq entry (list :source entry)))
  (let* ((source (plist-get entry :source))
         (source-without-gpg
          (if (and (stringp source)
                   (equal (file-name-extension source) "gpg"))
              (file-name-sans-extension source)
            (or source "")))
         (extension (or (and (stringp source-without-gpg)
                             (file-name-extension source-without-gpg))
                        "")))
    (when (stringp source)
      (cond
       ((equal extension "plist")
        (auth-source-backend
         source
         :source source
         :type 'plstore
         :search-function #'auth-source-plstore-search
         :create-function #'auth-source-plstore-create
         :data (plstore-open source)))
       ((member-ignore-case extension '("json"))
        (auth-source-backend
         source
         :source source
         :type 'json
         :search-function #'auth-source-json-search))
       (t
        (auth-source-backend
         source
         :source source
         :type 'netrc
         :search-function #'auth-source-netrc-search
         :create-function #'auth-source-netrc-create))))))