[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive 087bcf1a85 5/6: Change: (hyperdrive-handler-def
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive 087bcf1a85 5/6: Change: (hyperdrive-handler-default) Restore point on revert-buffer |
Date: |
Wed, 20 Sep 2023 00:59:40 -0400 (EDT) |
branch: elpa/hyperdrive
commit 087bcf1a8505670d6923de1634394d1cad39c933
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Change: (hyperdrive-handler-default) Restore point on revert-buffer
If no buffer was previously visiting the file, then old-point will be 0.
---
hyperdrive-lib.el | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 0ff4e565cb..a982ce7bf1 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1150,14 +1150,15 @@ If then, then call THEN with no arguments. Default
handler."
;; same page (but ensure that reverting still works).
(if (buffer-modified-p)
(hyperdrive-message "Buffer modified: %S" (current-buffer))
- (with-silent-modifications
- (erase-buffer)
- (insert-buffer-substring response-buffer))
- (setf buffer-undo-list nil
- buffer-read-only (or (not (hyperdrive-writablep
hyperdrive)) version))
- (set-buffer-modified-p nil)
- (set-visited-file-modtime (current-time))
- (goto-char (point-min)))
+ (let ((old-point (point)))
+ (with-silent-modifications
+ (erase-buffer)
+ (insert-buffer-substring response-buffer))
+ (setf buffer-undo-list nil
+ buffer-read-only (or (not (hyperdrive-writablep
hyperdrive)) version))
+ (set-buffer-modified-p nil)
+ (set-visited-file-modtime (current-time))
+ (goto-char old-point)))
;; TODO: Option to defer showing buffer.
;; It seems that `pop-to-buffer' is moving point, even
;; though it shouldn't, so we call it here, before going
- [nongnu] elpa/hyperdrive updated (15067d034e -> 8ced2e72ff), ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 1f990eb160 2/6: Fix: (hyperdrive-handler-html) Docstring, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive ef82d846ff 1/6: Tidy: (hyperdrive-fill) Remove unused binding, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 087bcf1a85 5/6: Change: (hyperdrive-handler-default) Restore point on revert-buffer,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive 7223d2e1a2 3/6: Comment: Remove old TODO, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive b239b3b7e9 4/6: Comment: Remove old TODO, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 8ced2e72ff 6/6: Fix: (hyperdrive-write-buffer) Fix updating version history on write, ELPA Syncer, 2023/09/20