about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-10-07 16:00:39 -0500
committerCase Duckworth2021-10-07 16:00:39 -0500
commit90056b3191eddccee2954b36ee77137fdec5ce29 (patch)
tree24e8b34c1ad4556e54cbbf68c850c68f5b0aa834
parentAdd README.org (diff)
downloademacs-90056b3191eddccee2954b36ee77137fdec5ce29.tar.gz
emacs-90056b3191eddccee2954b36ee77137fdec5ce29.zip
Add require/ function
-rw-r--r--lisp/acdw.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index cc73071..50ca00c 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -878,7 +878,23 @@ three blank lines, then place the point on the second one."
878 (newline) 878 (newline)
879 (delete-blank-lines) 879 (delete-blank-lines)
880 (newline 2) 880 (newline 2)
881 (previous-line)) 881 (forward-line -1))
882
883(defun require/ (feature &optional filename noerror)
884 "If FEATURE is not loaded, load it from FILENAME.
885This function works just like `require', with one crucial
886difference: if the FEATURE name contains a slash, the FILENAME
887will as well -- unless, of course, FILENAME is set. This allows
888for `require/' to require files within subdirectories of
889directories of `load-path'. Of course, NOERROR isn't affected by
890the change."
891 (let* ((feature-name (if (symbolp feature)
892 (symbol-name feature)
893 feature))
894 (filename (or filename
895 (and (string-match-p "/" feature-name)
896 feature-name))))
897 (require (intern feature-name) filename noerror)))
882 898
883(provide 'acdw) 899(provide 'acdw)
884;;; acdw.el ends here 900;;; acdw.el ends here