Function: kfile:find

kfile:find is an autoloaded, interactive and byte-compiled function defined in kfile.el.

Signature

(kfile:find FILE-NAME)

Documentation

Find a file FILE-NAME containing a kotl or create one if none exists.

Return the new kview.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kfile.el
;;; ************************************************************************
;;; Entry Points
;;; ************************************************************************

;;;###autoload
(defun kfile:find (file-name)
  "Find a file FILE-NAME containing a kotl or create one if none exists.
Return the new kview."
  (interactive
   (list (kfile:read-name
	  "Find koutline file: " nil)))
  (let ((existing-file (file-exists-p file-name))
	buffer)
    (and existing-file
	 (not (file-readable-p file-name))
	 (error
	  "(kfile:find): \"%s\" is not readable.  Check permissions"
	  file-name))
    (setq buffer (find-file file-name))
    ;; Finding the file may have already done a kfile:read as invoked through
    ;; kotl-mode via a file local variable setting.  If so, don't read it
    ;; again.
    (unless (kview:is-p kotl-kview)
      (kfile:read buffer existing-file))
    (unless (derived-mode-p 'kotl-mode)
      (kotl-mode))
    kotl-kview))