Merge remote-tracking branch 'savannah/master' into HEAD

This commit is contained in:
Andrea Corallo 2020-04-13 18:11:12 +01:00
commit 517c123fd4
21 changed files with 207 additions and 89 deletions

View file

@ -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.

View file

@ -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