Function: denote--valid-file-type

denote--valid-file-type is a byte-compiled function defined in denote.el.

Signature

(denote--valid-file-type FILETYPE)

Documentation

Return a valid filetype symbol given the argument FILETYPE.

If none is found, the first element of denote-file-types is returned.

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
(defun denote--valid-file-type (filetype)
  "Return a valid filetype symbol given the argument FILETYPE.
If none is found, the first element of `denote-file-types' is
returned."
  (let ((type (cond
               ((stringp filetype) (intern filetype))
               ((symbolp filetype) filetype)
               (t (error "The `%s' is neither a string nor a symbol" filetype)))))
    (cond
     ((memq type (denote--file-type-keys))
      type)
     ((null denote-file-types)
      (user-error "At least one file type must be defined in `denote-file-types' to create a note"))
     (t
      (caar denote-file-types)))))