[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a820b19 11/17: Fixes #6 - this time for sure!?
From: |
Rocky Bernstein |
Subject: |
[elpa] master a820b19 11/17: Fixes #6 - this time for sure!? |
Date: |
Thu, 25 May 2017 02:05:04 -0400 (EDT) |
branch: master
commit a820b199d37c8fca05695277befa7cda3edf514a
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Fixes #6 - this time for sure!?
Premature optimization is the root of evil/eval.
---
load-relative.el | 23 +++++------------------
test/test-load.el | 15 ---------------
2 files changed, 5 insertions(+), 33 deletions(-)
diff --git a/load-relative.el b/load-relative.el
index 8eb3578..3dfab22 100644
--- a/load-relative.el
+++ b/load-relative.el
@@ -102,7 +102,6 @@
;; This is easier if you care about the contents of the file, rather than
;; a buffer.
-
;;; Code:
;;;###autoload
@@ -134,17 +133,17 @@ methods work we will use the file-name value find via
;; persists after loading or evaluating a file. So it would be
;; suitable if __FILE__ were called from inside a function.
-
(cond
+
;; lread.c's readevalloop sets (car current-load-list)
;; via macro LOADHIST_ATTACH of lisp.h. At least in Emacs
;; 23.0.91 and this code goes back to '93.
- ((load-relative:file-from-load-history current-load-list))
+ ((stringp (car-safe current-load-list)) (car current-load-list))
;; load-like things. 'relative-file-expand' tests in
;; test/test-load.el indicates we should put this ahead of
;; $#.
- ;; (load-file-name)
+ (load-file-name)
;; Pick up "name of this file as a string" which is set on
;; reading and persists. In contrast, load-file-name is set only
@@ -160,8 +159,8 @@ methods work we will use the file-name value find via
;; bytecomp-filename comes from that routine?
((boundp 'bytecomp-filename) bytecomp-filename)
- (t (symbol-file symbol)) ;; last resort
- ))
+ (t (symbol-file symbol) ;; last resort
+ )))
(defun autoload-relative (function-or-list
file &optional docstring interactive type
@@ -276,10 +275,6 @@ buffer-setting or buffer changing operations."
"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))))
(dolist (rel-file ,list)
(require-relative rel-file (__FILE__) ,opt-prefix))))
@@ -297,14 +292,6 @@ same as writing (provide 'bar-foo)
`(provide (intern (concat ,prefix (file-name-sans-extension
(file-name-nondirectory (__FILE__)))))))
-(defun load-relative:file-from-load-history (history-list)
- "Pick out the first string in `history-list"
- (cond
- ((null history-list) nil)
- ((stringp (car history-list)) (car history-list))
- (t (load-relative:file-from-load-history (cdr history-list)))
- ))
-
(provide-me)
;;; load-relative.el ends here
diff --git a/test/test-load.el b/test/test-load.el
index 16715a2..1002996 100644
--- a/test/test-load.el
+++ b/test/test-load.el
@@ -94,19 +94,4 @@
(provide-me "my-")
(assert-t (featurep 'my-test-load) "provide-me - prefix")
-(assert-nil (load-relative:file-from-load-history nil)
- "null load-history")
-
-(assert-equal
- "/tmp/realgud/common/track-mode.el"
- (load-relative:file-from-load-history
- '((require . load-relative) (require . shell) (require . cl)
- "/tmp/realgud/common/track-mode.el"))
- "load-history list with require's")
-
-(assert-equal
- "/tmp/foo.bar"
- (load-relative:file-from-load-history '("/tmp/foo.bar"))
- "load-history with single filename")
-
(end-tests)
- [elpa] master c719e8d 07/17: Another travis try, (continued)
- [elpa] master c719e8d 07/17: Another travis try, Rocky Bernstein, 2017/05/25
- [elpa] master 918a452 05/17: load-history list might not have string car, Rocky Bernstein, 2017/05/25
- [elpa] master 84f4a5e 03/17: * load-relative/test/test-file.el: Fix up copyright, Rocky Bernstein, 2017/05/25
- [elpa] master 839f651 02/17: Organization cleanup, Rocky Bernstein, 2017/05/25
- [elpa] master 4991912 13/17: Fix docstring quoting. New el-get method., Rocky Bernstein, 2017/05/25
- [elpa] master ec20ba0 15/17: Update README.md: fix small typos, Rocky Bernstein, 2017/05/25
- [elpa] master 8280df5 16/17: Merge pull request #7 from ohspite/patch-1, Rocky Bernstein, 2017/05/25
- [elpa] master 9514dcd 04/17: Merge branch 'master' of github.com:rocky/emacs-load-relative, Rocky Bernstein, 2017/05/25
- [elpa] master 9a4289a 06/17: Can't figure out how to MELPA load test-simple, Rocky Bernstein, 2017/05/25
- [elpa] master 0a40d7d 09/17: Another travis try, Rocky Bernstein, 2017/05/25
- [elpa] master a820b19 11/17: Fixes #6 - this time for sure!?,
Rocky Bernstein <=
- [elpa] master 9afba2e 17/17: Merge commit '8280df5ce6db836559a5c2442b97a2f02b6f7a05', Rocky Bernstein, 2017/05/25
- [elpa] master 2aa165f 12/17: Reinstate old load-relative ..., Rocky Bernstein, 2017/05/25