[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] elpa-admin 5bb5972 016/357: load-relative.el: Add provide-me and
From: |
Stefan Monnier |
Subject: |
[elpa] elpa-admin 5bb5972 016/357: load-relative.el: Add provide-me and make GPL v3. |
Date: |
Thu, 10 Dec 2020 18:06:06 -0500 (EST) |
branch: elpa-admin
commit 5bb59724bbeb7c1703debc3280fb0271b461f7c6
Author: rocky <rocky@gnu.org>
Commit: rocky <rocky@gnu.org>
load-relative.el: Add provide-me and make GPL v3.
README: expand and turn into red-cloth markup.
---
README | 58 ++++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 46 insertions(+), 12 deletions(-)
diff --git a/README b/README
index 3ddcec8..fb75923 100644
--- a/README
+++ b/README
@@ -1,19 +1,53 @@
-Here we add two functions load-relative and __FILE__
+h2. Emacs relative-file _load_, _require_ *==__FILE__==* and a _provide-me_
macro.
-load-relative(symbol) loads an Emacs Lisp file relative to another
-(presumably currently running) Emacs Lisp file.
+Here we add functions: *load-relative*, *require-relative*,
+*require-relative-list*, *==__FILE__==*, and macro *provide-me*.
-Example:
+The latest version is at
"http://github.com/rocky/emacs-load-relative/"://github.com/rocky/emacs-load-relative/
-(provide 'foo-bar)
-(load-relative "baz" 'foo-bar)
+h3. *==__FILE__==*
-__FILE__(symbol) returns the file that symbol was defined it, however
-if you are currently running load, that file name is given instead.
-If symbol is not defined and you are not loading a file, then nil is
-returned.
+*==__FILE__==* returns the file name that that the calling program is
+running. If you are _eval_'ing a buffer then the file name of that
+buffer is used. The name was selected to be analogous to the name its use in C
or Ruby.
-The symbol parameter is an artifact in both load-relative and __FILE__
-that I would like to remove. Right now I don't see how to.
+h3. _load-relative_
+_load-relative_ loads an Emacs Lisp file relative to another (presumably
currently running) Emacs Lisp file. For example if you have files _foo.el_ and
_bar.el_ in the same directory, then to load Emacs Lisp file _bar.el_ from
inside Emacs lisp file _foo.el_:
+bc. (require 'load-relative)
+ (load-relative "baz")
+
+That _load-relative_ line could above have also been written as:
+
+bc. (load-relative "./baz")
+
+or:
+
+bc. (load-relative "baz.el") # if you want to exclude any byte-compiled files
+
+h3. require-relative, require-relative-list
+
+If instead of loading file _baz_, you want to _require_ it:
+
+bc. (require-relative "baz")
+
+or
+
+bc. (require-relative "./baz")
+
+The above not only does a _require_ on _'baz_, but makes sure you get
+that from the same file as you would have if you had issued _load_relative_.
+
+If you have a list of files you want to _require_, you can require
+them one shot using _require-relative-list_ like this:
+
+bc. (require-relative-list '("dbgr-init" "dbgr-fringe"))
+
+h3. provide-me
+
+Finally, macro _provide-me_ saves you the trouble of adding a symbol
+after _provide_, by using the file basename (without directory or file
+extension) as the name of the thing you want to provide. Using this
+forces the _provide_ names to be the same as the filename, but I
+consider that a good thing.
- [elpa] elpa-admin 26ce878 006/357: # Updated for SourceForge, (continued)
- [elpa] elpa-admin 26ce878 006/357: # Updated for SourceForge, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 938c532 010/357: add README file., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 3f66070 019/357: Turn README back into text. Add special redcloth version., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 6de6395 017/357: See if changing the name from README to README.markup gives github a clue, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 1329950 024/357: Administrivia. Add COPYING, update README and .gitignore, bump version number., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 03e28d1 028/357: README: Document usage of this repository in detail., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 5bbab91 030/357: * packages/all-1.0.el: Change version. Address byte-compiler warnings., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin ab46aeb 014/357: Relative loads for Emacs Lisp files. Adds functions __FILE__ and, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin d656221 020/357: Track original positions in the face of possible edits. Intended use in debugging where one might edit the file but continue editing., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 015e981 004/357: # Added comment about loading supplied classes separately., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 5bb5972 016/357: load-relative.el: Add provide-me and make GPL v3.,
Stefan Monnier <=
- [elpa] elpa-admin 8b07a20 027/357: * README: Explain how to run the repo build script., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 07ef2ff 033/357: Add README file, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 7b9d56b 038/357: README: Move copyright and license text to the end, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 50b05c8 074/357: Add SML-mode., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 4866cb7 057/357: admin/archive-contents.el (archive--delete-elc-files): Delete backup files too., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 842d54c 056/357: * admin/archive-contents.el (batch-make-site-dir, archive--write-pkg-file): New functions., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin becd7be 063/357: * archive-contents.el (archive--make-changelog): New fun., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 33a5782 042/357: Ensure case-fold-search=t in the example email detect function, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin cff4ab8 045/357: Add a note for programmers about wcheck-marked-text-at, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 3afe3ac 060/357: Use org-mode markup in README and rename it to README.org, Stefan Monnier, 2020/12/10