mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
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.
This commit is contained in:
parent
888a910bc9
commit
d208502e4c
1 changed files with 2 additions and 1 deletions
|
|
@ -779,7 +779,8 @@ and all `time-stamp-format' compatibility."
|
||||||
(format (format "%%%sd" field-width)
|
(format (format "%%%sd" field-width)
|
||||||
(or field-result "")))
|
(or field-result "")))
|
||||||
(let* ((field-width-num (string-to-number field-width))
|
(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)
|
(if (> needed-padding 0)
|
||||||
(concat (make-string needed-padding ?\s) field-result)
|
(concat (make-string needed-padding ?\s) field-result)
|
||||||
field-result)))
|
field-result)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue