diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-23 07:59:24 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-23 07:59:24 +0100 |
commit | 5c86a5329664cd5fd3b81fe991c8d7dc18815e07 (patch) | |
tree | c6b325408b6a6260c8eb9b673a468261de303467 /lisp/emacs-lisp/subr-x.el | |
parent | 22c1f00d997d38ba0c453da5f5e9c526d0ac05b0 (diff) | |
download | emacs-5c86a5329664cd5fd3b81fe991c8d7dc18815e07.tar.gz emacs-5c86a5329664cd5fd3b81fe991c8d7dc18815e07.tar.bz2 emacs-5c86a5329664cd5fd3b81fe991c8d7dc18815e07.zip |
Improve the string-limit doc string
* lisp/emacs-lisp/subr-x.el (string-limit): Mention
truncate-string-to-width in the doc string.
Diffstat (limited to 'lisp/emacs-lisp/subr-x.el')
-rw-r--r-- | lisp/emacs-lisp/subr-x.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 8a9424cbb3d..7e17a3464e6 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -293,7 +293,11 @@ is returned 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." +the last LENGTH characters instead. + +When shortening strings for display purposes, +`truncate-string-to-width' is almost always a better alternative +than this function." (unless (natnump length) (signal 'wrong-type-argument (list 'natnump length))) (cond |