[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash ff323e0 049/316: Fix setf on emacs23 (#205)
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash ff323e0 049/316: Fix setf on emacs23 (#205) |
Date: |
Mon, 15 Feb 2021 15:57:23 -0500 (EST) |
branch: externals/dash
commit ff323e0fda3e403fd3e2e55c7bfc551238f6797c
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Matus Goljer <dota.keys@gmail.com>
Fix setf on emacs23 (#205)
`gv-define-simple-setter` is not defined on Emacs 23, so we need to use
the macro `defsetf` on Emacs 23. `defsetf` is not autoloaded, so we must
require 'cl before using it. We don't need to load 'cl on later Emacs
versions.
However, the whole form is macro-expanded on all Emacs versions. Emacs
24+ assumes that `(defsetf ...)` is a function call because it hasn't
loaded 'cl. This generates byte-compile warnings about unused variables
and nonexistent functions, so silence those.
---
dash.el | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/dash.el b/dash.el
index 80f596a..4444a10 100644
--- a/dash.el
+++ b/dash.el
@@ -578,14 +578,26 @@ Alias: `-any'"
\(fn LIST)")
-(gv-define-simple-setter -first-item setcar)
+;; TODO: emacs23 support, when dropped remove the condition
+(eval-when-compile
+ (require 'cl)
+ (if (fboundp 'gv-define-simple-setter)
+ (gv-define-simple-setter -first-item setcar)
+ (require 'cl)
+ (with-no-warnings
+ (defsetf -first-item (x) (val) `(setcar ,x ,val)))))
(defun -last-item (list)
"Return the last item of LIST, or nil on an empty list."
(declare (pure t) (side-effect-free t))
(car (last list)))
-(gv-define-setter -last-item (val x) `(setcar (last ,x) ,val))
+;; TODO: emacs23 support, when dropped remove the condition
+(eval-when-compile
+ (if (fboundp 'gv-define-setter)
+ (gv-define-setter -last-item (val x) `(setcar (last ,x) ,val))
+ (with-no-warnings
+ (defsetf -last-item (x) (val) `(setcar (last ,x) ,val)))))
(defun -butlast (list)
"Return a list of all items in list except for the last."
- [elpa] externals/dash 27b1ea5 030/316: Update changelog for 2.12.x., (continued)
- [elpa] externals/dash 27b1ea5 030/316: Update changelog for 2.12.x., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 52e7eb4 031/316: Merge pull request #191 from Wilfred/update_changelog, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3075aea 040/316: Add -unzip, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2996a0d 035/316: Add a LICENSE file (#194), ELPA Syncer, 2021/02/15
- [elpa] externals/dash 9dfb01a 050/316: Correct use of eval-after-load, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 75cde71 052/316: Ensure that -first-item is as fast as car, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 05dc0aa 062/316: Add copyright assignment statement to documentation, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4de2189 027/316: [Feature #185] -cut <> in first slot is a function, ELPA Syncer, 2021/02/15
- [elpa] externals/dash b45b38a 039/316: Fix typo, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 07c61f5 046/316: [#200] Add tests for generalized variables, ELPA Syncer, 2021/02/15
- [elpa] externals/dash ff323e0 049/316: Fix setf on emacs23 (#205),
ELPA Syncer <=
- [elpa] externals/dash 958e3fb 051/316: Merge pull request #206 from Silex/master, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 98e819e 053/316: Merge pull request #210 from Wilfred/car_opcode_with_first_item, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6a57833 054/316: Add -iota (#207), ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1e14307 061/316: Merge pull request #221 from zck/it-anywhere-in-->, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0468a31 063/316: Merge pull request #223 from phillord/feature/doc-copyright, ELPA Syncer, 2021/02/15
- [elpa] externals/dash f69a9df 071/316: Replace -first with -some in -any?, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1422b70 042/316: Update info, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 73a28ae 043/316: Fix function application in documentation, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 53e641c 044/316: [Fix #202] -table-flat works on input of dimension 1, ELPA Syncer, 2021/02/15
- [elpa] externals/dash f04df47 048/316: Fix the debug declaration for -->, ELPA Syncer, 2021/02/15