[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 4bd1226048 59/84: Rewrite take to copy only as m
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 4bd1226048 59/84: Rewrite take to copy only as much as required |
Date: |
Tue, 3 Jan 2023 08:57:36 -0500 (EST) |
branch: externals/compat
commit 4bd12260483fde4e8d06d12e2986befb302fad44
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Rewrite take to copy only as much as required
---
compat-29.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/compat-29.el b/compat-29.el
index a492fe1001..64aa3a78d7 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -106,7 +106,11 @@ Otherwise, return LIST after truncating it."
"Return the first N elements of LIST.
If N is zero or negative, return nil.
If N is greater or equal to the length of LIST, return LIST (or a copy)."
- (compat--ntake-elisp n (copy-sequence list))) ;FIXME: only copy as much
as necessary
+ (let (copy)
+ (while (and (< 0 n) list)
+ (push (pop list) copy)
+ (setq n (1- n)))
+ (nreverse copy)))
(compat-defun string-equal-ignore-case (string1 string2)
"Like `string-equal', but case-insensitive.
- [elpa] externals/compat 4a56adbcdf 42/84: Remove references to the deleted "Emacs 24.5" node, (continued)
- [elpa] externals/compat 4a56adbcdf 42/84: Remove references to the deleted "Emacs 24.5" node, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 0c14c42bc1 50/84: Copy edebug specifications instead of referencing, ELPA Syncer, 2023/01/03
- [elpa] externals/compat b888c2fb49 53/84: Replace when-let with expansions in compat-29, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 59cd42a912 60/84: Generate test names without double-dashes, ELPA Syncer, 2023/01/03
- [elpa] externals/compat b0f8f6eaac 61/84: Remove realname for ntake, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 45028d9fa7 64/84: Merge branch 'master' into emacs-29.1, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 68c6ccd5cc 68/84: Always load compat-macs, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 54565a768c 73/84: Abbreviate Makefile by re-using BYTEC, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 661ba3a441 74/84: Use 'equal' instead of 'file-equal-p', ELPA Syncer, 2023/01/03
- [elpa] externals/compat 55080acac2 82/84: Preliminary bump the version tag to 29.1.0.0-dev, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 4bd1226048 59/84: Rewrite take to copy only as much as required,
ELPA Syncer <=
- [elpa] externals/compat 835b4301b4 62/84: Add 'pure' and 'side-effect-free' properties to take, ELPA Syncer, 2023/01/03
- [elpa] externals/compat e7413bcf2b 63/84: Document additional missing functions from compat-29, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 7e4533ab45 65/84: Add compatibility notices to the end of the docstring, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 2ad7057293 70/84: Always load compat-macs.el while compiling, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 59e50fc7f4 71/84: Remove compat-macs.el from the list of files to byte-compile, ELPA Syncer, 2023/01/03
- [elpa] externals/compat a660d13326 75/84: Add while-let from Emacs 29, ELPA Syncer, 2023/01/03
- [elpa] externals/compat fcac0fa893 81/84: Update copyright years, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 8fbc3b6ea6 69/84: Bump to version 28.1.2.2, ELPA Syncer, 2023/01/03
- [elpa] externals/compat f42ebfaf97 35/84: Use compat--directory-name-p instead of directory-name-p, ELPA Syncer, 2023/01/03
- [elpa] externals/compat b98e7cc868 39/84: Fix gv-expander for compat-alist-get, ELPA Syncer, 2023/01/03