unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs18@gmail.com
Cc: 7756@debbugs.gnu.org
Subject: bug#7756: 24.0.50; enhancements to package.el
Date: Fri, 31 Dec 2010 11:46:11 -0500	[thread overview]
Message-ID: <jwvfwtdhoyc.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <qtmfwtfkw77.fsf@gmail.com> (Richard Kim's message of "Thu, 30 Dec 2010 09:27:24 -0800")

>>> @@ -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





  reply	other threads:[~2010-12-31 16:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-29 18:40 bug#7756: 24.0.50; enhancements to package.el emacs18
2010-12-30 15:32 ` Stefan Monnier
2010-12-30 17:27   ` Richard Kim
2010-12-31 16:46     ` Stefan Monnier [this message]
2019-09-14 23:56 ` Stefan Kangas
2019-11-23 13:35   ` Lars Ingebrigtsen
2019-11-23 13:45     ` Eli Zaretskii
2019-11-26 15:01       ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvfwtdhoyc.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=7756@debbugs.gnu.org \
    --cc=emacs18@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).