If `jabber-last-read-marker' is non-nil, a marker will be printed whenever a
message comes in and the buffer
- is not currently focused
- was focused when the previous message was printed
This is a proof-of-concept; it could definitely be improved.
For example, users might want to hook `jabber-chat-update-focus' into
`window-configuration-change-hook' or something similar. Maybe jabber.el needs
a minor mode?
Anyway input and edits are more than welcome here.
The subr.el version of ‘dolist’ and ‘dotimes‘ do not provide
a (cl-block nil ...) form to which cl-return can throw. So,
function calls like:
(jabber-activity-common-prefix
"#calyxos#matrix.org" "#calyxos-offtopic#matrix.org")
will error with the likes of:
(no-catch --cl-block-nil-- 8)
Frustratingly enough, if ‘jabber-activity-make-string’ is set to
‘jabber-activity-make-strings-shorten’, this error occurs as part of
redisplay.
Moreover, the ’cl library defines macros for ‘dolist’ and ’dotimes’
that do wrap the loop body in a nil ‘cl-block’. So the above error
only arises in configurations where ’cl is never loaded, or is loaded
after ‘jabber’.
There are several invocations of ’cl-return’ in a ’dolist’ or
’dotimes’ form. And one invocation (in ‘jabber-xml-path’) that seems
to have already been patched with an explicit ’cl-block’.
This patch ensures that ‘cl-return’ is always invoked within a
’cl-loop like form. It normalizes ‘jabber-xml-path’ so that it uses
cl-dolist to make it consistent with the rest of the file.
This patch hides or applies a face to MUC presence notifications in
the MUC chat buffer. To control its behavior, customize
’jabber-muc-decorate-presence-patterns’. By default it does nothing.
’jabber-muc-decorate-presence-patterns’ is a list of pairs consisting
of a regular expression and a either a face or ‘nil’. If a the
regular expression matches a presence notification, then either:
- the specified face is applied to the notification message
- or if the second value of the pair is nil, the notification is
discarded
If no regular expression in the list of pairs matches the notification
message, the message is displayed unchanged.
For example, the customization:
'(jabber-muc-decorate-presence-patterns
'(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$")
("." . jabber-muc-presence-dim)))
hides participant enter/leave notifications. It also diminishes other
presence notification messages to make it easier to distinguish
between conversation and notifications.
It was not using the jabber-roster-sort-functions properly: it didn't stop
at the first ordering result (first a < b as true). Now it execute until one
of the sorting criteria returns a < b or b > a.