I'm experimenting with note formats that put the title somewhere other than in the first line
deft-parse-title calls the customizable deft-parse-title-function which defaults to deft-strip-title, but
deft-parse-title-function is only passed the first line of the note in question.
I have some code (PR coming soon) that creates zetteldeft--title-parsing-functionzetteldeft-title-parsing-function. It defaults to deft-parse-title but it lets you replace it with a function that looks like this:
(defun my-title-parsing-function (file contents)
(let ((title (hypothetical-code-that-uses file contents)))
(if title
title
;; still need a fallback -- I have a lot of notes in older formats
(deft-parse-title file contents))))
Background:
deft-parse-title
calls the customizabledeft-parse-title-function
which defaults todeft-strip-title
, butdeft-parse-title-function
is only passed the first line of the note in question.I have some code (PR coming soon) that creates
zetteldeft--title-parsing-function
zetteldeft-title-parsing-function
. It defaults todeft-parse-title
but it lets you replace it with a function that looks like this: