       (setq-local timeline-tools--current-time-start (org-time-string-to-seconds tstart))
       (setq-local timeline-tools--current-time-end (org-time-string-to-seconds tend))
       (setq-local timeline-tools--current-files files)
-      (setq-local timeline-tools--current-timeline nil)
       (setq-local timeline-tools-time-format timeline-tools-time-format)
       (setq-local timeline-tools-headline-time-format timeline-tools-headline-time-format)
       (hl-line-mode)
+      (buffer-enable-undo)
       (timeline-tools-redraw-timeline 'force))
     (pop-to-buffer target-buffer)
     t))

    (let ((entry (get-text-property (point) 'entry)))
      (unless entry
        (user-error "Not on valid row in timeline"))
      (unless (< 1 (length timeline-tools--current-timeline))
        (user-error "Cannot delete last line"))
      (setq-local timeline-tools--current-timeline
                  (timeline-tools-transform-timeline
                   (delq entry timeline-tools--current-timeline)))))
  ;; the call to `erase-buffer’ in `timeline-tools-redraw-timeline’ somehow
  ;; makes `save-mark-and-excursion’ meaningless; thus we save the number of the
  ;; current line by ourselves


(defvar timeline-tools--current-files nil
  "Files from which the current timeline has been extracted.")

(defvar timeline-tools-mode-map
  (let ((map (make-sparse-keymap)))
