From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: Byte-compilation of custom themes Date: Sat, 02 Jun 2018 19:53:09 +0100 Message-ID: <87vab110mi.fsf@tcd.ie> References: <87efmk2qk0.fsf@tcd.ie> <87vafjhu04.fsf@tcd.ie> <87po5po7ul.fsf@tcd.ie> <87o9hoxm0w.fsf@tcd.ie> <83fu2ynvda.fsf@gnu.org> <87zi169q9y.fsf@tcd.ie> <83a7t6nlmf.fsf@gnu.org> <877eo9kjnl.fsf@tcd.ie> <831sehnymt.fsf@gnu.org> <874lim2pyi.fsf@tcd.ie> <83d0x9e8iu.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1527965482 17095 195.159.176.226 (2 Jun 2018 18:51:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Jun 2018 18:51:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 02 20:51:18 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPBcT-0004Hr-Jd for ged-emacs-devel@m.gmane.org; Sat, 02 Jun 2018 20:51:17 +0200 Original-Received: from localhost ([::1]:60778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPBeZ-0001fL-1y for ged-emacs-devel@m.gmane.org; Sat, 02 Jun 2018 14:53:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPBeP-0001fF-M6 for emacs-devel@gnu.org; Sat, 02 Jun 2018 14:53:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPBeL-0005aK-P0 for emacs-devel@gnu.org; Sat, 02 Jun 2018 14:53:17 -0400 Original-Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:37417) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPBeL-0005ZU-Ew for emacs-devel@gnu.org; Sat, 02 Jun 2018 14:53:13 -0400 Original-Received: by mail-wm0-x22f.google.com with SMTP id l1-v6so7723907wmb.2 for ; Sat, 02 Jun 2018 11:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=v6Kawm+2vIE2yX14FMccxAP9le1pDS7jcbqUGBkgut0=; b=MY/oqpIDBP317Dg7E0ojZfnnoxmf7Xymc00XZmne1GKLmyVMy4htY36RkHUBme0nqd 28ahkmMBcbHCIzOU5r4uYN+x+TgVu7tIiLFL/R6+OukB8v+qrZi7trJimIEQhYdOT8v4 oE6kS8bVnQMHMp1ZlRiU/muvcZnZKQoKWVZFKrBViNtdKMIv0lrxsb7vvBDx49Wi3cKP b47oB7q2J/gxROC2I63qYbloZZ87caltza/odtqX1WVwCg0Iui2dJz3jO5a6lD+rVnks j4vGmZYWzH91lUElsdxWqwk28L22KMTsiuy1RYj4vuUStrHYByQ/Z6nx+tPz6J1FXEWE ggYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=v6Kawm+2vIE2yX14FMccxAP9le1pDS7jcbqUGBkgut0=; b=FFByIzLDvmmzeODk8iY4LXAhx84eCY/Na5pa7xUgU0KqIV740MEVIeLg1V3MaKrSdO cdIzGAaBDnYYmEH0KS658+fDXverEaGAQcc6QNG0H2Da30paEryb29/ZWAgffVOM4BfZ YBiU90J2YZfyu8MrDInNJK44GukXZOv2EOUTRQChEXe7Hi5cAjz6Boz3rQoW57U1iDoH tb9k14ai/N2xPaegjc+TsiyWiXYOTzfONv7pZvPko17SNXj6T17N8mHoEpj26hopGEHr WfATPUXkW05CPisKcJs+6/eC81Bkwd1yubATfYHmjDs9rzlCTxtLGOfqT/p7zipnAu+i yAUA== X-Gm-Message-State: ALKqPwczbvq1DuurEtSizajwYGo68iUffX79PPsLBOjzjP4WYtSDnrZP manp0Sppa9++bXBUUEy0eGR44Q== X-Google-Smtp-Source: ADUXVKIA4itw61vLexpyXvqne0tE9peWPBIYy1Ar3XRqlzmTmK+qGT202udLifwTL+NxvdCGfvw93g== X-Received: by 2002:a50:86eb:: with SMTP id 40-v6mr18007571edu.177.1527965591898; Sat, 02 Jun 2018 11:53:11 -0700 (PDT) Original-Received: from localhost ([213.233.149.8]) by smtp.gmail.com with ESMTPSA id b4-v6sm23098767edr.29.2018.06.02.11.53.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Jun 2018 11:53:10 -0700 (PDT) In-Reply-To: <83d0x9e8iu.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 2 Jun 2018 14:24:09 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225932 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: "Basil L. Contovounesios" >> Cc: , >> Date: Fri, 01 Jun 2018 21:48:21 +0100 >> >> >> Do you mean a cl-assertion, or an emulation thereof? >> > >> > I meant cl-assert. >> >> Unless I (being unfamiliar with the subtleties of the build and >> bootstrap process) am missing something, I think it's too early to load >> cl-lib here; at least 'make bootstrap' fails for me when I add >> (eval-when-compile (require 'cl-lib)) to custom.el. Is there a way >> around this? > > Yes, explicitly check whether cl-lib is available, and skip the call > if not. We don't need this assertion during the bootstrap. It somehow evaded me until now that cl-assert has an autoload cookie. This means I can get away with calling it in custom-available-themes without first requiring cl-lib, whether at top-level or inside the function, right? In other words, is the following kosher (and is the wording up to scratch)? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=assert.diff diff --git a/lisp/custom.el b/lisp/custom.el index 076790b661..f08a8e9c3e 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1291,7 +1291,9 @@ custom-available-themes (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) --=-=-= Content-Type: text/plain If not, WDYM exactly by "check whether cl-lib is available"? Passing a non-nil NOERROR argument to a top-level (eval-when-compile (require 'cl-lib nil t)) still causes 'make bootstrap' to fail, and writing (when (require/featurep/fboundp ...) (cl-assert ...)) in custom-available-themes doesn't make sense to me, especially given that cl-assert is autoloaded. Am I misunderstanding something? Sorry about my slow uptake on this; I'm not deliberately trying to be obtuse, rather trying to learn what the best approach is here and why. Thanks, -- Basil --=-=-=--