emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ement f7372fbc24 2/4: Add/Change: (ement-room-timestamp


From: ELPA Syncer
Subject: [elpa] externals/ement f7372fbc24 2/4: Add/Change: (ement-room-timestamp-header-imenu-format) And use
Date: Fri, 23 Sep 2022 18:57:36 -0400 (EDT)

branch: externals/ement
commit f7372fbc244fdf59b244eb96c05f5850b72965b6
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Add/Change: (ement-room-timestamp-header-imenu-format) And use
    
    This is more correct, and makes way for future improvements to
    timestamp headers.
---
 ement-room.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ement-room.el b/ement-room.el
index cd593078f0..5fcd4ab3f3 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -2041,18 +2041,20 @@ Needed to display things in the header line."
 
 ;;;;; Imenu
 
+(defconst ement-room-timestamp-header-imenu-format "%Y-%m-%d (%A) %H:%M"
+  "Format string for timestamps in Imenu indexes.")
+
 (defun ement-room--imenu-create-index-function ()
   "Return Imenu index for the current buffer.
 For use as `imenu-create-index-function'."
   (let ((timestamp-nodes (ement-room--ewoc-collect-nodes
                           ement-ewoc (lambda (node)
                                        (pcase (ewoc-data node)
-                                         (`(ts . ,_) t)))))
-        (timestamp-format (string-trim 
ement-room-timestamp-header-with-date-format)))
+                                         (`(ts . ,_) t))))))
     (cl-loop for node in timestamp-nodes
              collect (pcase-let*
                          ((`(ts ,timestamp) (ewoc-data node))
-                          (formatted (format-time-string timestamp-format 
timestamp)))
+                          (formatted (format-time-string 
ement-room-timestamp-header-imenu-format timestamp)))
                        (cons formatted (ewoc-location node))))))
 
 ;;;;; Occur



reply via email to

[Prev in Thread] Current Thread [Next in Thread]