[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cl-lib fbed770 06/10: Fixes: debbugs:16671
From: |
Stefan Monnier |
Subject: |
[elpa] externals/cl-lib fbed770 06/10: Fixes: debbugs:16671 |
Date: |
Tue, 1 Dec 2020 15:28:44 -0500 (EST) |
branch: externals/cl-lib
commit fbed7706b71babec4c515eb355fd39ef2225bfd3
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Fixes: debbugs:16671
* cl-lib.el (cl-position, cl-delete-duplicate): Don't advise if >=24.3.
(load-path): Try to make sure we're at the end.
---
cl-lib.el | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/cl-lib.el b/cl-lib.el
index 1ea22e0..cf13c56 100644
--- a/cl-lib.el
+++ b/cl-lib.el
@@ -4,7 +4,7 @@
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; vcomment: Emacs-24.3's version is 1.0 so this has to stay below.
-;; Version: 0.4
+;; Version: 0.5
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -36,6 +36,15 @@
;;; Code:
+;; We need to handle the situation where this package is used with an Emacs
+;; that comes with a real cl-lib (i.e. ≥24.3).
+
+;; First line of defense: try to make sure the built-in cl-lib comes earlier in
+;; load-path so we never get loaded:
+;;;###autoload (let ((d (file-name-directory #$)))
+;;;###autoload (when (member d load-path)
+;;;###autoload (setq load-path (append (remove d load-path) (list d)))))
+
(when (functionp 'macroexp--compiler-macro)
;; `macroexp--compiler-macro' was introduced as part of the big CL
;; reorganization which moved/reimplemented some of CL into core (mostly the
@@ -318,25 +327,27 @@
(message "%S already defined, not rebinding" new))
(defalias new fun))))
-(autoload 'cl-position "cl-seq")
-(defadvice cl-position (around cl-lib (cl-item cl-seq &rest cl-keys) activate)
+(unless (symbolp (symbol-function 'position))
+ (autoload 'cl-position "cl-seq")
+ (defadvice cl-position (around cl-lib (cl-item cl-seq &rest cl-keys)
activate)
(let ((argk (ad-get-args 2)))
(if (or (null argk) (keywordp (car argk)))
;; This is a call to cl-lib's `cl-position'.
(setq ad-return-value
(apply #'position (ad-get-arg 0) (ad-get-arg 1) argk))
;; Must be a call to cl's old `cl-position'.
- ad-do-it)))
+ ad-do-it))))
-(autoload 'cl-delete-duplicates "cl-seq")
-(defadvice cl-delete-duplicates (around cl-lib (cl-seq &rest cl-keys) activate)
+(unless (symbolp (symbol-function 'delete-duplicates))
+ (autoload 'cl-delete-duplicates "cl-seq")
+ (defadvice cl-delete-duplicates (around cl-lib (cl-seq &rest cl-keys)
activate)
(let ((argk (ad-get-args 1)))
(if (or (null argk) (keywordp (car argk)))
;; This is a call to cl-lib's `cl-delete-duplicates'.
(setq ad-return-value
(apply #'delete-duplicates (ad-get-arg 0) argk))
;; Must be a call to cl's old `cl-delete-duplicates'.
- ad-do-it)))
+ ad-do-it))))
(when (or (not (fboundp 'cl-member))
(eq (symbol-function 'cl-member) #'memq))
- [elpa] branch externals/cl-lib created (now 2cd9e37), Stefan Monnier, 2020/12/01
- [elpa] externals/cl-lib 455a801 01/10: * packages/cl-lib: New package., Stefan Monnier, 2020/12/01
- [elpa] externals/cl-lib 6f4af5f 02/10: Add cl-letf and cl-labels., Stefan Monnier, 2020/12/01
- [elpa] externals/cl-lib cad1a4c 03/10: * cl-lib.el: Try and patch things up in case we're hiding the real cl-lib., Stefan Monnier, 2020/12/01
- [elpa] externals/cl-lib cf5c963 05/10: * cl-lib.el: Resolve conflicts with old internal definitions (bug#16353)., Stefan Monnier, 2020/12/01
- [elpa] externals/cl-lib 2cd9e37 10/10: * .gitignore: New file, Stefan Monnier, 2020/12/01
- [elpa] externals/cl-lib 9062b27 08/10: * cl-lib/cl-lib.el: Don't use `emacs` package for Emacs<24, Stefan Monnier, 2020/12/01
- [elpa] externals/cl-lib fb8701d 04/10: * cl-lib.el (cl-labels): Demote error to message and improve it., Stefan Monnier, 2020/12/01
- [elpa] externals/cl-lib fbed770 06/10: Fixes: debbugs:16671,
Stefan Monnier <=
- [elpa] externals/cl-lib 67a7371 07/10: * cl-lib/cl-lib.el: Make it work for Emacs-21. Bump version to 0.6, Stefan Monnier, 2020/12/01
- [elpa] externals/cl-lib 59e400f 09/10: * cl-lib.el: Clarify that it's a forward compatibility version, Stefan Monnier, 2020/12/01