[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/load-relative d8757b3c54 09/15: require-relative: allow
From: |
ELPA Syncer |
Subject: |
[elpa] externals/load-relative d8757b3c54 09/15: require-relative: allow symbols as well as strings |
Date: |
Tue, 14 Feb 2023 05:58:07 -0500 (EST) |
branch: externals/load-relative
commit d8757b3c54ac7753987c5474725ff817ef3b5600
Author: Daniel Pittman <daniel@rimspace.net>
Commit: GitHub <noreply@github.com>
require-relative: allow symbols as well as strings
This updates `require-relative' to allow a symbol to be passed; it is
simply converted to a string and used exactly as before.
Theoretically it could be optimised to avoid `intern' on a symbol, but
loading code is expensive enough I can't imagine it matters.
This allows for the more natural, to me:
`(require-relative 'usbhid-data)`
---
load-relative.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/load-relative.el b/load-relative.el
index af9b711a3d..290166b0f3 100644
--- a/load-relative.el
+++ b/load-relative.el
@@ -278,9 +278,12 @@ symbol.
WARNING: it is best to to run this function before any
buffer-setting or buffer changing operations."
- (let ((require-string-name
- (concat opt-prefix (file-name-sans-extension
- (file-name-nondirectory relative-file)))))
+ (let* ((relative-file (if (symbolp relative-file)
+ (symbol-name relative-file)
+ relative-file))
+ (require-string-name
+ (concat opt-prefix (file-name-sans-extension
+ (file-name-nondirectory relative-file)))))
(require (intern require-string-name)
(relative-expand-file-name relative-file opt-file))))
- [elpa] externals/load-relative 4c69d88db1 03/15: Typo, (continued)
- [elpa] externals/load-relative 4c69d88db1 03/15: Typo, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative 738896e3da 04/15: Merge branch 'master' of github.com:rocky/emacs-load-relative, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative 85b88d6fbf 08/15: http:// -> https://, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative d6b4b9f379 02/15: Bump version number to keep in sync with elpa, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative 590c816d7a 12/15: Merge pull request #9 from rocky/try-workflows, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative ff2a827144 13/15: Merge pull request #8 from slippycheeze/patch-1, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative e46c6d74b8 05/15: * load-relative.el (require-relative-list): Don't spuriously require `cl`., ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative 8635c7bb30 10/15: Create main.yml, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative 5055bfd806 06/15: Get ready for release 1.3.1, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative dbcd7cbcca 07/15: A small GNU-emacs thing, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative d8757b3c54 09/15: require-relative: allow symbols as well as strings,
ELPA Syncer <=
- [elpa] externals/load-relative 7a90146364 11/15: Remove travis. Add workflows badge, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative e79d8f1581 14/15: Merge branch 'externals/load-relative' of https://git.sv.gnu.org/git/emacs/elpa, ELPA Syncer, 2023/02/14
- [elpa] externals/load-relative b7987c265a 15/15: Bit rot ..., ELPA Syncer, 2023/02/14