diff options
Diffstat (limited to 'doc/lispref/strings.texi')
-rw-r--r-- | doc/lispref/strings.texi | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 326359e1da0..08e8e877a9f 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -816,9 +816,13 @@ if any. @end defun @defun format-message string &rest objects +@cindex curved quotes +@cindex curly quotes This function acts like @code{format}, except it also converts any -curved quotes in @var{string} as per the value of -@code{text-quoting-style}. @xref{Keys in Documentation}. +curved single quotes in @var{string} as per the value of +@code{text-quoting-style}, and treats grave accent (@t{`}) and +apostrophe (@t{'}) as if they were curved single quotes. @xref{Keys +in Documentation}. @end defun @cindex @samp{%} in format @@ -919,20 +923,23 @@ specification is unusual in that it does not use a value. For example, Any other format character results in an @samp{Invalid format operation} error. - Here are several examples: + Here are several examples, which assume the typical +@code{text-quoting-style} settings: @example @group -(format "The name of this buffer is %s." (buffer-name)) - @result{} "The name of this buffer is strings.texi." - -(format "The buffer object prints as %qs." (current-buffer)) - @result{} "The buffer object prints as ‘strings.texi’." - (format "The octal value of %d is %o, and the hex value is %x." 18 18 18) @result{} "The octal value of 18 is 22, and the hex value is 12." + +(format-message + "The name of this buffer is ‘%s’." (buffer-name)) + @result{} "The name of this buffer is ‘strings.texi’." + +(format-message + "The buffer object prints as `%s'." (current-buffer)) + @result{} "The buffer object prints as ‘strings.texi’." @end group @end example @@ -1001,20 +1008,13 @@ specifier, if any, to be inserted on the right rather than the left. If both @samp{-} and @samp{0} are present, the @samp{0} flag is ignored. -@cindex curved quotes -@cindex curly quotes - The flag @samp{q} quotes the printed representation as per the -variable @samp{text-quoting-style}. @xref{Keys in Documentation}. -Typically it uses curved single quotes @t{‘like this’} as in the -following example. - @example @group (format "%06d is padded on the left with zeros" 123) @result{} "000123 is padded on the left with zeros" -(format "%q-6d is padded on the right" 123) - @result{} "‘123 ’ is padded on the right" +(format "'%-6d' is padded on the right" 123) + @result{} "'123 ' is padded on the right" (format "The word '%-7s' actually has %d letters in it." "foo" (length "foo")) |