From d208502e4c83b2509be84f334f4d3bc11aecbf7c Mon Sep 17 00:00:00 2001 From: Stephen Gildea Date: Thu, 16 Oct 2025 15:22:36 -0700 Subject: [PATCH] time-stamp: padding composed characters * lisp/time-stamp.el (time-stamp-string-preprocess): Use 'string-width' instead of 'length' to calculate needed padding. Thanks to Stefan Monnier for the suggestion. --- lisp/time-stamp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 1280c86bcbe..2a6079a9fa2 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -779,7 +779,8 @@ and all `time-stamp-format' compatibility." (format (format "%%%sd" field-width) (or field-result ""))) (let* ((field-width-num (string-to-number field-width)) - (needed-padding (- field-width-num (length field-result)))) + (needed-padding (- field-width-num + (string-width (or field-result ""))))) (if (> needed-padding 0) (concat (make-string needed-padding ?\s) field-result) field-result)))