unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Basil L. Contovounesios" <contovob@tcd.ie>
Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: Re: Byte-compilation of custom themes
Date: Sat, 12 May 2018 10:04:10 +0300	[thread overview]
Message-ID: <831sehnymt.fsf@gnu.org> (raw)
In-Reply-To: <877eo9kjnl.fsf@tcd.ie> (contovob@tcd.ie)

> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Cc: <monnier@IRO.UMontreal.CA>,  <emacs-devel@gnu.org>
> Date: Fri, 11 May 2018 21:43:42 +0100
> 
> > We should at least have a comment there that we are relying on
> > custom-theme--load-path to do the test, and perhaps also an assertion.
> 
> Do you mean a cl-assertion, or an emulation thereof?

I meant cl-assert.

> Either way, what is the benefit of barfing before directory-files does?

That you can control the text of the error message, and make it more
user-friendly.  Also, an assertion clearly means we intended this not
to happen, rather than that the code failed to handle some valid
situation.

Once again, the minimum I requested was a comment; it's up to you
whether to use cl-assert.  But see below.

> Wouldn't a docstring for custom-theme--load-path and a comment in
> custom-available-themes suffice for the reader (they do for me)?

We've seen many situations where code guidelines are violated, for
whatever reasons, so just documenting stuff is not enough.  Moreover,
custom-theme--load-path might some day change and invalidate our
assumption.  The way to prevent that from happening could be either
having the assertion in the caller, or by adding a test to the test
suite that makes sure the list returned by custom-theme--load-path
never includes anything but existing directories.

>      (dolist (dir (custom-theme--load-path))
> +      ;; `custom-theme--load-path' promises DIR exists.

"promises DIR exists and is a directory", I think.

>  (defun custom-theme--load-path ()
> +  "Expand `custom-theme-load-path' into list of directories.
> +Only existing directories are included in the path returned."

I'd find this text a bit of a riddle.  How about this instead:

    "Expand `custom-theme-load-path' into list of directories.
  Members of `custom-theme-load-path' that either don't exist or are not
  directories are omitted from the expansion."

Thanks.



  reply	other threads:[~2018-05-12  7:04 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-20 21:01 Byte-compilation of custom themes Basil L. Contovounesios
2018-01-24 16:16 ` Stefan Monnier
2018-01-30 22:16   ` Basil L. Contovounesios
2018-01-31  2:26     ` Stefan Monnier
2018-02-01  0:45       ` Basil L. Contovounesios
2018-02-02 14:25         ` Stefan Monnier
2018-05-10  2:49           ` Basil L. Contovounesios
2018-05-10  2:54             ` Basil L. Contovounesios
2018-05-11 14:07               ` Eli Zaretskii
2018-05-11 14:02             ` Eli Zaretskii
2018-05-11 15:16               ` Basil L. Contovounesios
2018-05-11 16:03                 ` Stefan Monnier
2018-05-11 20:03                   ` Basil L. Contovounesios
2018-05-11 17:32                 ` Eli Zaretskii
2018-05-11 20:43                   ` Basil L. Contovounesios
2018-05-12  7:04                     ` Eli Zaretskii [this message]
2018-06-01 20:48                       ` Basil L. Contovounesios
2018-06-01 21:07                         ` Basil L. Contovounesios
2018-06-02 11:24                         ` Eli Zaretskii
2018-06-02 18:53                           ` Basil L. Contovounesios
2018-06-02 19:32                             ` Eli Zaretskii
2018-06-02 20:02                               ` Basil L. Contovounesios
2018-06-03  3:52                               ` Stefan Monnier
2018-06-03 11:21                                 ` Basil L. Contovounesios
2018-06-03 15:11                                   ` Eli Zaretskii
2018-06-03 16:08                                     ` Basil L. Contovounesios
2018-06-03 16:16                                       ` Eli Zaretskii
2018-06-03 17:48                                         ` Basil L. Contovounesios
2018-06-03 20:22                                           ` Stefan Monnier
2018-06-04  1:33                                             ` Basil L. Contovounesios
2018-07-03  7:57                                               ` Basil L. Contovounesios
2018-07-11  1:40                                                 ` Stefan Monnier
2018-07-11  6:05                                                   ` Basil L. Contovounesios

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=831sehnymt.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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).