aboutsummaryrefslogtreecommitdiffstats
path: root/public_transport
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2024-06-28 10:47:03 +0200
committerOscar Najera <hi@oscarnajera.com>2024-06-28 10:47:03 +0200
commit2b156c210a42631678a5798ceeb84eb382d33b21 (patch)
tree08128f203c8735dce4c2bd8855ae5503e07b149e /public_transport
parent850d7f66ae0a042114a4fbac27e16bbf96f0a275 (diff)
downloadscratch-simpler.tar.gz
scratch-simpler.tar.bz2
scratch-simpler.zip
Include train platform infosimpler
Diffstat (limited to 'public_transport')
-rw-r--r--public_transport/db-schedules.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/public_transport/db-schedules.el b/public_transport/db-schedules.el
index a8f8b4b..6446c51 100644
--- a/public_transport/db-schedules.el
+++ b/public_transport/db-schedules.el
@@ -69,11 +69,11 @@
(defun db-schedules--prepare-row (row)
"Return tabulated entry vector for ROW."
- (-let* (((&hash "stop" "when" "plannedWhen" "delay" "direction" "line") row)
+ (-let* (((&hash "stop" "when" "plannedWhen" "delay" "platform" "direction" "line") row)
((&hash "name") stop)
((&hash "name" line-name) line)
extra)
- (when (integerp delay)
+ (when (and (integerp delay) (cl-plusp delay))
(thread-first
(format "Planned: %s" (db-schedules--time plannedWhen))
(propertize 'face 'font-lock-comment-face)
@@ -82,11 +82,18 @@
(format "Delayed: %s" (seconds-to-string delay))
(propertize 'face 'font-lock-keyword-face)
(push extra)))
+ (unless (eq :null platform)
+ (push (thread-last
+ (propertize platform 'face 'font-lock-variable-name-face)
+ (format "Platform: %s"))
+ extra))
(vector name
(thread-first
(if (eq when :null) plannedWhen when)
(db-schedules--time)
- (propertize 'face (if (integerp delay) 'font-lock-keyword-face 'font-lock-doc-face)))
+ (propertize 'face (if (and (integerp delay) (cl-plusp delay))
+ 'font-lock-keyword-face
+ 'font-lock-doc-face)))
(thread-first
(propertize line-name 'face 'font-lock-string-face)
(list direction)
@@ -104,9 +111,9 @@
(seq-map-indexed (lambda (row idx) (list idx row)) rows))
(setq tabulated-list-format
[("Stop" 25 nil)
- ("time" 10 nil )
- ("direction" 38 nil)
- ("extra" 25 nil)])
+ ("Time" 10 nil )
+ ("Direction" 38 nil)
+ ("Info" 25 nil)])
(tabulated-list-init-header)
(tabulated-list-print t)
(display-buffer (current-buffer)) )))