[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/sqlite e2ae6d3: Keep point after reverting

From: Lars Ingebrigtsen
Subject: scratch/sqlite e2ae6d3: Keep point after reverting
Date: Tue, 14 Dec 2021 21:39:35 -0500 (EST)

branch: scratch/sqlite
commit e2ae6d35f730bc8d1b938801570444590b29c71d
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Keep point after reverting
 lisp/emacs-lisp/multisession.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/multisession.el b/lisp/emacs-lisp/multisession.el
index 3df20d9..e2ad261 100644
--- a/lisp/emacs-lisp/multisession.el
+++ b/lisp/emacs-lisp/multisession.el
@@ -367,7 +367,8 @@ storage method to list."
     (goto-char (point-min))))
 (defun multisession-edit-mode--revert (&rest _)
-  (let ((inhibit-read-only t))
+  (let ((inhibit-read-only t)
+        (id (get-text-property (point) 'tabulated-list-id)))
     (setq tabulated-list-entries
@@ -377,7 +378,12 @@ storage method to list."
                      (vector (car elem) (cadr elem)
                              (format "%s" (caddr elem)))))
                   (multisession--backend-values multisession-storage)))
-    (tabulated-list-print t)))
+    (tabulated-list-print t)
+    (goto-char (point-min))
+    (when id
+      (when-let ((match
+                  (text-property-search-forward 'tabulated-list-id id t)))
+        (goto-char (prop-match-beginning match))))))
 (defun multisession-delete-value (id)
   "Delete the value at point."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]