[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ement cc1750de11 3/4: Change: (timestamp headers) Remov
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ement cc1750de11 3/4: Change: (timestamp headers) Remove H:M from date-only, insert separately |
Date: |
Fri, 23 Sep 2022 18:57:36 -0400 (EDT) |
branch: externals/ement
commit cc1750de113a12930e94c1f0cd0b7923e9a0299a
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Change: (timestamp headers) Remove H:M from date-only, insert separately
Remove the hour and minute from date headers, and add time-only header
below them. This is simpler, and it avoids having to recreate date
headers when retrieving older messages and pushing back the time which
a date header would have.
---
README.org | 3 +++
ement-room.el | 8 +++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/README.org b/README.org
index f6d727e362..fa4813c671 100644
--- a/README.org
+++ b/README.org
@@ -295,6 +295,9 @@ Note that, while ~matrix-client~ remains usable, and
probably will for some time
+ Command ~ement-leave-room~ accepts a ~FORCE-P~ argument (interactively, with
prefix) to leave a room without prompting.
+ Command ~ement-forget-room~ accepts a ~FORCE-P~ argument (interactively,
with prefix) to also leave the room, and to forget it without prompting.
+*Changes*
++ Minor improvements to date/time headers.
+
*Fixes*
+ Command ~ement-describe-room~ for rooms without topics.
diff --git a/ement-room.el b/ement-room.el
index 5fcd4ab3f3..7ced075ae4 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -474,13 +474,13 @@ line."
(const :tag "Always show date" " %Y-%m-%d %H:%M ")
string))
-(defcustom ement-room-timestamp-header-with-date-format " %Y-%m-%d (%A)
%H:%M\n"
+(defcustom ement-room-timestamp-header-with-date-format " %Y-%m-%d (%A)\n"
;; FIXME: In Emacs 27+, maybe use :extend t instead of adding a newline.
"Format string for timestamp headers where date changes.
See function `format-time-string'. If this string ends in a
newline, its background color will extend to the end of the
line."
- :type '(choice (const " %Y-%m-%d (%A) %H:%M\n")
+ :type '(choice (const " %Y-%m-%d (%A)\n")
string))
(defcustom ement-room-replace-edited-messages t
@@ -2688,7 +2688,9 @@ the first and last nodes in the buffer, respectively."
((or 'ement-room-read-receipt-marker
'ement-room-fully-read-marker) t)))))
(unless (equal (time-to-days a-ts) (time-to-days b-ts))
;; Different date: bind format to print date.
- (setf ement-room-timestamp-header-format
ement-room-timestamp-header-with-date-format))
+ (let ((ement-room-timestamp-header-format
ement-room-timestamp-header-with-date-format))
+ ;; Insert the date-only header.
+ (setf node-a (ewoc-enter-after ewoc node-a (list 'ts b-ts)))))
(with-silent-modifications
;; Avoid marking a buffer as modified just because we inserted a ts
;; header (this function may be called after other events which
shouldn't