]> git.eshelyaron.com Git - emacs.git/commitdiff
Clarify description of format-spec truncation
authorBasil L. Contovounesios <basil@contovou.net>
Sun, 17 Mar 2024 12:04:32 +0000 (13:04 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 24 Mar 2024 14:14:56 +0000 (15:14 +0100)
* doc/lispref/strings.texi (Custom Format Strings): Mention that
precision specifier affects both '<' and '>' truncation (bug#69822).
* lisp/format-spec.el (format-spec, format-spec--do-flags): Use same
terminology as 'format', especially when referring to its behavior.

(cherry picked from commit 689f04a2ddfae856153bed762cc1461d66ec88de)

doc/lispref/strings.texi
lisp/format-spec.el

index 4fe94f78cba68e45a48e548b73b2ecc6d82b6782..a2285098aad987baa25cf8e0051e39a891de494e 100644 (file)
@@ -1369,7 +1369,7 @@ given width and precision, if specified.
 
 @item >
 This flag causes the substitution to be truncated on the right to the
-given width, if specified.
+given width and precision, if specified.
 
 @item ^
 This flag converts the substituted text to upper case (@pxref{Case
index cf34017b9943b48fb7042c885daa912e3217d85a..73f9fccd79308e752083e2f5307aa49be505eb32 100644 (file)
@@ -38,7 +38,7 @@ For instance:
                  (?l . \"ls\")))
 
 Each %-spec may contain optional flag, width, and precision
-modifiers, as follows:
+specifiers, as follows:
 
   %<flags><width><precision>character
 
@@ -51,7 +51,7 @@ The following flags are allowed:
 * ^: Convert to upper case.
 * _: Convert to lower case.
 
-The width and truncation modifiers behave like the corresponding
+The width and precision specifiers behave like the corresponding
 ones in `format' when applied to %s.
 
 For example, \"%<010b\" means \"substitute into the output the
@@ -145,7 +145,7 @@ is returned, where each format spec is its own element."
   "Return STR formatted according to FLAGS, WIDTH, and TRUNC.
 FLAGS is a list of keywords as returned by
 `format-spec--parse-flags'.  WIDTH and TRUNC are either nil or
-string widths corresponding to `format-spec' modifiers."
+string widths corresponding to `format-spec' specifiers."
   (let (diff str-width)
     ;; Truncate original string first, like `format' does.
     (when trunc