Commit graph

428 commits

Author SHA1 Message Date
Adam Porter
3563d9447d Change/Fix: (ement-room-mode) Disable use of window-scroll-functions
Disabling this because of some weird behavior.  It seems like a race
condition exists in which the window-scroll-functions are called,
causing the read receipt to get sent, followed by the read-receipt
being updated, causing the window-scroll-functions to be called again
before the updated receipt is displayed in the buffer, which can cause
an infinite loop, which can even exhaust the Lisp stack and cause
Emacs to freeze (without 100% CPU usage).  At least, that's the best
explanation I have so far--it's very weird.  Until it's solved, we'll
have to do without sending read receipts.  Maybe
window-scroll-functions isn't suitable for this, even though it seems
ideal in theory.  Maybe instead we should use a simple idle timer that
iterates over windows, or something like that.
2022-09-11 14:31:55 -05:00
Adam Porter
f7cd7a857b Fix: (ement-room-start-read-receipt-timer) Temporarily disable
A bug was introduced in the previous fixes that can cause excessive
read receipts to be sent in rapid succession.  A more thoughtful fix
will be necessary to properly send only one receipt per room event and
per scroll event.  In the meantime, this must be disabled to prevent
the excessive network requests.
2022-09-11 09:50:14 -05:00
Adam Porter
35ea510bbf Fix: (ement-room-read-receipt-timer) Use window-live-p
This may fix a weird bug introduced in the last commit or
two (involving variable-binding-depth errors, timers running
repeatedly and making Emacs unresponsive, etc--I have no idea how the
changes could have caused such a thing, but they apparently did).
2022-09-09 16:34:19 -05:00
Adam Porter
b07b7c0da1 Change/Fix: (ement-room-read-receipt-timer) When read receipt is unseen
- Move function called by timer to a named function.

- Send read receipt even if its position is outside the range of
retrieved events.  Otherwise, it could be so far back that it never
gets updated, which doesn't seem useful.  The fully-read marker
remains unmoved until the user gets to the end of the room's events
and marks them all as read, which seems right and useful.
2022-09-09 16:03:58 -05:00
Adam Porter
0d71dfbe6f Fix: (ement-room-start-read-receipt-timer) Set timer in variable 2022-09-09 15:17:52 -05:00
Visuwesh
09ad959a09 Fix: (ement-room-sync) Correct argument order 2022-09-09 12:10:58 -05:00
Adam Porter
4da836b6e8 Tidy: Docstring 2022-09-08 09:58:36 -05:00
Adam Porter
43ab8f2e09 Fix: (ement-room-scroll-up-mark-read) Select correct room window 2022-09-08 09:55:52 -05:00
Adam Porter
fcbf1a55e8 Release: 0.1 2022-09-02 07:44:17 -05:00
Adam Porter
d1fceb149e Tidy: Docstrings, comment 2022-09-01 23:10:28 -05:00
Adam Porter
d36f70671c Change: (ement-room-sync) Also update room list buffers 2022-09-01 03:49:48 -05:00
Adam Porter
4ec2107e6a Change: (ement-room-retro) More idiomatic prefix usage, message 2022-09-01 02:58:19 -05:00
Adam Porter
f361abebc1 Add: (ement-view-room-display-buffer-action) etc.
i.e. (ement-auto-view-room-display-buffer-action), and use
in (ement-room-view).
2022-09-01 02:40:09 -05:00
Adam Porter
c3a56284b5 Fix: (ement-room--format-reactions) Composed Unicode variations 2022-08-05 15:48:08 -05:00
Adam Porter
df2110da6f Fix: (ement-room--buffer) Sender headers
Oops, they were being inserted unconditionally in new room buffers.
2022-08-05 13:32:53 -05:00
Adam Porter
4fef240e85 Comment: Add FIXME 2022-07-29 13:29:01 -05:00
Adam Porter
95dcf9d56e Fix: (ement-room--insert-sender-headers) Use ewoc-prev
This should be correct, and omitting it must have been an oversight...
2022-07-28 21:08:58 -05:00
Adam Porter
cbdba7b234 Fix: "kicked and banned" event coalescing 2022-07-28 21:08:09 -05:00
Adam Porter
481f571a2f Change/Fix: Improve "Elemental" display format
This still isn't quite perfect, but it seems to be about 99% so, and a
significant improvement.
2022-07-21 10:38:06 -05:00
Adam Porter
aaba533c95 Fix: (ement-room) browse-url-handlers in Emacs < 28.1
Thanks to @gearoid1:matrix.org for reporting.
2022-07-19 08:09:37 -05:00
Adam Porter
fd46ea2b8b Change/Fix: Highlight "@room" mentions 2022-07-18 12:52:20 -05:00
Adam Porter
919991acef Tidy: Compilation warning 2022-07-18 12:50:16 -05:00
Adam Porter
c54c86b4ff Add: Queue image downloads 2022-07-15 15:13:59 -05:00
Adam Porter
5c02bc0876 Fix: (ement-room--buffer) Header for encrypted rooms
Need to check both state and invite-state.
2022-07-15 13:38:06 -05:00
Adam Porter
0eec00733b Fix: (ement-room--format-message)
Fixes #81 (which only happens on an unreleased Emacs version).  Thanks
to Tassilo Horn (@tsdh) for reporting and debugging.
2022-07-13 10:05:55 -05:00
Adam Porter
5e66aa244d Tidy: (ement-room--format-message)
Also improve error message.
2022-07-13 09:06:28 -05:00
Adam Porter
4b7d925bab Fix: (ement-room--format-member-event) Events with empty displayname 2022-07-13 08:15:46 -05:00
Adam Porter
b0580a964d Tidy: (ement-room--format-member-event)
Lispy sometimes makes this unnecessary change.
2022-07-13 08:15:05 -05:00
Adam Porter
acdb429c2c Comment: Update FIXME 2022-07-11 08:53:32 -05:00
Adam Porter
02015eacf6 Change: (ement-room-avatars) Default to value from display-images-p
Thanks to Tassilo Horn (@tsdh) for suggesting.
2022-07-10 07:45:42 -05:00
Adam Porter
2b4ee52e67 Change: Make membership event type bold
Makes each type of event easier to find in long lists of membership
events.
2022-07-06 10:53:03 -05:00
Adam Porter
918d1d9d43 Fix: (ement-room-flush-colors) Don't refresh notification buffer 2022-07-02 11:26:01 -05:00
Visuwesh
1a97b597dc Add: Upload file by dragging them
* ement-room.el (ement-room-dnd-upload-file): Add.
(ement-room-mode): Register dnd function to upload file when dragging
them to an Emacs frame.
2022-07-01 03:25:40 -05:00
Adam Porter
5d03a7dd70 Improve: %W formatting 2022-06-30 11:28:41 -05:00
Adam Porter
6f9bd70b79 Add: %W wrap-prefix message formatter
And use it in ement-notify, etc.  This seems to strike a nice balance
between readability and efficient use of space, especially in the
notifications buffer.
2022-06-30 11:07:43 -05:00
Adam Porter
a5c96bd682 Change: (ement-notify--room-background-color) Improve, cache
Also update (ement-room-flush-colors) to flush these cached colors.
2022-06-27 16:29:39 -05:00
Adam Porter
cef83470b6 Change: (ement-notify) Derived mode for notifications buffer 2022-06-27 03:01:11 -05:00
Adam Porter
2253e97753 Fix: (ement-room--m.image-callback) Workaround rare bug
I'm not sure what can cause this.  While I've heard a couple of
reports from users, this is the first time it's happened to me.  It
might be caused by an earlier error interrupting sync processing,
leaving a room data or buffer in an inconsistent state.  Anyway, this
should prevent it from being a problem, while still leaving a way to
potentially learn the cause so it can be truly solved.
2022-06-27 01:01:30 -05:00
Adam Porter
a5ea0827d3 Change: Remove ts dependency
...since ts is not (yet?) in ELPA, which would prevent Ement from
going into it.  Also, this should be slightly more efficient, since we
won't allocate ts structs for these calculations.
2022-06-23 02:08:17 -05:00
Adam Porter
84ac8f9130 Fix: (ement-room--format-member-event) For unset displayname
When the user unsets displayname, we use the calculated one.
2022-06-22 21:05:30 -05:00
Adam Porter
53384f20ff Comment: Add TODO 2022-06-16 23:55:47 -05:00
Adam Porter
f2084e8459 Change: (defface ement-room-mention) :inherit hl-line
This should be a better default, because :inverse-video is too much.
2022-06-15 12:17:56 -05:00
Adam Porter
2fadb3ed22 Fix: (ement-room--event-body-face) Lighten/darken depending on theme 2022-06-15 12:01:10 -05:00
Adam Porter
ec68977299 Add: (ement-room-flush-colors) 2022-06-01 12:15:29 -05:00
Adam Porter
306c1ecfb0 Tidy: Move --format-user and --prism-color into -lib 2022-05-30 06:14:28 -05:00
Adam Porter
41318e2969 Add: (ement-room-describe) 2022-05-30 06:14:28 -05:00
Adam Porter
039c548fd3 Change: (ement-room--format-user) Add session argument
Needed to compare given user with local user.
2022-05-30 05:53:32 -05:00
Adam Porter
5b101206ca Change: (ement-prism-color) Arguments
This change isn't yet visible, but it makes more sense and is more
flexible.  Also, the TODO is a good idea.
2022-05-30 04:01:12 -05:00
Adam Porter
529cca4d61 Change: Move per-room displaynames into room struct
This avoids circular data structures (I think this is the only case of
it), which should prevent the infinite-loop/out-of-memory situations
when Emacs prints one in an error or backtrace and print-circle is
nil.

Fixes #41.
2022-05-29 10:47:39 -05:00
Adam Porter
fd96491e82 Fix: (ement-room-goto-event) 2022-05-20 16:18:48 -05:00