Add require/ function
This commit is contained in:
parent
fc03087cc0
commit
90056b3191
18
lisp/acdw.el
18
lisp/acdw.el
|
@ -878,7 +878,23 @@ three blank lines, then place the point on the second one."
|
|||
(newline)
|
||||
(delete-blank-lines)
|
||||
(newline 2)
|
||||
(previous-line))
|
||||
(forward-line -1))
|
||||
|
||||
(defun require/ (feature &optional filename noerror)
|
||||
"If FEATURE is not loaded, load it from FILENAME.
|
||||
This function works just like `require', with one crucial
|
||||
difference: if the FEATURE name contains a slash, the FILENAME
|
||||
will as well -- unless, of course, FILENAME is set. This allows
|
||||
for `require/' to require files within subdirectories of
|
||||
directories of `load-path'. Of course, NOERROR isn't affected by
|
||||
the change."
|
||||
(let* ((feature-name (if (symbolp feature)
|
||||
(symbol-name feature)
|
||||
feature))
|
||||
(filename (or filename
|
||||
(and (string-match-p "/" feature-name)
|
||||
feature-name))))
|
||||
(require (intern feature-name) filename noerror)))
|
||||
|
||||
(provide 'acdw)
|
||||
;;; acdw.el ends here
|
||||
|
|
Loading…
Reference in New Issue