[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ement d893fbc2bf 2/2: Fix: (ement-room-bookmark-handler
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ement d893fbc2bf 2/2: Fix: (ement-room-bookmark-handler) Jump to end of room buffer |
Date: |
Wed, 22 Feb 2023 00:57:46 -0500 (EST) |
branch: externals/ement
commit d893fbc2bf171ac1527e9cfe983ce6d9cae68672
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Fix: (ement-room-bookmark-handler) Jump to end of room buffer
This was unusually difficult, but this elegant hack works!
---
ement-room.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/ement-room.el b/ement-room.el
index 49cc82517b..02647f9046 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -999,11 +999,15 @@ Note that, if ROOM has no buffer, STRING is returned
unchanged."
(ement-afirst (equal room-id (ement-room-id it))
(ement-session-rooms session))
(cl-assert it nil "Room %S not found on session %S"
room-id session-id))))
- ;; TODO: Put point at the end of the room buffer. However, this doesn't
seem easy or
- ;; even possible, possibly because the bookmark library itself moves point
after this
- ;; function returns. My attempts at setting the buffer's and window's
points after
- ;; calling `ement-view-room' have had no effect.
- (ement-view-room room session)))
+ (ement-view-room room session)
+ ;; HACK: Put point at the end of the room buffer. This seems unusually
difficult,
+ ;; apparently because the bookmark library itself moves point after
jumping to a
+ ;; bookmark. My attempts at setting the buffer's and window's points
after calling
+ ;; `ement-view-room' have had no effect. `bookmark-after-jump-hook'
sounds ideal, but
+ ;; it does not seem to actually get run, so we use a timer that runs
immediately after
+ ;; `bookmark-jump' returns.
+ (run-at-time nil nil (lambda ()
+ (goto-char (point-max))))))
;;;; Commands