From 926e97701670ab316758da67c278077624b8fc88 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Thu, 29 Nov 2018 20:08:33 +0100 Subject: [PATCH] [Timeline] Try to keep point on deleted line --- site-lisp/timeline-tools.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/site-lisp/timeline-tools.el b/site-lisp/timeline-tools.el index e432887..5320424 100644 --- a/site-lisp/timeline-tools.el +++ b/site-lisp/timeline-tools.el @@ -556,7 +556,13 @@ Interactively query for the exact value of \"short\"." (setq-local timeline-tools--current-timeline (timeline-tools-transform-timeline (delq entry timeline-tools--current-timeline))))) - (timeline-tools-redraw-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 + (let ((linenum (line-number-at-pos (point)))) + (timeline-tools-redraw-timeline) + (goto-char (point-min)) + (forward-line (1- linenum)))) (defun timeline-tools-next-line () "Move point to next line in timetable, if possible."