Function: xdg-mime-apps-files

xdg-mime-apps-files is a byte-compiled function defined in xdg.el.gz.

Signature

(xdg-mime-apps-files)

Documentation

Return a list of files containing MIME/Desktop associations.

The list is in order of descending priority: user config, then admin config, and finally system cached associations.

Source Code

;; Defined in /usr/src/emacs/lisp/xdg.el.gz
(defun xdg-mime-apps-files ()
  "Return a list of files containing MIME/Desktop associations.
The list is in order of descending priority: user config, then
admin config, and finally system cached associations."
  (let ((xdg-data-dirs (xdg-data-dirs))
        (desktop (getenv "XDG_CURRENT_DESKTOP"))
        res)
    (when desktop
      (setq desktop (list (format "%s-mimeapps.list" desktop))))
    (dolist (name (cons "mimeapps.list" desktop))
      (push (expand-file-name name (xdg-config-home)) res)
      (push (expand-file-name (format "applications/%s" name) (xdg-data-home))
            res)
      (dolist (dir (xdg-config-dirs))
        (push (expand-file-name name dir) res))
      (dolist (dir xdg-data-dirs)
        (push (expand-file-name (format "applications/%s" name) dir) res)))
    (dolist (dir xdg-data-dirs)
      (push (expand-file-name "applications/mimeinfo.cache" dir) res))
    (nreverse res)))