Closed tarsius closed 11 years ago
ping
Can you give an example? I haven't run into this problem.
Also, if this is true, then it would probably be better to change the filename rather than the mode name.
From the elisp info page:
-- Function: require feature &optional filename noerror
This function checks whether FEATURE is present in the current
Emacs session (using `(featurep FEATURE)'; see below). The
argument FEATURE must be a symbol.
If the feature is not present, then `require' loads FILENAME with
`load'. If FILENAME is not supplied, then the name of the symbol
FEATURE is used as the base file name to load. However, in this
case, `require' insists on finding FEATURE with an added `.el' or
`.elc' suffix (possibly extended with a compression suffix); a
file whose name is just FEATURE won't be used. (The variable
`load-suffixes' specifies the exact required Lisp suffixes.)
If NOERROR is non-`nil', that suppresses errors from actual
loading of the file. In that case, `require' returns `nil' if
loading the file fails. Normally, `require' returns FEATURE.
If loading the file succeeds but does not provide FEATURE,
`require' signals an error, `Required feature FEATURE was not
provided'.
It doesn't mention trying with suffix -mode
removed or added. And it does mention that failing to provide the correct feature will cause an error. So... it is true :-)
$ echo "(provide 'foo-mode)" > somewhere/in/load-path/foo.el
M-x eval-expression RET (require 'foo-mode) RET
Debugger entered--Lisp error: (file-error "Cannot open load file" "foo-mode")
require(foo-mode)
eval((require (quote foo-mode)) nil)
eval-expression((require (quote foo-mode)) nil)
call-interactively(eval-expression t nil)
execute-extended-command(nil)
call-interactively(execute-extended-command nil nil)
M-x eval-expression RET (require 'foo) RET
Debugger entered--Lisp error: (error "Required feature `foo' was not provided")
require(foo)
eval((require (quote foo)) nil)
eval-expression((require (quote foo)) nil)
call-interactively(eval-expression t nil)
execute-extended-command(nil)
call-interactively(execute-extended-command nil nil)
If you haven't run into this problem then this is because you load the library differently; e.g. using load-file or with the help of extracted autoload definitions.
Yes, renaming the file is another option.
Have you decided how to fix this problem yet?
ping
Does that work?
The feature has to match the filename; otherwise (require FEATURE) won't work.