Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rocky/emacs-load-relative
Browse files Browse the repository at this point in the history
Conflicts:
	load-relative.el
  • Loading branch information
rocky committed Apr 6, 2013
2 parents 7de0162 + 9654e71 commit ff106d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
@@ -1,7 +1,7 @@
lisp_files := $(wildcard *.el) lisp_files := $(wildcard *.el)
lisp_LISP = $(lisp_files) lisp_LISP = $(lisp_files)


EXTRA_DIST = $(lisp_files) $(test_files) README.textile COPYING EXTRA_DIST = $(lisp_files) $(test_files) README.textile THANKS COPYING


#: Run all tests #: Run all tests
check: $(test-files) check: $(test-files)
Expand Down
1 change: 1 addition & 0 deletions THANKS
@@ -0,0 +1 @@
Lars Anderson - Melapa packaging, among other things
10 changes: 7 additions & 3 deletions load-relative.el
@@ -1,7 +1,7 @@
;;; load-relative.el --- relative file load (within a multi-file Emacs package) ;;; load-relative.el --- relative file load (within a multi-file Emacs package)


;; Author: Rocky Bernstein ;; Author: Rocky Bernstein
;; Version: 0.02 ;; Version: 0.2.0
;; Keywords: internal ;; Keywords: internal
;; URL: http://github.com/rocky/emacs-load-relative ;; URL: http://github.com/rocky/emacs-load-relative
;; Compatibility: GNU Emacs 23.x ;; Compatibility: GNU Emacs 23.x
Expand Down Expand Up @@ -88,7 +88,7 @@
;; Using this constrains the `provide' name to be the same as ;; Using this constrains the `provide' name to be the same as
;; the filename, but I consider that a good thing. ;; the filename, but I consider that a good thing.



;;;###autoload
(defun __FILE__ (&optional symbol) (defun __FILE__ (&optional symbol)
"Return the string name of file/buffer that is currently begin executed. "Return the string name of file/buffer that is currently begin executed.
Expand Down Expand Up @@ -149,7 +149,7 @@ methods work we will use the file-name value find via
(defun autoload-relative (function-or-list (defun autoload-relative (function-or-list
file &optional docstring interactive type file &optional docstring interactive type
symbol) symbol)
"autoload an Emacs Lisp file relative to Emacs Lisp code that is in "Autoload an Emacs Lisp file relative to Emacs Lisp code that is in
the process of being loaded or eval'd. the process of being loaded or eval'd.
Expand Down Expand Up @@ -183,6 +183,7 @@ finding __FILE__ don't work."
docstring interactive type)) docstring interactive type))
) )


;;;###autoload
(defun load-relative (file-or-list &optional symbol) (defun load-relative (file-or-list &optional symbol)
"Load an Emacs Lisp file relative to Emacs Lisp code that is in "Load an Emacs Lisp file relative to Emacs Lisp code that is in
the process of being loaded or eval'd. the process of being loaded or eval'd.
Expand Down Expand Up @@ -212,6 +213,7 @@ buffer-setting or buffer changing operations."
(setq prefix (file-name-directory file)) (setq prefix (file-name-directory file))
(expand-file-name (concat prefix relative-file)))) (expand-file-name (concat prefix relative-file))))


;;;###autoload
(defun require-relative (relative-file &optional opt-file opt-prefix) (defun require-relative (relative-file &optional opt-file opt-prefix)
"Run `require' on an Emacs Lisp file relative to the Emacs Lisp code "Run `require' on an Emacs Lisp file relative to the Emacs Lisp code
that is in the process of being loaded or eval'd. The symbol used in require that is in the process of being loaded or eval'd. The symbol used in require
Expand All @@ -226,6 +228,7 @@ buffer-setting or buffer changing operations."
(require (intern require-string-name) (require (intern require-string-name)
(relative-expand-file-name relative-file opt-file)))) (relative-expand-file-name relative-file opt-file))))


;;;###autoload
(defmacro require-relative-list (list &optional opt-prefix) (defmacro require-relative-list (list &optional opt-prefix)
"Run `require-relative' on each name in LIST which should be a list of "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." strings, each string being the relative name of file you want to run."
Expand All @@ -237,6 +240,7 @@ strings, each string being the relative name of file you want to run."
(dolist (rel-file ,list) (dolist (rel-file ,list)
(require-relative rel-file (__FILE__) ,opt-prefix)))) (require-relative rel-file (__FILE__) ,opt-prefix))))


;;;###autoload
(defmacro provide-me ( &optional prefix ) (defmacro provide-me ( &optional prefix )
"Call `provide' with the feature's symbol name made from "Call `provide' with the feature's symbol name made from
source-code's file basename sans extension. For example if you source-code's file basename sans extension. For example if you
Expand Down

0 comments on commit ff106d6

Please sign in to comment.