   :safe 'stringp
   :group 'zk)
 
+(defcustom zk-parse-title-function 'zk-strip-title
+  "Function for post-processing file titles."
+  :type 'function
+  :group 'zk)
+
+(defcustom zk-strip-title-regexp
+  (concat "\\(?:"
+          "^%+" ; line beg with %
+          "\\|^#\\+TITLE: *" ; org-mode title
+          "\\|^[#* ]+" ; line beg with #, * and/or space
+          "\\|-\\*-[[:alpha:]]+-\\*-" ; -*- .. -*- lines
+          "\\|^Title:[\t ]*" ; MultiMarkdown metadata
+          "\\|#+" ; line with just # chars
+          "$\\)")
+  "Regular expression to remove from file titles.
+Presently, it removes leading LaTeX comment delimiters, leading
+and trailing hash marks from Markdown ATX headings, leading
+astersisks from Org Mode headings, and Emacs mode lines of the
+form -*-mode-*-."
+  :type 'regexp
+  :safe 'stringp
+  :group 'zk)
+
 (defcustom zk-strip-summary-regexp
   (concat "\\("
           "[\n\t]" ;; blank

  "Face for Zk filter string when regexp is invalid."
  :group 'zk-faces)

(defface zk-id-face
  '((t :inherit font-lock-function-name-face :bold t))
  "Face for Zk last modified times."
  :group 'zk-faces)

(defface zk-summary-face

  "Add a line to the file browser for the given FILE."
  (when file
    (let* ((id (zk-lift-id file))
           (title (zk-file-title file))
           (summary (or (zk-file-summary file) id))
           (mtime (when zk-time-format
                    (format-time-string zk-time-format (zk-file-mtime file))))
           (mtime-width (zk-string-width mtime))
           (line-width (- zk-window-width mtime-width))
           (title-width (min line-width (zk-string-width title)))
           (summary-width (min (zk-string-width summary)
                               (- line-width
                                  title-width
                                  (length zk-separator)))))
      (widget-create 'link
                     :button-prefix ""
                     :button-suffix ""
                     :button-face 'zk-title-face
                     :format "%[%v%]"
                     :tag file
                     :help-echo "Edit this file"
                     :notify (lambda (widget &rest ignore)
                               (zk-open-file (widget-get widget :tag)))
                     (if title (truncate-string-to-width title title-width)
                       zk-empty-file-title))
      (when (> summary-width 0)
        (widget-insert (propertize zk-separator 'face 'zk-separator-face))
        (widget-insert (propertize (truncate-string-to-width summary summary-width)
                                   'face 'zk-summary-face)))
      (when mtime
        (while (< (current-column) line-width)
          (widget-insert " "))
        (widget-insert (propertize mtime 'face 'zk-time-face)))
      (widget-insert "\n"))))

(defun zk-buffer-visible-p ()
