GNU bug report logs -
#7756
24.0.50; enhancements to package.el
Previous Next
Reported by: emacs18 <at> gmail.com
Date: Wed, 29 Dec 2010 18:38:01 UTC
Severity: minor
Tags: patch
Found in version 24.0.50
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>> @@ -338,9 +338,14 @@
>>> (pkg-file (expand-file-name
>>> (concat (package-strip-version package) "-pkg")
>>> pkg-dir)))
>>> - (when (and (file-directory-p pkg-dir)
>>> - (file-exists-p (concat pkg-file ".el")))
>>> - (load pkg-file nil t))))
>>> + ;; When one is creating a package and testing it out, it is easy
>>> + ;; to forget to add the -pkg.el file. When that happens, it would
>>> + ;; be useful to provide feedback to the user rather than silently
>>> + ;; failing. That is what (error ...) below is for.
>>> + (when (file-directory-p pkg-dir)
>>> + (if (file-exists-p (concat pkg-file ".el"))
>>> + (load pkg-file nil t)
>>> + (error "'%s' file is missing!")))))
>>
>> I agree with the intention, but I wonder: why do we pass the `noerror'
>> parameter to `load' in the first place?
> Thanks for looking into this.
> I was focused in adding the error message and neglected to re-examine
> the arguments to `load', i.e., I just kept the existing code. I suppose
> it was used before my proposed change to prevent signalling error if the
> file was not found. With the proposed change, since we check for the
> existence of the file prior to calling `load', I suppose it is
> appropriate to no longer pass `noerror'. Good catch. Also I'm sure you
> have noticed that I forgot to add `pkg-file' argument to (error ...)
> expression above.
Right, so a simpler way to make the change is to not add an explicit
check but instead just remove the `noerror' argument. So your patch is
apparently changing a consciously made decision to ignore errors.
I tend to agree with the change, but I'd first understand why someone
decided to ignore those error.
Stefan
This bug report was last modified 5 years and 183 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.