summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/subr-x.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2021-10-30 04:07:09 -0400
committerEli Zaretskii <eliz@gnu.org>2021-10-30 04:07:09 -0400
commitc30f95078c0735447c0bf293f2e6f573bc7057a3 (patch)
treef65813ce8d88c5b55424b6c521bb418eeb4f72d9 /lisp/emacs-lisp/subr-x.el
parentc3499b8ddc357544a58917bfd3846f88caf5d97c (diff)
parent20ebd91a734c3241ca3a9ce15ba81f7357401576 (diff)
downloademacs-c30f95078c0735447c0bf293f2e6f573bc7057a3.tar.gz
Merge from origin/emacs-28
20ebd91a73 Improve documentation of string truncation APIs 3f998a3fc8 * lisp/textmodes/css-mode.el: Fix typo. (Bug#51488)
Diffstat (limited to 'lisp/emacs-lisp/subr-x.el')
-rw-r--r--lisp/emacs-lisp/subr-x.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 00668d47439..9a82fe2449d 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -266,13 +266,13 @@ result will have lines that are longer than LENGTH."
(buffer-string)))
(defun string-limit (string length &optional end coding-system)
- "Return (up to) a LENGTH substring of STRING.
-If STRING is shorter than or equal to LENGTH, the entire string
-is returned unchanged.
+ "Return a substring of STRING that is (up to) LENGTH characters long.
+If STRING is shorter than or equal to LENGTH characters, return the
+entire string unchanged.
-If STRING is longer than LENGTH, return a substring consisting of
-the first LENGTH characters of STRING. If END is non-nil, return
-the last LENGTH characters instead.
+If STRING is longer than LENGTH characters, return a substring
+consisting of the first LENGTH characters of STRING. If END is
+non-nil, return the last LENGTH characters instead.
If CODING-SYSTEM is non-nil, STRING will be encoded before
limiting, and LENGTH is interpreted as the number of bytes to