diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-04-13 18:11:12 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-04-13 18:11:12 +0100 |
commit | 517c123fd4b250b570ce6f47ead4c14eac41ab8c (patch) | |
tree | 02c07ba354f68d54953e230e11d0369af7118ec8 /lisp/emacs-lisp | |
parent | 97873235523dd6fc236b3ebc7bf34a53fb5a528a (diff) | |
parent | cdbb37f628aad1455af349d703c5838827bea8b3 (diff) | |
download | emacs-517c123fd4b250b570ce6f47ead4c14eac41ab8c.tar.gz emacs-517c123fd4b250b570ce6f47ead4c14eac41ab8c.tar.bz2 emacs-517c123fd4b250b570ce6f47ead4c14eac41ab8c.zip |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/subr-x.el | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 45a308ebcac..bb10194a946 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -3118,7 +3118,7 @@ slots skipped by :initial-offset may appear in the list." descs))) (nreverse descs))) -(define-error 'cl-struct-unknown-slot "struct %S has no slot %S") +(define-error 'cl-struct-unknown-slot "struct has no slot") (defun cl-struct-slot-offset (struct-type slot-name) "Return the offset of slot SLOT-NAME in STRUCT-TYPE. diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 044c9aada0d..9f96ac50d1c 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -236,6 +236,15 @@ REGEXP defaults to \"[ \\t\\n\\r]+\"." TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"." (string-trim-left (string-trim-right string trim-right) trim-left)) +;;;###autoload +(defun string-truncate-left (string length) + "Truncate STRING to LENGTH, replacing initial surplus with \"...\"." + (let ((strlen (length string))) + (if (<= strlen length) + string + (setq length (max 0 (- length 3))) + (concat "..." (substring string (max 0 (- strlen 1 length))))))) + (defsubst string-blank-p (string) "Check whether STRING is either empty or only whitespace. The following characters count as whitespace here: space, tab, newline and |