all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Byte-compilation of custom themes
Date: Sun, 03 Jun 2018 12:21:07 +0100	[thread overview]
Message-ID: <87muwc9kv0.fsf@tcd.ie> (raw)
In-Reply-To: <jwvpo18o7g4.fsf-monnier+gmane.emacs.devel@gnu.org> (Stefan Monnier's message of "Sat, 2 Jun 2018 23:52:22 -0400")

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I meant featurep, but since cl-assert is autoloaded, that shouldn't be
>
> AFAICT it's not autoloaded.

You're right, emacs -Q followed by (fboundp 'cl-assert) returns nil.

> I think the confusing comes from help-fns.el which does (require
> 'cl-lib), so if you do `C-h f cl-assert RET` it will indeed tell you
> it's autoloaded, but it's just because `C-h f` ended up requiring
> cl-lib.

No, the confusion comes from looking at the source of cl-macs.el, in
which cl-assert is given an ;;;###autoload cookie.  I see now that there
are some comments in cl-lib.el that suggest loading cl-loaddefs.el
involves some trickery, so I guess I don't get to eat the cake here.

In that case, I don't see how Eli's suggestion to predicate the
cl-assert call on (featurep 'cl-lib) will help, as feauturep is not
going to load the library for us.  Do we want the following instead?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: assert.diff --]
[-- Type: text/x-diff, Size: 857 bytes --]

diff --git a/lisp/custom.el b/lisp/custom.el
index 076790b661..e55c9db1ac 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1288,10 +1288,13 @@ custom-available-themes
 loaded, and no effort is made to check that the files contain
 valid Custom themes.  For a list of loaded themes, check the
 variable `custom-known-themes'."
+  (eval-when-compile (require 'cl-lib))
   (let ((suffix "-theme\\.el\\'")
         themes)
     (dolist (dir (custom-theme--load-path))
-      ;; `custom-theme--load-path' promises DIR exists and is a directory.
+      (cl-assert
+       (file-directory-p dir) t
+       "Non-existent directory in `custom-theme-load-path' expansion: %s")
       (dolist (file (directory-files dir nil suffix))
         (let ((theme (intern (substring file 0 (string-match-p suffix file)))))
           (and (custom-theme-name-valid-p theme)

[-- Attachment #3: Type: text/plain, Size: 11 bytes --]


-- 
Basil

  reply	other threads:[~2018-06-03 11:21 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=87muwc9kv0.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=eliz@gnu.org \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.