[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 153f5cd: * load-relative.el (require-relative-list): Don't
From: |
Stefan Monnier |
Subject: |
[elpa] master 153f5cd: * load-relative.el (require-relative-list): Don't spuriously require `cl`. |
Date: |
Fri, 31 May 2019 17:35:27 -0400 (EDT) |
branch: master
commit 153f5cd95aae2fa4676fdc6ff5e7706285b54ea3
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* load-relative.el (require-relative-list): Don't spuriously require `cl`.
Use `eval-and-compile` to simplify the code.
(autoload-relative): Use `mapc` since we don't care about the return value.
---
packages/load-relative/load-relative.el | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/packages/load-relative/load-relative.el
b/packages/load-relative/load-relative.el
index 976d0da..c8f5815 100644
--- a/packages/load-relative/load-relative.el
+++ b/packages/load-relative/load-relative.el
@@ -6,7 +6,7 @@
;; URL: http://github.com/rocky/emacs-load-relative
;; Compatibility: GNU Emacs 23.x
-;; Copyright (C) 2015, 2016, 2017 Free Software Foundation, Inc
+;; Copyright (C) 2015-2019 Free Software Foundation, Inc
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@@ -172,6 +172,7 @@ methods work we will use the file-name value find via
(defun autoload-relative (function-or-list
file &optional docstring interactive type
symbol)
+ ;; FIXME: Docstring talks of FUNCTION but argname is `function-or-list'.
"Autoload an Emacs Lisp file relative to Emacs Lisp code that is in
the process of being loaded or eval'd.
@@ -182,7 +183,7 @@ FILE is a string to pass to `load'.
DOCSTRING is documentation for the function.
-INTERACATIVE if non-nil says function can be called
+INTERACTIVE if non-nil says function can be called
interactively.
TYPE indicates the type of the object: nil or omitted says
@@ -197,10 +198,14 @@ defined (as given by `symbol-file' is used if other
methods of
finding __FILE__ don't work."
(if (listp function-or-list)
- (mapcar (lambda(function)
- (autoload function-or-list
- (relative-expand-file-name file symbol)
- docstring interactive type))
+ ;; FIXME: This looks broken:
+ ;; - Shouldn't it iterate on `function-or-list' instead of `file'?
+ ;; - Shouldn't the `autoload' take `function' rather than
+ ;; `function-or-list' as argument?
+ (mapc (lambda(_function)
+ (autoload function-or-list
+ (relative-expand-file-name file symbol)
+ docstring interactive type))
file)
(autoload function-or-list (relative-expand-file-name file symbol)
docstring interactive type))
@@ -283,11 +288,7 @@ buffer-setting or buffer changing operations."
(defmacro require-relative-list (list &optional opt-prefix)
"Run `require-relative' on each name in LIST which should be a list of
strings, each string being the relative name of file you want to run."
- `(progn
- (eval-when-compile
- (require 'cl
- (dolist (rel-file ,list)
- (require-relative rel-file (__FILE__) ,opt-prefix))))
+ `(eval-and-compile
(dolist (rel-file ,list)
(require-relative rel-file (__FILE__) ,opt-prefix))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] master 153f5cd: * load-relative.el (require-relative-list): Don't spuriously require `cl`.,
Stefan Monnier <=